From c1653c404446b3097a0618b4f424b2c95a1dc9fb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 31 Mar 2026 17:10:12 +0530 Subject: [PATCH 01/18] chore: update Node.js SDK to 23.1.0 --- .github/workflows/publish.yml | 2 +- .gitignore | 3 + CHANGELOG.md | 6 + package-lock.json | 4816 +++++++++++++++++++++++++++++++++ package.json | 2 +- src/client.ts | 8 +- test/services/account.test.js | 8 +- 7 files changed, 4837 insertions(+), 8 deletions(-) create mode 100644 .gitignore create mode 100644 package-lock.json diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 41c7a69c..93199514 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies and build run: | - npm install + npm ci npm run build - name: Publish diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3bdd52eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index f4df186a..d2e46bcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 23.1.0 + +* Added: Added `getHeaders()` method to `Client` to expose current request headers +* Added: Added `package-lock.json` to track dependency lockfile in version control +* Updated: Improved MFA authenticator test data with realistic TOTP secret and URI values + ## 23.0.0 * [BREAKING] Changed `$sequence` type from `number` to `string` for `Row` and `Document` models diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..db07c680 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4816 @@ +{ + "name": "PLACEHOLDER", + "version": "PLACEHOLDER", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "PLACEHOLDER", + "version": "PLACEHOLDER", + "license": "PLACEHOLDER", + "dependencies": { + "json-bigint": "1.0.0", + "node-fetch-native-with-agent": "1.7.2" + }, + "devDependencies": { + "@types/json-bigint": "1.0.4", + "@types/node": "20.11.25", + "esbuild-plugin-file-path-extensions": "^2.0.0", + "jest": "^29.7.0", + "tslib": "2.6.2", + "tsup": "7.2.0", + "typescript": "5.4.2" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz", + "integrity": "sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz", + "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz", + "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/json-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", + "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.11.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", + "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.12", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.12.tgz", + "integrity": "sha512-qyq26DxfY4awP2gIRXhhLWfwzwI+N5Nxk6iQi8EFizIaWIjqicQTE4sLnZZVdeKPRcVNoJOkkpfzoIYuvCKaIQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bundle-require": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.2.1.tgz", + "integrity": "sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.17" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001782", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001782.tgz", + "integrity": "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.329", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.329.tgz", + "integrity": "sha512-/4t+AS1l4S3ZC0Ja7PHFIWeBIxGA3QGqV8/yKsP36v7NcyUCl+bIcmw6s5zVuMIECWwBrAK/6QLzTmbJChBboQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/esbuild-plugin-file-path-extensions": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/esbuild-plugin-file-path-extensions/-/esbuild-plugin-file-path-extensions-2.1.4.tgz", + "integrity": "sha512-lNjylaAsJMprYg28zjUyBivP3y0ms9b7RJZ5tdhDUFLa3sCbqZw4wDnbFUSmnyZYWhCYDPxxp7KkXM2TXGw3PQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch-native-with-agent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/node-fetch-native-with-agent/-/node-fetch-native-with-agent-1.7.2.tgz", + "integrity": "sha512-5MaOOCuJEvcckoz7/tjdx1M6OusOY6Xc5f459IaruGStWnKzlI1qpNgaAwmn4LmFYcsSlj+jBMk84wmmRxfk5g==", + "license": "MIT" + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz", + "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsup": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz", + "integrity": "sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^4.0.0", + "cac": "^6.7.12", + "chokidar": "^3.5.1", + "debug": "^4.3.1", + "esbuild": "^0.18.2", + "execa": "^5.0.0", + "globby": "^11.0.3", + "joycon": "^3.0.1", + "postcss-load-config": "^4.0.1", + "resolve-from": "^5.0.0", + "rollup": "^3.2.5", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.20.3", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "deprecated": "The work that was done in this beta branch won't be included in future versions", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", + "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index ba6c7eec..77275955 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "23.0.0", + "version": "23.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 75a63a91..4fe2c9c7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/23.0.0'; + let ua = 'AppwriteNodeJSSDK/23.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -125,7 +125,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '23.0.0', + 'x-sdk-version': '23.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.0', }; @@ -184,6 +184,10 @@ class Client { return this; } + getHeaders(): Headers { + return { ...this.headers }; + } + /** * Set Project * diff --git a/test/services/account.test.js b/test/services/account.test.js index ec447a86..df618357 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -192,8 +192,8 @@ describe('Account', () => { test('test method createMfaAuthenticator()', async () => { const data = { - 'secret': '1', - 'uri': '1',}; + 'secret': '[SHARED_SECRET]', + 'uri': 'otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.createMfaAuthenticator( @@ -208,8 +208,8 @@ describe('Account', () => { test('test method createMFAAuthenticator()', async () => { const data = { - 'secret': '1', - 'uri': '1',}; + 'secret': '[SHARED_SECRET]', + 'uri': 'otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.createMFAAuthenticator( From b2ba29f8b81975efaae96dedcd5b3d601095f45c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 31 Mar 2026 18:17:08 +0530 Subject: [PATCH 02/18] chore: update Node.js SDK to 23.1.0 --- package-lock.json | 10 +++++----- src/client.ts | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index db07c680..ec33f9ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { - "name": "PLACEHOLDER", - "version": "PLACEHOLDER", + "name": "node-appwrite", + "version": "23.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "PLACEHOLDER", - "version": "PLACEHOLDER", - "license": "PLACEHOLDER", + "name": "node-appwrite", + "version": "23.1.0", + "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/src/client.ts b/src/client.ts index 4fe2c9c7..50c09291 100644 --- a/src/client.ts +++ b/src/client.ts @@ -184,6 +184,14 @@ class Client { return this; } + /** + * Get Headers + * + * Returns a copy of the current request headers, including any + * authentication headers. Handle with care. + * + * @returns {Headers} + */ getHeaders(): Headers { return { ...this.headers }; } From b8ae31d5bf892b372ba989c06505561724bfd184 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Apr 2026 10:29:19 +0530 Subject: [PATCH 03/18] chore: update Node.js SDK to 23.2.0 --- .github/workflows/publish.yml | 6 +- CHANGELOG.md | 11 + README.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- docs/examples/databases/update-collection.md | 3 +- .../databases/update-datetime-attribute.md | 2 +- docs/examples/messaging/create-email.md | 2 +- docs/examples/messaging/create-push.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- docs/examples/messaging/update-email.md | 2 +- docs/examples/messaging/update-push.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- .../project/create-android-platform.md | 16 + .../examples/project/create-apple-platform.md | 16 + docs/examples/project/create-key.md | 17 + .../examples/project/create-linux-platform.md | 16 + docs/examples/project/create-web-platform.md | 16 + .../project/create-windows-platform.md | 16 + docs/examples/project/delete-key.md | 14 + docs/examples/project/delete-platform.md | 14 + docs/examples/project/get-key.md | 14 + docs/examples/project/get-platform.md | 14 + docs/examples/project/list-keys.md | 15 + docs/examples/project/list-platforms.md | 15 + .../project/update-android-platform.md | 16 + .../examples/project/update-apple-platform.md | 16 + .../project/update-canonical-emails.md | 14 + .../project/update-disposable-emails.md | 14 + docs/examples/project/update-free-emails.md | 14 + docs/examples/project/update-key.md | 17 + docs/examples/project/update-labels.md | 14 + .../examples/project/update-linux-platform.md | 16 + .../project/update-protocol-status.md | 15 + .../examples/project/update-service-status.md | 15 + docs/examples/project/update-web-platform.md | 16 + .../project/update-windows-platform.md | 16 + .../tablesdb/create-datetime-column.md | 2 +- .../tablesdb/update-datetime-column.md | 2 +- docs/examples/tablesdb/update-table.md | 3 +- docs/examples/tokens/create-file-token.md | 2 +- docs/examples/tokens/update.md | 2 +- docs/examples/webhooks/create.md | 7 +- .../{update-signature.md => update-secret.md} | 5 +- docs/examples/webhooks/update.md | 6 +- package-lock.json | 1261 ++++++++----- package.json | 4 +- src/client.ts | 6 +- src/enums/build-runtime.ts | 2 + src/enums/o-auth-provider.ts | 1 + src/enums/platform-type.ts | 7 + src/enums/protocol-id.ts | 5 + src/enums/runtime.ts | 2 + src/enums/scopes.ts | 4 + src/enums/service-id.ts | 19 + src/index.ts | 3 + src/models.ts | 697 +++++++- src/services/account.ts | 4 +- src/services/databases.ts | 25 +- src/services/health.ts | 2 + src/services/project.ts | 1581 +++++++++++++++++ src/services/tables-db.ts | 25 +- src/services/webhooks.ts | 133 +- test/services/databases.test.js | 2 +- test/services/project.test.js | 925 ++++++++++ test/services/tables-d-b.test.js | 2 +- test/services/webhooks.test.js | 36 +- 66 files changed, 4551 insertions(+), 628 deletions(-) create mode 100644 docs/examples/project/create-android-platform.md create mode 100644 docs/examples/project/create-apple-platform.md create mode 100644 docs/examples/project/create-key.md create mode 100644 docs/examples/project/create-linux-platform.md create mode 100644 docs/examples/project/create-web-platform.md create mode 100644 docs/examples/project/create-windows-platform.md create mode 100644 docs/examples/project/delete-key.md create mode 100644 docs/examples/project/delete-platform.md create mode 100644 docs/examples/project/get-key.md create mode 100644 docs/examples/project/get-platform.md create mode 100644 docs/examples/project/list-keys.md create mode 100644 docs/examples/project/list-platforms.md create mode 100644 docs/examples/project/update-android-platform.md create mode 100644 docs/examples/project/update-apple-platform.md create mode 100644 docs/examples/project/update-canonical-emails.md create mode 100644 docs/examples/project/update-disposable-emails.md create mode 100644 docs/examples/project/update-free-emails.md create mode 100644 docs/examples/project/update-key.md create mode 100644 docs/examples/project/update-labels.md create mode 100644 docs/examples/project/update-linux-platform.md create mode 100644 docs/examples/project/update-protocol-status.md create mode 100644 docs/examples/project/update-service-status.md create mode 100644 docs/examples/project/update-web-platform.md create mode 100644 docs/examples/project/update-windows-platform.md rename docs/examples/webhooks/{update-signature.md => update-secret.md} (74%) create mode 100644 src/enums/platform-type.ts create mode 100644 src/enums/protocol-id.ts create mode 100644 src/enums/service-id.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 93199514..e6ea266e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,11 +19,11 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: '22' + node-version: '24.14.1' registry-url: 'https://registry.npmjs.org' - - name: Update npm to latest version for OIDC support - run: npm install -g npm@latest + - name: Pin npm for trusted publishing + run: npm install -g npm@11.10.0 - name: Determine release tag id: release_tag diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e46bcd..ba946633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 23.2.0 + +* Added `x` OAuth provider to `OAuthProvider` enum +* Added `userType` field to `Log` model +* Added Project service: platform CRUD, key CRUD, label/email/protocol/service management +* Added new models: `Key`, `KeyList`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, and others +* Added new enums: `PlatformType`, `ProtocolId`, `ServiceId` +* Updated `BuildRuntime`, `Runtime`, `Scopes` enums +* Updated `X-Appwrite-Response-Format` header to `1.9.1` +* Updated TTL description for list caching in Databases and TablesDB + ## 23.1.0 * Added: Added `getHeaders()` method to `Client` to expose current request headers diff --git a/README.md b/README.md index 08afc79c..d959a06b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 328bf685..1bd69d11 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index bd2e7dd0..f7f65c32 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -14,6 +14,7 @@ const result = await databases.updateCollection({ name: '', // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional documentSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + purge: false // optional }); ``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5a4fe633..dfbb6005 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '', + default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index f12d0d5e..1662aae1 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -20,6 +20,6 @@ const result = await messaging.createEmail({ attachments: [], // optional draft: false, // optional html: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 032a2082..467cde4a 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -24,7 +24,7 @@ const result = await messaging.createPush({ tag: '', // optional badge: null, // optional draft: false, // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional contentAvailable: false, // optional critical: false, // optional priority: sdk.MessagePriority.Normal // optional diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 2cee66cc..31d75c00 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -15,6 +15,6 @@ const result = await messaging.createSMS({ users: [], // optional targets: [], // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a761b7f9..f4e27865 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -19,7 +19,7 @@ const result = await messaging.updateEmail({ html: false, // optional cc: [], // optional bcc: [], // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [] // optional }); ``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index b77e10ae..f0e5e324 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -24,7 +24,7 @@ const result = await messaging.updatePush({ tag: '', // optional badge: null, // optional draft: false, // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional contentAvailable: false, // optional critical: false, // optional priority: sdk.MessagePriority.Normal // optional diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index b4bd058a..074cab2e 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -15,6 +15,6 @@ const result = await messaging.updateSMS({ targets: [], // optional content: '', // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md new file mode 100644 index 00000000..09a9f337 --- /dev/null +++ b/docs/examples/project/create-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createAndroidPlatform({ + platformId: '', + name: '', + applicationId: '' +}); +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md new file mode 100644 index 00000000..6ffe87b7 --- /dev/null +++ b/docs/examples/project/create-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createApplePlatform({ + platformId: '', + name: '', + bundleIdentifier: '' +}); +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md new file mode 100644 index 00000000..b5274bfc --- /dev/null +++ b/docs/examples/project/create-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createKey({ + keyId: '', + name: '', + scopes: [sdk.Scopes.SessionsWrite], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md new file mode 100644 index 00000000..aa51173c --- /dev/null +++ b/docs/examples/project/create-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createLinuxPlatform({ + platformId: '', + name: '', + packageName: '' +}); +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md new file mode 100644 index 00000000..84e36ce1 --- /dev/null +++ b/docs/examples/project/create-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWebPlatform({ + platformId: '', + name: '', + hostname: 'app.example.com' +}); +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md new file mode 100644 index 00000000..369f0349 --- /dev/null +++ b/docs/examples/project/create-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWindowsPlatform({ + platformId: '', + name: '', + packageIdentifierName: '' +}); +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md new file mode 100644 index 00000000..bbe19c2a --- /dev/null +++ b/docs/examples/project/delete-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteKey({ + keyId: '' +}); +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md new file mode 100644 index 00000000..cb734805 --- /dev/null +++ b/docs/examples/project/delete-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deletePlatform({ + platformId: '' +}); +``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md new file mode 100644 index 00000000..81b7e2f1 --- /dev/null +++ b/docs/examples/project/get-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getKey({ + keyId: '' +}); +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md new file mode 100644 index 00000000..4f450e4b --- /dev/null +++ b/docs/examples/project/get-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getPlatform({ + platformId: '' +}); +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md new file mode 100644 index 00000000..e9266822 --- /dev/null +++ b/docs/examples/project/list-keys.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listKeys({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md new file mode 100644 index 00000000..c180b9d7 --- /dev/null +++ b/docs/examples/project/list-platforms.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listPlatforms({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md new file mode 100644 index 00000000..8164b0d0 --- /dev/null +++ b/docs/examples/project/update-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateAndroidPlatform({ + platformId: '', + name: '', + applicationId: '' +}); +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md new file mode 100644 index 00000000..93abb676 --- /dev/null +++ b/docs/examples/project/update-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateApplePlatform({ + platformId: '', + name: '', + bundleIdentifier: '' +}); +``` diff --git a/docs/examples/project/update-canonical-emails.md b/docs/examples/project/update-canonical-emails.md new file mode 100644 index 00000000..795c7995 --- /dev/null +++ b/docs/examples/project/update-canonical-emails.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateCanonicalEmails({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-disposable-emails.md b/docs/examples/project/update-disposable-emails.md new file mode 100644 index 00000000..46674f63 --- /dev/null +++ b/docs/examples/project/update-disposable-emails.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateDisposableEmails({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-free-emails.md b/docs/examples/project/update-free-emails.md new file mode 100644 index 00000000..bc0b0917 --- /dev/null +++ b/docs/examples/project/update-free-emails.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateFreeEmails({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md new file mode 100644 index 00000000..ad191f88 --- /dev/null +++ b/docs/examples/project/update-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateKey({ + keyId: '', + name: '', + scopes: [sdk.Scopes.SessionsWrite], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md new file mode 100644 index 00000000..f924ec09 --- /dev/null +++ b/docs/examples/project/update-labels.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLabels({ + labels: [] +}); +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md new file mode 100644 index 00000000..cb483d60 --- /dev/null +++ b/docs/examples/project/update-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLinuxPlatform({ + platformId: '', + name: '', + packageName: '' +}); +``` diff --git a/docs/examples/project/update-protocol-status.md b/docs/examples/project/update-protocol-status.md new file mode 100644 index 00000000..b3da4bf3 --- /dev/null +++ b/docs/examples/project/update-protocol-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateProtocolStatus({ + protocolId: sdk.ProtocolId.Rest, + enabled: false +}); +``` diff --git a/docs/examples/project/update-service-status.md b/docs/examples/project/update-service-status.md new file mode 100644 index 00000000..fe9514b4 --- /dev/null +++ b/docs/examples/project/update-service-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateServiceStatus({ + serviceId: sdk.ServiceId.Account, + enabled: false +}); +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md new file mode 100644 index 00000000..9c4f9bd1 --- /dev/null +++ b/docs/examples/project/update-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWebPlatform({ + platformId: '', + name: '', + hostname: 'app.example.com' +}); +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md new file mode 100644 index 00000000..3fd19d7d --- /dev/null +++ b/docs/examples/project/update-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWindowsPlatform({ + platformId: '', + name: '', + packageIdentifierName: '' +}); +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 4aedd362..6836b15e 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createDatetimeColumn({ tableId: '', key: '', required: false, - default: '', // optional + default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index f1fb75e8..24628932 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateDatetimeColumn({ tableId: '', key: '', required: false, - default: '', + default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index f698a398..6aa65c2e 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateTable({ name: '', // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional rowSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + purge: false // optional }); ``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 3be6b549..bfb5d8d0 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -11,6 +11,6 @@ const tokens = new sdk.Tokens(client); const result = await tokens.createFileToken({ bucketId: '', fileId: '', - expire: '' // optional + expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index c36998dd..0ab3b168 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -10,6 +10,6 @@ const tokens = new sdk.Tokens(client); const result = await tokens.update({ tokenId: '', - expire: '' // optional + expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 5641306f..c8603872 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -14,8 +14,9 @@ const result = await webhooks.create({ name: '', events: [], enabled: false, // optional - security: false, // optional - httpUser: '', // optional - httpPass: '' // optional + tls: false, // optional + authUsername: '', // optional + authPassword: '', // optional + secret: '' // optional }); ``` diff --git a/docs/examples/webhooks/update-signature.md b/docs/examples/webhooks/update-secret.md similarity index 74% rename from docs/examples/webhooks/update-signature.md rename to docs/examples/webhooks/update-secret.md index 6257ba58..7c0e504c 100644 --- a/docs/examples/webhooks/update-signature.md +++ b/docs/examples/webhooks/update-secret.md @@ -8,7 +8,8 @@ const client = new sdk.Client() const webhooks = new sdk.Webhooks(client); -const result = await webhooks.updateSignature({ - webhookId: '' +const result = await webhooks.updateSecret({ + webhookId: '', + secret: '' // optional }); ``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index acd6c9a3..6596e900 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -14,8 +14,8 @@ const result = await webhooks.update({ url: '', events: [], enabled: false, // optional - security: false, // optional - httpUser: '', // optional - httpPass: '' // optional + tls: false, // optional + authUsername: '', // optional + authPassword: '' // optional }); ``` diff --git a/package-lock.json b/package-lock.json index ec33f9ed..a91e37ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,12 @@ { "name": "node-appwrite", - "version": "23.1.0", + "version": "23.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "23.1.0", - "license": "BSD-3-Clause", + "version": "23.2.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" @@ -18,9 +17,10 @@ "esbuild-plugin-file-path-extensions": "^2.0.0", "jest": "^29.7.0", "tslib": "2.6.2", - "tsup": "7.2.0", + "tsup": "^8.5.1", "typescript": "5.4.2" - } + }, + "license": "BSD-3-Clause" }, "node_modules/@babel/code-frame": { "version": "7.29.0", @@ -518,10 +518,27 @@ "dev": true, "license": "MIT" }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", "cpu": [ "arm" ], @@ -532,13 +549,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", "cpu": [ "arm64" ], @@ -549,13 +566,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", "cpu": [ "x64" ], @@ -566,13 +583,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", "cpu": [ "arm64" ], @@ -583,13 +600,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", "cpu": [ "x64" ], @@ -600,13 +617,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", "cpu": [ "arm64" ], @@ -617,13 +634,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", "cpu": [ "x64" ], @@ -634,13 +651,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", "cpu": [ "arm" ], @@ -651,13 +668,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", "cpu": [ "arm64" ], @@ -668,13 +685,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", "cpu": [ "ia32" ], @@ -685,13 +702,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", "cpu": [ "loong64" ], @@ -702,13 +719,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", "cpu": [ "mips64el" ], @@ -719,13 +736,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", "cpu": [ "ppc64" ], @@ -736,13 +753,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", "cpu": [ "riscv64" ], @@ -753,13 +770,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", "cpu": [ "s390x" ], @@ -770,13 +787,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", "cpu": [ "x64" ], @@ -787,13 +804,30 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", "cpu": [ "x64" ], @@ -804,13 +838,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", "cpu": [ "x64" ], @@ -821,13 +872,30 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", "cpu": [ "x64" ], @@ -838,13 +906,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", "cpu": [ "arm64" ], @@ -855,13 +923,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", "cpu": [ "ia32" ], @@ -872,13 +940,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", "cpu": [ "x64" ], @@ -889,7 +957,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1261,43 +1329,394 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", + "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", + "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", + "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", + "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", + "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", + "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", + "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", + "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", + "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", + "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", + "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", + "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", + "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", + "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", + "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", + "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", + "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", + "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", + "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", + "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", + "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", + "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", + "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", + "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", + "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "win32" + ] }, "node_modules/@sinclair/typebox": { "version": "0.27.10", @@ -1371,6 +1790,13 @@ "@babel/types": "^7.28.2" } }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -1449,6 +1875,19 @@ "dev": true, "license": "MIT" }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1522,16 +1961,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -1677,19 +2106,6 @@ "node": "*" } }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/brace-expansion": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", @@ -1766,9 +2182,9 @@ "license": "MIT" }, "node_modules/bundle-require": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.2.1.tgz", - "integrity": "sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", "dev": true, "license": "MIT", "dependencies": { @@ -1778,7 +2194,7 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "peerDependencies": { - "esbuild": ">=0.17" + "esbuild": ">=0.18" } }, "node_modules/cac": { @@ -1860,28 +2276,19 @@ } }, "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" } }, "node_modules/ci-info": { @@ -1977,6 +2384,23 @@ "dev": true, "license": "MIT" }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -2084,19 +2508,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.329", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.329.tgz", @@ -2135,9 +2546,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2145,31 +2556,35 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" } }, "node_modules/esbuild-plugin-file-path-extensions": { @@ -2267,23 +2682,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2291,16 +2689,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -2338,6 +2726,18 @@ "node": ">=8" } }, + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2435,40 +2835,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2516,16 +2882,6 @@ "node": ">=10.17.0" } }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -2582,19 +2938,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", @@ -2611,16 +2954,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2641,19 +2974,6 @@ "node": ">=6" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3500,13 +3820,6 @@ "node": ">=8" } }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", - "dev": true, - "license": "MIT" - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3517,6 +3830,16 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -3563,16 +3886,6 @@ "dev": true, "license": "MIT" }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -3610,6 +3923,19 @@ "node": "*" } }, + "node_modules/mlly": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.16.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.3" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3826,15 +4152,12 @@ "dev": true, "license": "MIT" }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/picocolors": { "version": "1.1.1", @@ -3879,10 +4202,22 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, "node_modules/postcss-load-config": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", - "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", "dev": true, "funding": [ { @@ -3896,21 +4231,28 @@ ], "license": "MIT", "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" + "lilconfig": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 18" }, "peerDependencies": { + "jiti": ">=1.21.0", "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { + "jiti": { + "optional": true + }, "postcss": { "optional": true }, - "ts-node": { + "tsx": { + "optional": true + }, + "yaml": { "optional": true } } @@ -3957,16 +4299,6 @@ "node": ">= 6" } }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -3984,27 +4316,6 @@ ], "license": "MIT" }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -4013,16 +4324,17 @@ "license": "MIT" }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/require-directory": { @@ -4089,58 +4401,51 @@ "node": ">=10" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rollup": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz", - "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==", + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", + "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", "dev": true, "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.1", + "@rollup/rollup-android-arm64": "4.60.1", + "@rollup/rollup-darwin-arm64": "4.60.1", + "@rollup/rollup-darwin-x64": "4.60.1", + "@rollup/rollup-freebsd-arm64": "4.60.1", + "@rollup/rollup-freebsd-x64": "4.60.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", + "@rollup/rollup-linux-arm-musleabihf": "4.60.1", + "@rollup/rollup-linux-arm64-gnu": "4.60.1", + "@rollup/rollup-linux-arm64-musl": "4.60.1", + "@rollup/rollup-linux-loong64-gnu": "4.60.1", + "@rollup/rollup-linux-loong64-musl": "4.60.1", + "@rollup/rollup-linux-ppc64-gnu": "4.60.1", + "@rollup/rollup-linux-ppc64-musl": "4.60.1", + "@rollup/rollup-linux-riscv64-gnu": "4.60.1", + "@rollup/rollup-linux-riscv64-musl": "4.60.1", + "@rollup/rollup-linux-s390x-gnu": "4.60.1", + "@rollup/rollup-linux-x64-gnu": "4.60.1", + "@rollup/rollup-linux-x64-musl": "4.60.1", + "@rollup/rollup-openbsd-x64": "4.60.1", + "@rollup/rollup-openharmony-arm64": "4.60.1", + "@rollup/rollup-win32-arm64-msvc": "4.60.1", + "@rollup/rollup-win32-ia32-msvc": "4.60.1", + "@rollup/rollup-win32-x64-gnu": "4.60.1", + "@rollup/rollup-win32-x64-msvc": "4.60.1", "fsevents": "~2.3.2" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4401,6 +4706,13 @@ "node": ">=0.8" } }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -4469,16 +4781,6 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -4504,25 +4806,28 @@ "license": "0BSD" }, "node_modules/tsup": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz", - "integrity": "sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^4.0.0", - "cac": "^6.7.12", - "chokidar": "^3.5.1", - "debug": "^4.3.1", - "esbuild": "^0.18.2", - "execa": "^5.0.0", - "globby": "^11.0.3", - "joycon": "^3.0.1", - "postcss-load-config": "^4.0.1", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", "resolve-from": "^5.0.0", - "rollup": "^3.2.5", - "source-map": "0.8.0-beta.0", - "sucrase": "^3.20.3", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", "tree-kill": "^1.2.2" }, "bin": { @@ -4530,14 +4835,18 @@ "tsup-node": "dist/cli-node.js" }, "engines": { - "node": ">=16.14" + "node": ">=18" }, "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", "@swc/core": "^1", "postcss": "^8.4.12", - "typescript": ">=4.1.0" + "typescript": ">=4.5.0" }, "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, "@swc/core": { "optional": true }, @@ -4550,17 +4859,13 @@ } }, "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "deprecated": "The work that was done in this beta branch won't be included in future versions", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", "dev": true, "license": "BSD-3-Clause", - "dependencies": { - "whatwg-url": "^7.0.0" - }, "engines": { - "node": ">= 8" + "node": ">= 12" } }, "node_modules/type-detect": { @@ -4600,6 +4905,13 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", + "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", + "dev": true, + "license": "MIT" + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -4663,25 +4975,6 @@ "makeerror": "1.0.12" } }, - "node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4754,22 +5047,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yaml": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", - "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 77275955..437c9ca6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "23.1.0", + "version": "23.2.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -44,7 +44,7 @@ "devDependencies": { "@types/json-bigint": "1.0.4", "@types/node": "20.11.25", - "tsup": "7.2.0", + "tsup": "^8.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", "tslib": "2.6.2", "typescript": "5.4.2", diff --git a/src/client.ts b/src/client.ts index 50c09291..8ea5c3ec 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/23.1.0'; + let ua = 'AppwriteNodeJSSDK/23.2.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -125,9 +125,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '23.1.0', + 'x-sdk-version': '23.2.0', 'user-agent' : getUserAgent(), - 'X-Appwrite-Response-Format': '1.9.0', + 'X-Appwrite-Response-Format': '1.9.1', }; /** diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 3f85913f..6aea9aa5 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -47,6 +47,7 @@ export enum BuildRuntime { Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', + Dart311 = 'dart-3.11', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -85,4 +86,5 @@ export enum BuildRuntime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', + Flutter341 = 'flutter-3.41', } \ No newline at end of file diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 3382e3bf..efc44844 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -33,6 +33,7 @@ export enum OAuthProvider { TradeshiftBox = 'tradeshiftBox', Twitch = 'twitch', Wordpress = 'wordpress', + X = 'x', Yahoo = 'yahoo', Yammer = 'yammer', Yandex = 'yandex', diff --git a/src/enums/platform-type.ts b/src/enums/platform-type.ts new file mode 100644 index 00000000..bde1d30f --- /dev/null +++ b/src/enums/platform-type.ts @@ -0,0 +1,7 @@ +export enum PlatformType { + Windows = 'windows', + Apple = 'apple', + Android = 'android', + Linux = 'linux', + Web = 'web', +} \ No newline at end of file diff --git a/src/enums/protocol-id.ts b/src/enums/protocol-id.ts new file mode 100644 index 00000000..94d9095f --- /dev/null +++ b/src/enums/protocol-id.ts @@ -0,0 +1,5 @@ +export enum ProtocolId { + Rest = 'rest', + Graphql = 'graphql', + Websocket = 'websocket', +} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index fda3bab3..3a57958b 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -47,6 +47,7 @@ export enum Runtime { Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', + Dart311 = 'dart-3.11', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -85,4 +86,5 @@ export enum Runtime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', + Flutter341 = 'flutter-3.41', } \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index d85b2bb5..d98f20ab 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -60,6 +60,10 @@ export enum Scopes { WebhooksWrite = 'webhooks.write', ProjectRead = 'project.read', ProjectWrite = 'project.write', + KeysRead = 'keys.read', + KeysWrite = 'keys.write', + PlatformsRead = 'platforms.read', + PlatformsWrite = 'platforms.write', PoliciesWrite = 'policies.write', PoliciesRead = 'policies.read', ArchivesRead = 'archives.read', diff --git a/src/enums/service-id.ts b/src/enums/service-id.ts new file mode 100644 index 00000000..29281124 --- /dev/null +++ b/src/enums/service-id.ts @@ -0,0 +1,19 @@ +export enum ServiceId { + Account = 'account', + Avatars = 'avatars', + Databases = 'databases', + Tablesdb = 'tablesdb', + Locale = 'locale', + Health = 'health', + Project = 'project', + Storage = 'storage', + Teams = 'teams', + Users = 'users', + Vcs = 'vcs', + Sites = 'sites', + Functions = 'functions', + Proxy = 'proxy', + Graphql = 'graphql', + Migrations = 'migrations', + Messaging = 'messaging', +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 99e694ad..743e850e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,8 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; +export { ProtocolId } from './enums/protocol-id'; +export { ServiceId } from './enums/service-id'; export { Framework } from './enums/framework'; export { BuildRuntime } from './enums/build-runtime'; export { Adapter } from './enums/adapter'; @@ -62,6 +64,7 @@ export { IndexStatus } from './enums/index-status'; export { DeploymentStatus } from './enums/deployment-status'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; +export { PlatformType } from './enums/platform-type'; export { HealthAntivirusStatus } from './enums/health-antivirus-status'; export { HealthCheckStatus } from './enums/health-check-status'; export { MessageStatus } from './enums/message-status'; diff --git a/src/models.ts b/src/models.ts index 37c65933..0f9546a3 100644 --- a/src/models.ts +++ b/src/models.ts @@ -5,6 +5,7 @@ import { IndexStatus } from "./enums/index-status" import { DeploymentStatus } from "./enums/deployment-status" import { ExecutionTrigger } from "./enums/execution-trigger" import { ExecutionStatus } from "./enums/execution-status" +import { PlatformType } from "./enums/platform-type" import { HealthAntivirusStatus } from "./enums/health-antivirus-status" import { HealthCheckStatus } from "./enums/health-check-status" import { MessageStatus } from "./enums/message-status" @@ -338,6 +339,20 @@ export namespace Models { webhooks: Webhook[]; } + /** + * API Keys List + */ + export type KeyList = { + /** + * Total number of keys that matched your query. + */ + total: number; + /** + * List of keys. + */ + keys: Key[]; + } + /** * Countries List */ @@ -2520,6 +2535,10 @@ export namespace Models { * API mode when event triggered. */ mode: string; + /** + * User type who triggered the audit log. Possible values: user, admin, guest, keyProject, keyAccount, keyOrganization. + */ + userType: string; /** * IP session in use when the session was created. */ @@ -3837,6 +3856,324 @@ export namespace Models { scheduledAt?: string; } + /** + * Project + */ + export type Project = { + /** + * Project ID. + */ + $id: string; + /** + * Project creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Project update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Project name. + */ + name: string; + /** + * Project description. + */ + description: string; + /** + * Project team ID. + */ + teamId: string; + /** + * Project logo file ID. + */ + logo: string; + /** + * Project website URL. + */ + url: string; + /** + * Company legal name. + */ + legalName: string; + /** + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format. + */ + legalCountry: string; + /** + * State name. + */ + legalState: string; + /** + * City name. + */ + legalCity: string; + /** + * Company Address. + */ + legalAddress: string; + /** + * Company Tax ID. + */ + legalTaxId: string; + /** + * Session duration in seconds. + */ + authDuration: number; + /** + * Max users allowed. 0 is unlimited. + */ + authLimit: number; + /** + * Max sessions allowed per user. 100 maximum. + */ + authSessionsLimit: number; + /** + * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. + */ + authPasswordHistory: number; + /** + * Whether or not to check user's password against most commonly used passwords. + */ + authPasswordDictionary: boolean; + /** + * Whether or not to check the user password for similarity with their personal data. + */ + authPersonalDataCheck: boolean; + /** + * Whether or not to disallow disposable email addresses during signup and email updates. + */ + authDisposableEmails: boolean; + /** + * Whether or not to require canonical email addresses during signup and email updates. + */ + authCanonicalEmails: boolean; + /** + * Whether or not to disallow free email addresses during signup and email updates. + */ + authFreeEmails: boolean; + /** + * An array of mock numbers and their corresponding verification codes (OTPs). + */ + authMockNumbers: MockNumber[]; + /** + * Whether or not to send session alert emails to users. + */ + authSessionAlerts: boolean; + /** + * Whether or not to show user names in the teams membership response. + */ + authMembershipsUserName: boolean; + /** + * Whether or not to show user emails in the teams membership response. + */ + authMembershipsUserEmail: boolean; + /** + * Whether or not to show user MFA status in the teams membership response. + */ + authMembershipsMfa: boolean; + /** + * Whether or not all existing sessions should be invalidated on password change + */ + authInvalidateSessions: boolean; + /** + * List of Auth Providers. + */ + oAuthProviders: AuthProvider[]; + /** + * List of Platforms. + */ + platforms: (Models.PlatformWeb | Models.PlatformApple | Models.PlatformAndroid | Models.PlatformWindows | Models.PlatformLinux)[]; + /** + * List of Webhooks. + */ + webhooks: Webhook[]; + /** + * List of API Keys. + */ + keys: Key[]; + /** + * List of dev keys. + */ + devKeys: DevKey[]; + /** + * Status for custom SMTP + */ + smtpEnabled: boolean; + /** + * SMTP sender name + */ + smtpSenderName: string; + /** + * SMTP sender email + */ + smtpSenderEmail: string; + /** + * SMTP reply to email + */ + smtpReplyTo: string; + /** + * SMTP server host name + */ + smtpHost: string; + /** + * SMTP server port + */ + smtpPort: number; + /** + * SMTP server username + */ + smtpUsername: string; + /** + * SMTP server password + */ + smtpPassword: string; + /** + * SMTP server secure protocol + */ + smtpSecure: string; + /** + * Number of times the ping was received for this project. + */ + pingCount: number; + /** + * Last ping datetime in ISO 8601 format. + */ + pingedAt: string; + /** + * Labels for the project. + */ + labels: string[]; + /** + * Project status + */ + status: string; + /** + * Email/Password auth method status + */ + authEmailPassword: boolean; + /** + * Magic URL auth method status + */ + authUsersAuthMagicURL: boolean; + /** + * Email (OTP) auth method status + */ + authEmailOtp: boolean; + /** + * Anonymous auth method status + */ + authAnonymous: boolean; + /** + * Invites auth method status + */ + authInvites: boolean; + /** + * JWT auth method status + */ + authJWT: boolean; + /** + * Phone auth method status + */ + authPhone: boolean; + /** + * Account service status + */ + serviceStatusForAccount: boolean; + /** + * Avatars service status + */ + serviceStatusForAvatars: boolean; + /** + * Databases (legacy) service status + */ + serviceStatusForDatabases: boolean; + /** + * TablesDB service status + */ + serviceStatusForTablesdb: boolean; + /** + * Locale service status + */ + serviceStatusForLocale: boolean; + /** + * Health service status + */ + serviceStatusForHealth: boolean; + /** + * Project service status + */ + serviceStatusForProject: boolean; + /** + * Storage service status + */ + serviceStatusForStorage: boolean; + /** + * Teams service status + */ + serviceStatusForTeams: boolean; + /** + * Users service status + */ + serviceStatusForUsers: boolean; + /** + * VCS service status + */ + serviceStatusForVcs: boolean; + /** + * Sites service status + */ + serviceStatusForSites: boolean; + /** + * Functions service status + */ + serviceStatusForFunctions: boolean; + /** + * Proxy service status + */ + serviceStatusForProxy: boolean; + /** + * GraphQL service status + */ + serviceStatusForGraphql: boolean; + /** + * Migrations service status + */ + serviceStatusForMigrations: boolean; + /** + * Messaging service status + */ + serviceStatusForMessaging: boolean; + /** + * REST protocol status + */ + protocolStatusForRest: boolean; + /** + * GraphQL protocol status + */ + protocolStatusForGraphql: boolean; + /** + * Websocket protocol status + */ + protocolStatusForWebsocket: boolean; + /** + * Project region + */ + region: string; + /** + * Billing limits reached + */ + billingLimits: BillingLimits; + /** + * Project blocks information + */ + blocks: Block[]; + /** + * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + */ + consoleAccessedAt: string; + } + /** * Webhook */ @@ -3866,21 +4203,21 @@ export namespace Models { */ events: string[]; /** - * Indicated if SSL / TLS Certificate verification is enabled. + * Indicates if SSL / TLS certificate verification is enabled. */ - security: boolean; + tls: boolean; /** * HTTP basic authentication username. */ - httpUser: string; + authUsername: string; /** * HTTP basic authentication password. */ - httpPass: string; + authPassword: string; /** - * Signature key which can be used to validated incoming + * Signature key which can be used to validate incoming webhook payloads. Only returned on creation and secret rotation. */ - signatureKey: string; + secret: string; /** * Indicates if this webhook is enabled. */ @@ -3895,6 +4232,290 @@ export namespace Models { attempts: number; } + /** + * Key + */ + export type Key = { + /** + * Key ID. + */ + $id: string; + /** + * Key creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Key update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Key name. + */ + name: string; + /** + * Key expiration date in ISO 8601 format. + */ + expire: string; + /** + * Allowed permission scopes. + */ + scopes: string[]; + /** + * Secret key. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; + } + + /** + * DevKey + */ + export type DevKey = { + /** + * Key ID. + */ + $id: string; + /** + * Key creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Key update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Key name. + */ + name: string; + /** + * Key expiration date in ISO 8601 format. + */ + expire: string; + /** + * Secret key. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; + } + + /** + * Mock Number + */ + export type MockNumber = { + /** + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + */ + phone: string; + /** + * Mock OTP for the number. + */ + otp: string; + } + + /** + * AuthProvider + */ + export type AuthProvider = { + /** + * Auth Provider. + */ + key: string; + /** + * Auth Provider name. + */ + name: string; + /** + * OAuth 2.0 application ID. + */ + appId: string; + /** + * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + */ + secret: string; + /** + * Auth Provider is active and can be used to create session. + */ + enabled: boolean; + } + + /** + * Platform Web + */ + export type PlatformWeb = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Web app hostname. Empty string for other platforms. + */ + hostname: string; + } + + /** + * Platform Apple + */ + export type PlatformApple = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Apple bundle identifier. + */ + bundleIdentifier: string; + } + + /** + * Platform Android + */ + export type PlatformAndroid = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Android application ID. + */ + applicationId: string; + } + + /** + * Platform Windows + */ + export type PlatformWindows = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Windows package identifier name. + */ + packageIdentifierName: string; + } + + /** + * Platform Linux + */ + export type PlatformLinux = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Linux package name. + */ + packageName: string; + } + + /** + * Platforms List + */ + export type PlatformList = { + /** + * Total number of platforms in the given project. + */ + total: number; + /** + * List of platforms. + */ + platforms: (Models.PlatformWeb | Models.PlatformApple | Models.PlatformAndroid | Models.PlatformWindows | Models.PlatformLinux)[]; + } + /** * Variable */ @@ -4665,6 +5286,70 @@ export namespace Models { resourceType?: string; } + /** + * BillingLimits + */ + export type BillingLimits = { + /** + * Bandwidth limit + */ + bandwidth: number; + /** + * Storage limit + */ + storage: number; + /** + * Users limit + */ + users: number; + /** + * Executions limit + */ + executions: number; + /** + * GBHours limit + */ + GBHours: number; + /** + * Image transformations limit + */ + imageTransformations: number; + /** + * Auth phone limit + */ + authPhone: number; + /** + * Budget limit percentage + */ + budgetLimit: number; + } + + /** + * Block + */ + export type Block = { + /** + * Block creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Resource type that is blocked + */ + resourceType: string; + /** + * Resource identifier that is blocked + */ + resourceId: string; + /** + * Reason for the block. Can be null if no reason was provided. + */ + reason?: string; + /** + * Block expiration date in ISO 8601 format. Can be null if the block does not expire. + */ + expiredAt?: string; + } + /** * backup */ diff --git a/src/services/account.ts b/src/services/account.ts index 9784f06d..07b94599 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -2338,7 +2338,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2353,7 +2353,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/databases.ts b/src/services/databases.ts index 54b2eb0f..54fb8bdc 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -914,11 +914,12 @@ export class Databases { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean} params.purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead. */ - updateCollection(params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + updateCollection(params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }): Promise; /** * Update a collection by its unique ID. * @@ -928,19 +929,20 @@ export class Databases { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean} purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean): Promise; updateCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }; } else { params = { databaseId: paramsOrFirst as string, @@ -948,7 +950,8 @@ export class Databases { name: rest[1] as string, permissions: rest[2] as string[], documentSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + purge: rest[5] as boolean }; } @@ -958,6 +961,7 @@ export class Databases { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; + const purge = params.purge; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -980,6 +984,9 @@ export class Databases { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof purge !== 'undefined') { + payload['purge'] = purge; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4660,7 +4667,7 @@ export class Databases { * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead. @@ -4674,7 +4681,7 @@ export class Databases { * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/health.ts b/src/services/health.ts index 14111566..713f33ba 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -239,6 +239,7 @@ export class Health { /** * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. + * * * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} @@ -247,6 +248,7 @@ export class Health { getQueueAudits(params?: { threshold?: number }): Promise; /** * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. + * * * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} diff --git a/src/services/project.ts b/src/services/project.ts index ed6fcb19..aaee5655 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,6 +1,9 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { Scopes } from '../enums/scopes'; +import { ProtocolId } from '../enums/protocol-id'; +import { ServiceId } from '../enums/service-id'; export class Project { client: Client; @@ -9,6 +12,1584 @@ export class Project { this.client = client; } + /** + * Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project. + * + * @param {boolean} params.enabled - Set whether or not to require canonical email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateCanonicalEmails(params: { enabled: boolean }): Promise; + /** + * Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project. + * + * @param {boolean} enabled - Set whether or not to require canonical email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateCanonicalEmails(enabled: boolean): Promise; + updateCanonicalEmails( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/auth/canonical-emails'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project. + * + * @param {boolean} params.enabled - Set whether or not to block disposable email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDisposableEmails(params: { enabled: boolean }): Promise; + /** + * Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project. + * + * @param {boolean} enabled - Set whether or not to block disposable email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDisposableEmails(enabled: boolean): Promise; + updateDisposableEmails( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/auth/disposable-emails'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project. + * + * @param {boolean} params.enabled - Set whether or not to block free email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateFreeEmails(params: { enabled: boolean }): Promise; + /** + * Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project. + * + * @param {boolean} enabled - Set whether or not to block free email addresses during signup and email updates. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateFreeEmails(enabled: boolean): Promise; + updateFreeEmails( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/auth/free-emails'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all API keys from the current project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all API keys from the current project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listKeys(queries?: string[], total?: boolean): Promise; + listKeys( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/keys'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise; + createKey( + paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(string)?, (Scopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as Scopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/project/keys'; + const payload: Payload = {}; + if (typeof keyId !== 'undefined') { + payload['keyId'] = keyId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a key by its unique ID. + * + * @param {string} params.keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey(params: { keyId: string }): Promise; + /** + * Get a key by its unique ID. + * + * @param {string} keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getKey(keyId: string): Promise; + getKey( + paramsOrFirst: { keyId: string } | string + ): Promise { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} params.keyId - Key ID. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} keyId - Key ID. + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise; + updateKey( + paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(string)?, (Scopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as Scopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} params.keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteKey(params: { keyId: string }): Promise<{}>; + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteKey(keyId: string): Promise<{}>; + deleteKey( + paramsOrFirst: { keyId: string } | string + ): Promise<{}> { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} params.labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLabels(params: { labels: string[] }): Promise; + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLabels(labels: string[]): Promise; + updateLabels( + paramsOrFirst: { labels: string[] } | string[] + ): Promise { + let params: { labels: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { labels: string[] }; + } else { + params = { + labels: paramsOrFirst as string[] + }; + } + + const labels = params.labels; + + if (typeof labels === 'undefined') { + throw new AppwriteException('Missing required parameter: "labels"'); + } + + const apiPath = '/project/labels'; + const payload: Payload = {}; + if (typeof labels !== 'undefined') { + payload['labels'] = labels; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPlatforms(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPlatforms(queries?: string[], total?: boolean): Promise; + listPlatforms( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/platforms'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + createAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + updateAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + createApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + updateApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + createLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + updateLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWebPlatform(platformId: string, name: string, hostname: string): Promise; + createWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWebPlatform(platformId: string, name: string, hostname: string): Promise; + updateWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + createWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + updateWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPlatform(params: { platformId: string }): Promise; + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPlatform(platformId: string): Promise; + getPlatform( + paramsOrFirst: { platformId: string } | string + ): Promise { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deletePlatform(params: { platformId: string }): Promise<{}>; + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deletePlatform(platformId: string): Promise<{}>; + deletePlatform( + paramsOrFirst: { platformId: string } | string + ): Promise<{}> { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} params.protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} params.enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateProtocolStatus(params: { protocolId: ProtocolId, enabled: boolean }): Promise; + /** + * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateProtocolStatus(protocolId: ProtocolId, enabled: boolean): Promise; + updateProtocolStatus( + paramsOrFirst: { protocolId: ProtocolId, enabled: boolean } | ProtocolId, + ...rest: [(boolean)?] + ): Promise { + let params: { protocolId: ProtocolId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { protocolId: ProtocolId, enabled: boolean }; + } else { + params = { + protocolId: paramsOrFirst as ProtocolId, + enabled: rest[0] as boolean + }; + } + + const protocolId = params.protocolId; + const enabled = params.enabled; + + if (typeof protocolId === 'undefined') { + throw new AppwriteException('Missing required parameter: "protocolId"'); + } + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/protocols/{protocolId}/status'.replace('{protocolId}', protocolId); + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * + * @param {ServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} params.enabled - Service status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateServiceStatus(params: { serviceId: ServiceId, enabled: boolean }): Promise; + /** + * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * + * @param {ServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} enabled - Service status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateServiceStatus(serviceId: ServiceId, enabled: boolean): Promise; + updateServiceStatus( + paramsOrFirst: { serviceId: ServiceId, enabled: boolean } | ServiceId, + ...rest: [(boolean)?] + ): Promise { + let params: { serviceId: ServiceId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { serviceId: ServiceId, enabled: boolean }; + } else { + params = { + serviceId: paramsOrFirst as ServiceId, + enabled: rest[0] as boolean + }; + } + + const serviceId = params.serviceId; + const enabled = params.enabled; + + if (typeof serviceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "serviceId"'); + } + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/services/{serviceId}/status'.replace('{serviceId}', serviceId); + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all project environment variables. * diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 509e7554..6ec5cf43 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -906,10 +906,11 @@ export class TablesDB { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @param {boolean} params.purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} */ - updateTable(params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }): Promise; + updateTable(params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }): Promise; /** * Update a table by its unique ID. * @@ -919,19 +920,20 @@ export class TablesDB { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @param {boolean} purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateTable(databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise; + updateTable(databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean): Promise; updateTable( - paramsOrFirst: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }; } else { params = { databaseId: paramsOrFirst as string, @@ -939,7 +941,8 @@ export class TablesDB { name: rest[1] as string, permissions: rest[2] as string[], rowSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + purge: rest[5] as boolean }; } @@ -949,6 +952,7 @@ export class TablesDB { const permissions = params.permissions; const rowSecurity = params.rowSecurity; const enabled = params.enabled; + const purge = params.purge; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -971,6 +975,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof purge !== 'undefined') { + payload['purge'] = purge; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4933,7 +4940,7 @@ export class TablesDB { * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} */ @@ -4946,7 +4953,7 @@ export class TablesDB { * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index daa78ce0..ddad942e 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -12,7 +12,7 @@ export class Webhooks { /** * Get a list of all webhooks belonging to the project. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} @@ -21,7 +21,7 @@ export class Webhooks { /** * Get a list of all webhooks belonging to the project. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} @@ -76,13 +76,14 @@ export class Webhooks { * @param {string} params.name - Webhook name. Max length: 128 chars. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {boolean} params.enabled - Enable or disable a webhook. - * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled. - * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. + * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars. + * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise; + create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }): Promise; /** * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. * @@ -91,22 +92,23 @@ export class Webhooks { * @param {string} name - Webhook name. Max length: 128 chars. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {boolean} enabled - Enable or disable a webhook. - * @param {boolean} security - Certificate verification, false for disabled or true for enabled. - * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. + * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars. + * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise; + create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string): Promise; create( - paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?, (string)?] ): Promise { - let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }; } else { params = { webhookId: paramsOrFirst as string, @@ -114,9 +116,10 @@ export class Webhooks { name: rest[1] as string, events: rest[2] as string[], enabled: rest[3] as boolean, - security: rest[4] as boolean, - httpUser: rest[5] as string, - httpPass: rest[6] as string + tls: rest[4] as boolean, + authUsername: rest[5] as string, + authPassword: rest[6] as string, + secret: rest[7] as string }; } @@ -125,9 +128,10 @@ export class Webhooks { const name = params.name; const events = params.events; const enabled = params.enabled; - const security = params.security; - const httpUser = params.httpUser; - const httpPass = params.httpPass; + const tls = params.tls; + const authUsername = params.authUsername; + const authPassword = params.authPassword; + const secret = params.secret; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); @@ -159,14 +163,17 @@ export class Webhooks { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof security !== 'undefined') { - payload['security'] = security; + if (typeof tls !== 'undefined') { + payload['tls'] = tls; + } + if (typeof authUsername !== 'undefined') { + payload['authUsername'] = authUsername; } - if (typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; + if (typeof authPassword !== 'undefined') { + payload['authPassword'] = authPassword; } - if (typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; + if (typeof secret !== 'undefined') { + payload['secret'] = secret; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -241,13 +248,13 @@ export class Webhooks { * @param {string} params.url - Webhook URL. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {boolean} params.enabled - Enable or disable a webhook. - * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled. - * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. + * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise; + update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }): Promise; /** * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. * @@ -256,22 +263,22 @@ export class Webhooks { * @param {string} url - Webhook URL. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {boolean} enabled - Enable or disable a webhook. - * @param {boolean} security - Certificate verification, false for disabled or true for enabled. - * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. + * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise; + update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string): Promise; update( - paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string, + paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string } | string, ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }; } else { params = { webhookId: paramsOrFirst as string, @@ -279,9 +286,9 @@ export class Webhooks { url: rest[1] as string, events: rest[2] as string[], enabled: rest[3] as boolean, - security: rest[4] as boolean, - httpUser: rest[5] as string, - httpPass: rest[6] as string + tls: rest[4] as boolean, + authUsername: rest[5] as string, + authPassword: rest[6] as string }; } @@ -290,9 +297,9 @@ export class Webhooks { const url = params.url; const events = params.events; const enabled = params.enabled; - const security = params.security; - const httpUser = params.httpUser; - const httpPass = params.httpPass; + const tls = params.tls; + const authUsername = params.authUsername; + const authPassword = params.authPassword; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); @@ -321,14 +328,14 @@ export class Webhooks { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof security !== 'undefined') { - payload['security'] = security; + if (typeof tls !== 'undefined') { + payload['tls'] = tls; } - if (typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; + if (typeof authUsername !== 'undefined') { + payload['authUsername'] = authUsername; } - if (typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; + if (typeof authPassword !== 'undefined') { + payload['authPassword'] = authPassword; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -397,43 +404,51 @@ export class Webhooks { } /** - * Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. + * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} params.webhookId - Webhook ID. + * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} */ - updateSignature(params: { webhookId: string }): Promise; + updateSecret(params: { webhookId: string, secret?: string }): Promise; /** - * Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. + * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} webhookId - Webhook ID. + * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSignature(webhookId: string): Promise; - updateSignature( - paramsOrFirst: { webhookId: string } | string + updateSecret(webhookId: string, secret?: string): Promise; + updateSecret( + paramsOrFirst: { webhookId: string, secret?: string } | string, + ...rest: [(string)?] ): Promise { - let params: { webhookId: string }; + let params: { webhookId: string, secret?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string }; + params = (paramsOrFirst || {}) as { webhookId: string, secret?: string }; } else { params = { - webhookId: paramsOrFirst as string + webhookId: paramsOrFirst as string, + secret: rest[0] as string }; } const webhookId = params.webhookId; + const secret = params.secret; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/webhooks/{webhookId}/signature'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}/secret'.replace('{webhookId}', webhookId); const payload: Payload = {}; + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/test/services/databases.test.js b/test/services/databases.test.js index ff809d28..6ed0b897 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -435,7 +435,7 @@ describe('Databases', () => { '', '', true, - '', + '2020-10-15T06:38:00.000+00:00', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/project.test.js b/test/services/project.test.js index 81c53b5e..7e205ea3 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -10,6 +10,931 @@ describe('Project', () => { const project = new Project(client); + test('test method updateCanonicalEmails()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateCanonicalEmails( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateDisposableEmails()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateDisposableEmails( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateFreeEmails()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateFreeEmails( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listKeys()', async () => { + const data = { + 'total': 5, + 'keys': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listKeys( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteKey()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deleteKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLabels()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLabels( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listPlatforms()', async () => { + const data = { + 'total': 5, + 'platforms': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listPlatforms( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getPlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deletePlatform()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deletePlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateProtocolStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateProtocolStatus( + 'rest', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateServiceStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateServiceStatus( + 'account', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listVariables()', async () => { const data = { 'total': 5, diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 8b475203..02012d43 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -435,7 +435,7 @@ describe('TablesDB', () => { '', '', true, - '', + '2020-10-15T06:38:00.000+00:00', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/webhooks.test.js b/test/services/webhooks.test.js index 642b4a73..d254ef7f 100644 --- a/test/services/webhooks.test.js +++ b/test/services/webhooks.test.js @@ -33,10 +33,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -63,10 +63,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -90,10 +90,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -126,7 +126,7 @@ describe('Webhooks', () => { expect(response).toEqual(data); }); - test('test method updateSignature()', async () => { + test('test method updateSecret()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -134,16 +134,16 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await webhooks.updateSignature( + const response = await webhooks.updateSecret( '', ); From 8843fd5689f14c23496708ceefcd63c1072662aa Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Apr 2026 10:43:38 +0530 Subject: [PATCH 04/18] chore: update Node.js SDK to 24.0.0 --- CHANGELOG.md | 8 ++++++-- package-lock.json | 4 ++-- package.json | 2 +- src/client.ts | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba946633..eb8c471a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,17 @@ # Change Log -## 23.2.0 +## 24.0.0 +* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` +* [BREAKING] Renamed Webhook service parameters to match: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword` +* Added `secret` parameter to Webhook create and update methods * Added `x` OAuth provider to `OAuthProvider` enum * Added `userType` field to `Log` model +* Added `purge` parameter to `updateCollection` and `updateTable` for cache invalidation * Added Project service: platform CRUD, key CRUD, label/email/protocol/service management * Added new models: `Key`, `KeyList`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, and others * Added new enums: `PlatformType`, `ProtocolId`, `ServiceId` -* Updated `BuildRuntime`, `Runtime`, `Scopes` enums +* Updated `BuildRuntime`, `Runtime`, `Scopes` enums with new values * Updated `X-Appwrite-Response-Format` header to `1.9.1` * Updated TTL description for list caching in Databases and TablesDB diff --git a/package-lock.json b/package-lock.json index a91e37ce..848f3d9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "23.2.0", + "version": "24.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "23.2.0", + "version": "24.0.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index 437c9ca6..bcf42393 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "23.2.0", + "version": "24.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 8ea5c3ec..d413d82b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/23.2.0'; + let ua = 'AppwriteNodeJSSDK/24.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -125,7 +125,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '23.2.0', + 'x-sdk-version': '24.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.1', }; From 519515a3377eebb9ce534aa2a3f30d4ffe73a20a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Apr 2026 14:33:13 +0530 Subject: [PATCH 05/18] chore: update Node.js SDK to 24.0.0 --- CHANGELOG.md | 2 +- .../project/update-canonical-emails.md | 14 - .../project/update-disposable-emails.md | 14 - docs/examples/project/update-free-emails.md | 14 - docs/examples/project/update-labels.md | 14 - docs/examples/users/update-labels.md | 15 - src/services/project.ts | 220 ----------- src/services/users.ts | 67 ---- test/services/project.test.js | 368 ------------------ test/services/users.test.js | 31 -- 10 files changed, 1 insertion(+), 758 deletions(-) delete mode 100644 docs/examples/project/update-canonical-emails.md delete mode 100644 docs/examples/project/update-disposable-emails.md delete mode 100644 docs/examples/project/update-free-emails.md delete mode 100644 docs/examples/project/update-labels.md delete mode 100644 docs/examples/users/update-labels.md diff --git a/CHANGELOG.md b/CHANGELOG.md index eb8c471a..d30e04e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * Added `x` OAuth provider to `OAuthProvider` enum * Added `userType` field to `Log` model * Added `purge` parameter to `updateCollection` and `updateTable` for cache invalidation -* Added Project service: platform CRUD, key CRUD, label/email/protocol/service management +* Added Project service: platform CRUD, key CRUD, protocol/service status management * Added new models: `Key`, `KeyList`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, and others * Added new enums: `PlatformType`, `ProtocolId`, `ServiceId` * Updated `BuildRuntime`, `Runtime`, `Scopes` enums with new values diff --git a/docs/examples/project/update-canonical-emails.md b/docs/examples/project/update-canonical-emails.md deleted file mode 100644 index 795c7995..00000000 --- a/docs/examples/project/update-canonical-emails.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateCanonicalEmails({ - enabled: false -}); -``` diff --git a/docs/examples/project/update-disposable-emails.md b/docs/examples/project/update-disposable-emails.md deleted file mode 100644 index 46674f63..00000000 --- a/docs/examples/project/update-disposable-emails.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateDisposableEmails({ - enabled: false -}); -``` diff --git a/docs/examples/project/update-free-emails.md b/docs/examples/project/update-free-emails.md deleted file mode 100644 index bc0b0917..00000000 --- a/docs/examples/project/update-free-emails.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateFreeEmails({ - enabled: false -}); -``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md deleted file mode 100644 index f924ec09..00000000 --- a/docs/examples/project/update-labels.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateLabels({ - labels: [] -}); -``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md deleted file mode 100644 index 28f28931..00000000 --- a/docs/examples/users/update-labels.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const users = new sdk.Users(client); - -const result = await users.updateLabels({ - userId: '', - labels: [] -}); -``` diff --git a/src/services/project.ts b/src/services/project.ts index aaee5655..b5015abf 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -12,171 +12,6 @@ export class Project { this.client = client; } - /** - * Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project. - * - * @param {boolean} params.enabled - Set whether or not to require canonical email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateCanonicalEmails(params: { enabled: boolean }): Promise; - /** - * Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project. - * - * @param {boolean} enabled - Set whether or not to require canonical email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateCanonicalEmails(enabled: boolean): Promise; - updateCanonicalEmails( - paramsOrFirst: { enabled: boolean } | boolean - ): Promise { - let params: { enabled: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean }; - } else { - params = { - enabled: paramsOrFirst as boolean - }; - } - - const enabled = params.enabled; - - if (typeof enabled === 'undefined') { - throw new AppwriteException('Missing required parameter: "enabled"'); - } - - const apiPath = '/project/auth/canonical-emails'; - const payload: Payload = {}; - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload, - ); - } - - /** - * Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project. - * - * @param {boolean} params.enabled - Set whether or not to block disposable email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateDisposableEmails(params: { enabled: boolean }): Promise; - /** - * Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project. - * - * @param {boolean} enabled - Set whether or not to block disposable email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateDisposableEmails(enabled: boolean): Promise; - updateDisposableEmails( - paramsOrFirst: { enabled: boolean } | boolean - ): Promise { - let params: { enabled: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean }; - } else { - params = { - enabled: paramsOrFirst as boolean - }; - } - - const enabled = params.enabled; - - if (typeof enabled === 'undefined') { - throw new AppwriteException('Missing required parameter: "enabled"'); - } - - const apiPath = '/project/auth/disposable-emails'; - const payload: Payload = {}; - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload, - ); - } - - /** - * Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project. - * - * @param {boolean} params.enabled - Set whether or not to block free email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateFreeEmails(params: { enabled: boolean }): Promise; - /** - * Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project. - * - * @param {boolean} enabled - Set whether or not to block free email addresses during signup and email updates. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateFreeEmails(enabled: boolean): Promise; - updateFreeEmails( - paramsOrFirst: { enabled: boolean } | boolean - ): Promise { - let params: { enabled: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean }; - } else { - params = { - enabled: paramsOrFirst as boolean - }; - } - - const enabled = params.enabled; - - if (typeof enabled === 'undefined') { - throw new AppwriteException('Missing required parameter: "enabled"'); - } - - const apiPath = '/project/auth/free-emails'; - const payload: Payload = {}; - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload, - ); - } - /** * Get a list of all API keys from the current project. * @@ -502,61 +337,6 @@ export class Project { ); } - /** - * Update the project labels. Labels can be used to easily filter projects in an organization. - * - * @param {string[]} params.labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateLabels(params: { labels: string[] }): Promise; - /** - * Update the project labels. Labels can be used to easily filter projects in an organization. - * - * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateLabels(labels: string[]): Promise; - updateLabels( - paramsOrFirst: { labels: string[] } | string[] - ): Promise { - let params: { labels: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { labels: string[] }; - } else { - params = { - labels: paramsOrFirst as string[] - }; - } - - const labels = params.labels; - - if (typeof labels === 'undefined') { - throw new AppwriteException('Missing required parameter: "labels"'); - } - - const apiPath = '/project/labels'; - const payload: Payload = {}; - if (typeof labels !== 'undefined') { - payload['labels'] = labels; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload, - ); - } - /** * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. * diff --git a/src/services/users.ts b/src/services/users.ts index 7bef1693..b094f01a 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1246,73 +1246,6 @@ export class Users { ); } - /** - * Update the user labels by its unique ID. - * - * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. - * - * @param {string} params.userId - User ID. - * @param {string[]} params.labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. - * @throws {AppwriteException} - * @returns {Promise>} - */ - updateLabels(params: { userId: string, labels: string[] }): Promise>; - /** - * Update the user labels by its unique ID. - * - * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. - * - * @param {string} userId - User ID. - * @param {string[]} labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateLabels(userId: string, labels: string[]): Promise>; - updateLabels( - paramsOrFirst: { userId: string, labels: string[] } | string, - ...rest: [(string[])?] - ): Promise> { - let params: { userId: string, labels: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, labels: string[] }; - } else { - params = { - userId: paramsOrFirst as string, - labels: rest[0] as string[] - }; - } - - const userId = params.userId; - const labels = params.labels; - - if (typeof userId === 'undefined') { - throw new AppwriteException('Missing required parameter: "userId"'); - } - if (typeof labels === 'undefined') { - throw new AppwriteException('Missing required parameter: "labels"'); - } - - const apiPath = '/users/{userId}/labels'.replace('{userId}', userId); - const payload: Payload = {}; - if (typeof labels !== 'undefined') { - payload['labels'] = labels; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload, - ); - } - /** * Get the user activity logs list by its unique ID. * diff --git a/test/services/project.test.js b/test/services/project.test.js index 7e205ea3..2ab03b61 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -10,282 +10,6 @@ describe('Project', () => { const project = new Project(client); - test('test method updateCanonicalEmails()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'New Project', - 'description': 'This is a new project.', - 'teamId': '1592981250', - 'logo': '5f5c451b403cb', - 'url': '5f5c451b403cb', - 'legalName': 'Company LTD.', - 'legalCountry': 'US', - 'legalState': 'New York', - 'legalCity': 'New York City.', - 'legalAddress': '620 Eighth Avenue, New York, NY 10018', - 'legalTaxId': '131102020', - 'authDuration': 60, - 'authLimit': 100, - 'authSessionsLimit': 10, - 'authPasswordHistory': 5, - 'authPasswordDictionary': true, - 'authPersonalDataCheck': true, - 'authDisposableEmails': true, - 'authCanonicalEmails': true, - 'authFreeEmails': true, - 'authMockNumbers': [], - 'authSessionAlerts': true, - 'authMembershipsUserName': true, - 'authMembershipsUserEmail': true, - 'authMembershipsMfa': true, - 'authInvalidateSessions': true, - 'oAuthProviders': [], - 'platforms': [], - 'webhooks': [], - 'keys': [], - 'devKeys': [], - 'smtpEnabled': true, - 'smtpSenderName': 'John Appwrite', - 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', - 'smtpHost': 'mail.appwrite.io', - 'smtpPort': 25, - 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', - 'smtpSecure': 'tls', - 'pingCount': 1, - 'pingedAt': '2020-10-15T06:38:00.000+00:00', - 'labels': [], - 'status': 'active', - 'authEmailPassword': true, - 'authUsersAuthMagicURL': true, - 'authEmailOtp': true, - 'authAnonymous': true, - 'authInvites': true, - 'authJWT': true, - 'authPhone': true, - 'serviceStatusForAccount': true, - 'serviceStatusForAvatars': true, - 'serviceStatusForDatabases': true, - 'serviceStatusForTablesdb': true, - 'serviceStatusForLocale': true, - 'serviceStatusForHealth': true, - 'serviceStatusForProject': true, - 'serviceStatusForStorage': true, - 'serviceStatusForTeams': true, - 'serviceStatusForUsers': true, - 'serviceStatusForVcs': true, - 'serviceStatusForSites': true, - 'serviceStatusForFunctions': true, - 'serviceStatusForProxy': true, - 'serviceStatusForGraphql': true, - 'serviceStatusForMigrations': true, - 'serviceStatusForMessaging': true, - 'protocolStatusForRest': true, - 'protocolStatusForGraphql': true, - 'protocolStatusForWebsocket': true, - 'region': 'fra', - 'billingLimits': {}, - 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await project.updateCanonicalEmails( - true, - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method updateDisposableEmails()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'New Project', - 'description': 'This is a new project.', - 'teamId': '1592981250', - 'logo': '5f5c451b403cb', - 'url': '5f5c451b403cb', - 'legalName': 'Company LTD.', - 'legalCountry': 'US', - 'legalState': 'New York', - 'legalCity': 'New York City.', - 'legalAddress': '620 Eighth Avenue, New York, NY 10018', - 'legalTaxId': '131102020', - 'authDuration': 60, - 'authLimit': 100, - 'authSessionsLimit': 10, - 'authPasswordHistory': 5, - 'authPasswordDictionary': true, - 'authPersonalDataCheck': true, - 'authDisposableEmails': true, - 'authCanonicalEmails': true, - 'authFreeEmails': true, - 'authMockNumbers': [], - 'authSessionAlerts': true, - 'authMembershipsUserName': true, - 'authMembershipsUserEmail': true, - 'authMembershipsMfa': true, - 'authInvalidateSessions': true, - 'oAuthProviders': [], - 'platforms': [], - 'webhooks': [], - 'keys': [], - 'devKeys': [], - 'smtpEnabled': true, - 'smtpSenderName': 'John Appwrite', - 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', - 'smtpHost': 'mail.appwrite.io', - 'smtpPort': 25, - 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', - 'smtpSecure': 'tls', - 'pingCount': 1, - 'pingedAt': '2020-10-15T06:38:00.000+00:00', - 'labels': [], - 'status': 'active', - 'authEmailPassword': true, - 'authUsersAuthMagicURL': true, - 'authEmailOtp': true, - 'authAnonymous': true, - 'authInvites': true, - 'authJWT': true, - 'authPhone': true, - 'serviceStatusForAccount': true, - 'serviceStatusForAvatars': true, - 'serviceStatusForDatabases': true, - 'serviceStatusForTablesdb': true, - 'serviceStatusForLocale': true, - 'serviceStatusForHealth': true, - 'serviceStatusForProject': true, - 'serviceStatusForStorage': true, - 'serviceStatusForTeams': true, - 'serviceStatusForUsers': true, - 'serviceStatusForVcs': true, - 'serviceStatusForSites': true, - 'serviceStatusForFunctions': true, - 'serviceStatusForProxy': true, - 'serviceStatusForGraphql': true, - 'serviceStatusForMigrations': true, - 'serviceStatusForMessaging': true, - 'protocolStatusForRest': true, - 'protocolStatusForGraphql': true, - 'protocolStatusForWebsocket': true, - 'region': 'fra', - 'billingLimits': {}, - 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await project.updateDisposableEmails( - true, - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method updateFreeEmails()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'New Project', - 'description': 'This is a new project.', - 'teamId': '1592981250', - 'logo': '5f5c451b403cb', - 'url': '5f5c451b403cb', - 'legalName': 'Company LTD.', - 'legalCountry': 'US', - 'legalState': 'New York', - 'legalCity': 'New York City.', - 'legalAddress': '620 Eighth Avenue, New York, NY 10018', - 'legalTaxId': '131102020', - 'authDuration': 60, - 'authLimit': 100, - 'authSessionsLimit': 10, - 'authPasswordHistory': 5, - 'authPasswordDictionary': true, - 'authPersonalDataCheck': true, - 'authDisposableEmails': true, - 'authCanonicalEmails': true, - 'authFreeEmails': true, - 'authMockNumbers': [], - 'authSessionAlerts': true, - 'authMembershipsUserName': true, - 'authMembershipsUserEmail': true, - 'authMembershipsMfa': true, - 'authInvalidateSessions': true, - 'oAuthProviders': [], - 'platforms': [], - 'webhooks': [], - 'keys': [], - 'devKeys': [], - 'smtpEnabled': true, - 'smtpSenderName': 'John Appwrite', - 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', - 'smtpHost': 'mail.appwrite.io', - 'smtpPort': 25, - 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', - 'smtpSecure': 'tls', - 'pingCount': 1, - 'pingedAt': '2020-10-15T06:38:00.000+00:00', - 'labels': [], - 'status': 'active', - 'authEmailPassword': true, - 'authUsersAuthMagicURL': true, - 'authEmailOtp': true, - 'authAnonymous': true, - 'authInvites': true, - 'authJWT': true, - 'authPhone': true, - 'serviceStatusForAccount': true, - 'serviceStatusForAvatars': true, - 'serviceStatusForDatabases': true, - 'serviceStatusForTablesdb': true, - 'serviceStatusForLocale': true, - 'serviceStatusForHealth': true, - 'serviceStatusForProject': true, - 'serviceStatusForStorage': true, - 'serviceStatusForTeams': true, - 'serviceStatusForUsers': true, - 'serviceStatusForVcs': true, - 'serviceStatusForSites': true, - 'serviceStatusForFunctions': true, - 'serviceStatusForProxy': true, - 'serviceStatusForGraphql': true, - 'serviceStatusForMigrations': true, - 'serviceStatusForMessaging': true, - 'protocolStatusForRest': true, - 'protocolStatusForGraphql': true, - 'protocolStatusForWebsocket': true, - 'region': 'fra', - 'billingLimits': {}, - 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await project.updateFreeEmails( - true, - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listKeys()', async () => { const data = { 'total': 5, @@ -388,98 +112,6 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateLabels()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'New Project', - 'description': 'This is a new project.', - 'teamId': '1592981250', - 'logo': '5f5c451b403cb', - 'url': '5f5c451b403cb', - 'legalName': 'Company LTD.', - 'legalCountry': 'US', - 'legalState': 'New York', - 'legalCity': 'New York City.', - 'legalAddress': '620 Eighth Avenue, New York, NY 10018', - 'legalTaxId': '131102020', - 'authDuration': 60, - 'authLimit': 100, - 'authSessionsLimit': 10, - 'authPasswordHistory': 5, - 'authPasswordDictionary': true, - 'authPersonalDataCheck': true, - 'authDisposableEmails': true, - 'authCanonicalEmails': true, - 'authFreeEmails': true, - 'authMockNumbers': [], - 'authSessionAlerts': true, - 'authMembershipsUserName': true, - 'authMembershipsUserEmail': true, - 'authMembershipsMfa': true, - 'authInvalidateSessions': true, - 'oAuthProviders': [], - 'platforms': [], - 'webhooks': [], - 'keys': [], - 'devKeys': [], - 'smtpEnabled': true, - 'smtpSenderName': 'John Appwrite', - 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', - 'smtpHost': 'mail.appwrite.io', - 'smtpPort': 25, - 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', - 'smtpSecure': 'tls', - 'pingCount': 1, - 'pingedAt': '2020-10-15T06:38:00.000+00:00', - 'labels': [], - 'status': 'active', - 'authEmailPassword': true, - 'authUsersAuthMagicURL': true, - 'authEmailOtp': true, - 'authAnonymous': true, - 'authInvites': true, - 'authJWT': true, - 'authPhone': true, - 'serviceStatusForAccount': true, - 'serviceStatusForAvatars': true, - 'serviceStatusForDatabases': true, - 'serviceStatusForTablesdb': true, - 'serviceStatusForLocale': true, - 'serviceStatusForHealth': true, - 'serviceStatusForProject': true, - 'serviceStatusForStorage': true, - 'serviceStatusForTeams': true, - 'serviceStatusForUsers': true, - 'serviceStatusForVcs': true, - 'serviceStatusForSites': true, - 'serviceStatusForFunctions': true, - 'serviceStatusForProxy': true, - 'serviceStatusForGraphql': true, - 'serviceStatusForMigrations': true, - 'serviceStatusForMessaging': true, - 'protocolStatusForRest': true, - 'protocolStatusForGraphql': true, - 'protocolStatusForWebsocket': true, - 'region': 'fra', - 'billingLimits': {}, - 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await project.updateLabels( - [], - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listPlatforms()', async () => { const data = { 'total': 5, diff --git a/test/services/users.test.js b/test/services/users.test.js index c01295da..7d919d7b 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -437,37 +437,6 @@ describe('Users', () => { expect(response).toEqual(data); }); - test('test method updateLabels()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'John Doe', - 'registration': '2020-10-15T06:38:00.000+00:00', - 'status': true, - 'labels': [], - 'passwordUpdate': '2020-10-15T06:38:00.000+00:00', - 'email': 'john@appwrite.io', - 'phone': '+4930901820', - 'emailVerification': true, - 'phoneVerification': true, - 'mfa': true, - 'prefs': {}, - 'targets': [], - 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await users.updateLabels( - '', - [], - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listLogs()', async () => { const data = { 'total': 5, From 4e71edbc563d9d6f1c55388f68cb0e2f82edba5b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Apr 2026 15:09:48 +0530 Subject: [PATCH 06/18] chore: update Node.js SDK to 24.0.0 --- docs/examples/project/update-labels.md | 14 ++++ docs/examples/users/update-labels.md | 15 +++++ src/services/project.ts | 55 +++++++++++++++ src/services/users.ts | 67 +++++++++++++++++++ test/services/project.test.js | 92 ++++++++++++++++++++++++++ test/services/users.test.js | 31 +++++++++ 6 files changed, 274 insertions(+) create mode 100644 docs/examples/project/update-labels.md create mode 100644 docs/examples/users/update-labels.md diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md new file mode 100644 index 00000000..f924ec09 --- /dev/null +++ b/docs/examples/project/update-labels.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLabels({ + labels: [] +}); +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md new file mode 100644 index 00000000..28f28931 --- /dev/null +++ b/docs/examples/users/update-labels.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateLabels({ + userId: '', + labels: [] +}); +``` diff --git a/src/services/project.ts b/src/services/project.ts index b5015abf..f2829b93 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -337,6 +337,61 @@ export class Project { ); } + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} params.labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLabels(params: { labels: string[] }): Promise; + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLabels(labels: string[]): Promise; + updateLabels( + paramsOrFirst: { labels: string[] } | string[] + ): Promise { + let params: { labels: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { labels: string[] }; + } else { + params = { + labels: paramsOrFirst as string[] + }; + } + + const labels = params.labels; + + if (typeof labels === 'undefined') { + throw new AppwriteException('Missing required parameter: "labels"'); + } + + const apiPath = '/project/labels'; + const payload: Payload = {}; + if (typeof labels !== 'undefined') { + payload['labels'] = labels; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. * diff --git a/src/services/users.ts b/src/services/users.ts index b094f01a..7bef1693 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1246,6 +1246,73 @@ export class Users { ); } + /** + * Update the user labels by its unique ID. + * + * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + * + * @param {string} params.userId - User ID. + * @param {string[]} params.labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise>} + */ + updateLabels(params: { userId: string, labels: string[] }): Promise>; + /** + * Update the user labels by its unique ID. + * + * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + * + * @param {string} userId - User ID. + * @param {string[]} labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLabels(userId: string, labels: string[]): Promise>; + updateLabels( + paramsOrFirst: { userId: string, labels: string[] } | string, + ...rest: [(string[])?] + ): Promise> { + let params: { userId: string, labels: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userId: string, labels: string[] }; + } else { + params = { + userId: paramsOrFirst as string, + labels: rest[0] as string[] + }; + } + + const userId = params.userId; + const labels = params.labels; + + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof labels === 'undefined') { + throw new AppwriteException('Missing required parameter: "labels"'); + } + + const apiPath = '/users/{userId}/labels'.replace('{userId}', userId); + const payload: Payload = {}; + if (typeof labels !== 'undefined') { + payload['labels'] = labels; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** * Get the user activity logs list by its unique ID. * diff --git a/test/services/project.test.js b/test/services/project.test.js index 2ab03b61..6e273b69 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -112,6 +112,98 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateLabels()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLabels( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listPlatforms()', async () => { const data = { 'total': 5, diff --git a/test/services/users.test.js b/test/services/users.test.js index 7d919d7b..c01295da 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -437,6 +437,37 @@ describe('Users', () => { expect(response).toEqual(data); }); + test('test method updateLabels()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'John Doe', + 'registration': '2020-10-15T06:38:00.000+00:00', + 'status': true, + 'labels': [], + 'passwordUpdate': '2020-10-15T06:38:00.000+00:00', + 'email': 'john@appwrite.io', + 'phone': '+4930901820', + 'emailVerification': true, + 'phoneVerification': true, + 'mfa': true, + 'prefs': {}, + 'targets': [], + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await users.updateLabels( + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listLogs()', async () => { const data = { 'total': 5, From 2c307d9be3b6d4fe4a29a26f9f6619bde08badc8 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 16 Apr 2026 17:45:37 +0530 Subject: [PATCH 07/18] chore: update Node.js SDK to 24.0.0 --- CHANGELOG.md | 7 +- test/services/account.test.js | 106 +++++++++++----------- test/services/activities.test.js | 4 +- test/services/backups.test.js | 24 ++--- test/services/databases.test.js | 145 ++++++++++++++++--------------- test/services/functions.test.js | 50 +++++------ test/services/graphql.test.js | 4 +- test/services/health.test.js | 48 +++++----- test/services/locale.test.js | 16 ++-- test/services/messaging.test.js | 112 ++++++++++++------------ test/services/project.test.js | 54 ++++++------ test/services/sites.test.js | 48 +++++----- test/services/storage.test.js | 20 ++--- test/services/tables-d-b.test.js | 145 ++++++++++++++++--------------- test/services/teams.test.js | 26 +++--- test/services/tokens.test.js | 10 +-- test/services/users.test.js | 98 ++++++++++----------- test/services/webhooks.test.js | 12 +-- 18 files changed, 467 insertions(+), 462 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d30e04e1..3f3e163e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,17 @@ * [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` * [BREAKING] Renamed Webhook service parameters to match: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword` +* [BREAKING] Renamed `Webhooks.updateSignature()` to `Webhooks.updateSecret()` with new optional `secret` parameter +* Added `Client.getHeaders()` method to retrieve request headers * Added `secret` parameter to Webhook create and update methods * Added `x` OAuth provider to `OAuthProvider` enum * Added `userType` field to `Log` model * Added `purge` parameter to `updateCollection` and `updateTable` for cache invalidation * Added Project service: platform CRUD, key CRUD, protocol/service status management -* Added new models: `Key`, `KeyList`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, and others +* Added new models: `Key`, `KeyList`, `Project`, `DevKey`, `MockNumber`, `AuthProvider`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, `PlatformWeb`, `PlatformWindows`, `BillingLimits`, `Block` * Added new enums: `PlatformType`, `ProtocolId`, `ServiceId` -* Updated `BuildRuntime`, `Runtime`, `Scopes` enums with new values +* Updated `BuildRuntime`, `Runtime` enums with `dart-3.11` and `flutter-3.41` +* Updated `Scopes` enum with `keysRead`, `keysWrite`, `platformsRead`, `platformsWrite` * Updated `X-Appwrite-Response-Format` header to `1.9.1` * Updated TTL description for list caching in Databases and TablesDB diff --git a/test/services/account.test.js b/test/services/account.test.js index df618357..a9bbd59a 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -11,7 +11,7 @@ describe('Account', () => { test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -40,7 +40,7 @@ describe('Account', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -72,7 +72,7 @@ describe('Account', () => { }); test('test method updateEmail()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -103,7 +103,7 @@ describe('Account', () => { }); test('test method listIdentities()', async () => { - const data = { + const data = { 'total': 5, 'identities': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -118,7 +118,7 @@ describe('Account', () => { }); test('test method deleteIdentity()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.deleteIdentity( @@ -132,7 +132,7 @@ describe('Account', () => { }); test('test method createJWT()', async () => { - const data = { + const data = { 'jwt': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -146,7 +146,7 @@ describe('Account', () => { }); test('test method listLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -161,7 +161,7 @@ describe('Account', () => { }); test('test method updateMFA()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -191,7 +191,7 @@ describe('Account', () => { }); test('test method createMfaAuthenticator()', async () => { - const data = { + const data = { 'secret': '[SHARED_SECRET]', 'uri': 'otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -207,7 +207,7 @@ describe('Account', () => { }); test('test method createMFAAuthenticator()', async () => { - const data = { + const data = { 'secret': '[SHARED_SECRET]', 'uri': 'otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -223,7 +223,7 @@ describe('Account', () => { }); test('test method updateMfaAuthenticator()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -254,7 +254,7 @@ describe('Account', () => { }); test('test method updateMFAAuthenticator()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -285,7 +285,7 @@ describe('Account', () => { }); test('test method deleteMfaAuthenticator()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.deleteMfaAuthenticator( @@ -299,7 +299,7 @@ describe('Account', () => { }); test('test method deleteMFAAuthenticator()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.deleteMFAAuthenticator( @@ -313,7 +313,7 @@ describe('Account', () => { }); test('test method createMfaChallenge()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -331,7 +331,7 @@ describe('Account', () => { }); test('test method createMFAChallenge()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -349,7 +349,7 @@ describe('Account', () => { }); test('test method updateMfaChallenge()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -393,7 +393,7 @@ describe('Account', () => { }); test('test method updateMFAChallenge()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -437,7 +437,7 @@ describe('Account', () => { }); test('test method listMfaFactors()', async () => { - const data = { + const data = { 'totp': true, 'phone': true, 'email': true, @@ -454,7 +454,7 @@ describe('Account', () => { }); test('test method listMFAFactors()', async () => { - const data = { + const data = { 'totp': true, 'phone': true, 'email': true, @@ -471,7 +471,7 @@ describe('Account', () => { }); test('test method getMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -485,7 +485,7 @@ describe('Account', () => { }); test('test method getMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -499,7 +499,7 @@ describe('Account', () => { }); test('test method createMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -513,7 +513,7 @@ describe('Account', () => { }); test('test method createMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -527,7 +527,7 @@ describe('Account', () => { }); test('test method updateMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -541,7 +541,7 @@ describe('Account', () => { }); test('test method updateMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -555,7 +555,7 @@ describe('Account', () => { }); test('test method updateName()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -585,7 +585,7 @@ describe('Account', () => { }); test('test method updatePassword()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -615,7 +615,7 @@ describe('Account', () => { }); test('test method updatePhone()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -646,7 +646,7 @@ describe('Account', () => { }); test('test method getPrefs()', async () => { - const data = {}; + const data = {}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.getPrefs( @@ -659,7 +659,7 @@ describe('Account', () => { }); test('test method updatePrefs()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -689,7 +689,7 @@ describe('Account', () => { }); test('test method createRecovery()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -710,7 +710,7 @@ describe('Account', () => { }); test('test method updateRecovery()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -732,7 +732,7 @@ describe('Account', () => { }); test('test method listSessions()', async () => { - const data = { + const data = { 'total': 5, 'sessions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -747,7 +747,7 @@ describe('Account', () => { }); test('test method deleteSessions()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.deleteSessions( @@ -760,7 +760,7 @@ describe('Account', () => { }); test('test method createAnonymousSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -802,7 +802,7 @@ describe('Account', () => { }); test('test method createEmailPasswordSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -846,7 +846,7 @@ describe('Account', () => { }); test('test method updateMagicURLSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -890,7 +890,7 @@ describe('Account', () => { }); test('test method updatePhoneSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -934,7 +934,7 @@ describe('Account', () => { }); test('test method createSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -978,7 +978,7 @@ describe('Account', () => { }); test('test method getSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1021,7 +1021,7 @@ describe('Account', () => { }); test('test method updateSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1064,7 +1064,7 @@ describe('Account', () => { }); test('test method deleteSession()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.deleteSession( @@ -1078,7 +1078,7 @@ describe('Account', () => { }); test('test method updateStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1107,7 +1107,7 @@ describe('Account', () => { }); test('test method createEmailToken()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1128,7 +1128,7 @@ describe('Account', () => { }); test('test method createMagicURLToken()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1163,7 +1163,7 @@ describe('Account', () => { }); test('test method createPhoneToken()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1184,7 +1184,7 @@ describe('Account', () => { }); test('test method createEmailVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1204,7 +1204,7 @@ describe('Account', () => { }); test('test method createVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1224,7 +1224,7 @@ describe('Account', () => { }); test('test method updateEmailVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1245,7 +1245,7 @@ describe('Account', () => { }); test('test method updateVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1266,7 +1266,7 @@ describe('Account', () => { }); test('test method createPhoneVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1285,7 +1285,7 @@ describe('Account', () => { }); test('test method updatePhoneVerification()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', diff --git a/test/services/activities.test.js b/test/services/activities.test.js index fcf8e46e..667ecc56 100644 --- a/test/services/activities.test.js +++ b/test/services/activities.test.js @@ -11,7 +11,7 @@ describe('Activities', () => { test('test method listEvents()', async () => { - const data = { + const data = { 'total': 5, 'events': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Activities', () => { }); test('test method getEvent()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'userType': 'user', 'userId': '610fc2f985ee0', diff --git a/test/services/backups.test.js b/test/services/backups.test.js index b87b1c08..c888402e 100644 --- a/test/services/backups.test.js +++ b/test/services/backups.test.js @@ -11,7 +11,7 @@ describe('Backups', () => { test('test method listArchives()', async () => { - const data = { + const data = { 'total': 5, 'archives': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Backups', () => { }); test('test method createArchive()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -50,7 +50,7 @@ describe('Backups', () => { }); test('test method getArchive()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -74,7 +74,7 @@ describe('Backups', () => { }); test('test method deleteArchive()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.deleteArchive( @@ -88,7 +88,7 @@ describe('Backups', () => { }); test('test method listPolicies()', async () => { - const data = { + const data = { 'total': 5, 'policies': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -103,7 +103,7 @@ describe('Backups', () => { }); test('test method createPolicy()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'Hourly backups', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -129,7 +129,7 @@ describe('Backups', () => { }); test('test method getPolicy()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'Hourly backups', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -152,7 +152,7 @@ describe('Backups', () => { }); test('test method updatePolicy()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'Hourly backups', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -175,7 +175,7 @@ describe('Backups', () => { }); test('test method deletePolicy()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.deletePolicy( @@ -189,7 +189,7 @@ describe('Backups', () => { }); test('test method createRestoration()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -215,7 +215,7 @@ describe('Backups', () => { }); test('test method listRestorations()', async () => { - const data = { + const data = { 'total': 5, 'restorations': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -230,7 +230,7 @@ describe('Backups', () => { }); test('test method getRestoration()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', diff --git a/test/services/databases.test.js b/test/services/databases.test.js index 6ed0b897..26c78bac 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -11,7 +11,7 @@ describe('Databases', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'databases': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Databases', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -49,7 +49,7 @@ describe('Databases', () => { }); test('test method listTransactions()', async () => { - const data = { + const data = { 'total': 5, 'transactions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -64,7 +64,7 @@ describe('Databases', () => { }); test('test method createTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -83,7 +83,7 @@ describe('Databases', () => { }); test('test method getTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -103,7 +103,7 @@ describe('Databases', () => { }); test('test method updateTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -123,7 +123,7 @@ describe('Databases', () => { }); test('test method deleteTransaction()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.deleteTransaction( @@ -137,7 +137,7 @@ describe('Databases', () => { }); test('test method createOperations()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -157,7 +157,7 @@ describe('Databases', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -179,7 +179,7 @@ describe('Databases', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -201,7 +201,7 @@ describe('Databases', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.delete( @@ -215,7 +215,7 @@ describe('Databases', () => { }); test('test method listCollections()', async () => { - const data = { + const data = { 'total': 5, 'collections': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -231,7 +231,7 @@ describe('Databases', () => { }); test('test method createCollection()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -259,7 +259,7 @@ describe('Databases', () => { }); test('test method getCollection()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -286,7 +286,7 @@ describe('Databases', () => { }); test('test method updateCollection()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -313,7 +313,7 @@ describe('Databases', () => { }); test('test method deleteCollection()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.deleteCollection( @@ -328,7 +328,7 @@ describe('Databases', () => { }); test('test method listAttributes()', async () => { - const data = { + const data = { 'total': 5, 'attributes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -345,7 +345,7 @@ describe('Databases', () => { }); test('test method createBooleanAttribute()', async () => { - const data = { + const data = { 'key': 'isEnabled', 'type': 'boolean', 'status': 'available', @@ -369,7 +369,7 @@ describe('Databases', () => { }); test('test method updateBooleanAttribute()', async () => { - const data = { + const data = { 'key': 'isEnabled', 'type': 'boolean', 'status': 'available', @@ -394,7 +394,7 @@ describe('Databases', () => { }); test('test method createDatetimeAttribute()', async () => { - const data = { + const data = { 'key': 'birthDay', 'type': 'datetime', 'status': 'available', @@ -419,7 +419,7 @@ describe('Databases', () => { }); test('test method updateDatetimeAttribute()', async () => { - const data = { + const data = { 'key': 'birthDay', 'type': 'datetime', 'status': 'available', @@ -445,7 +445,7 @@ describe('Databases', () => { }); test('test method createEmailAttribute()', async () => { - const data = { + const data = { 'key': 'userEmail', 'type': 'string', 'status': 'available', @@ -470,7 +470,7 @@ describe('Databases', () => { }); test('test method updateEmailAttribute()', async () => { - const data = { + const data = { 'key': 'userEmail', 'type': 'string', 'status': 'available', @@ -496,7 +496,7 @@ describe('Databases', () => { }); test('test method createEnumAttribute()', async () => { - const data = { + const data = { 'key': 'status', 'type': 'string', 'status': 'available', @@ -523,7 +523,7 @@ describe('Databases', () => { }); test('test method updateEnumAttribute()', async () => { - const data = { + const data = { 'key': 'status', 'type': 'string', 'status': 'available', @@ -551,7 +551,7 @@ describe('Databases', () => { }); test('test method createFloatAttribute()', async () => { - const data = { + const data = { 'key': 'percentageCompleted', 'type': 'double', 'status': 'available', @@ -575,7 +575,7 @@ describe('Databases', () => { }); test('test method updateFloatAttribute()', async () => { - const data = { + const data = { 'key': 'percentageCompleted', 'type': 'double', 'status': 'available', @@ -600,7 +600,7 @@ describe('Databases', () => { }); test('test method createIntegerAttribute()', async () => { - const data = { + const data = { 'key': 'count', 'type': 'integer', 'status': 'available', @@ -624,7 +624,7 @@ describe('Databases', () => { }); test('test method updateIntegerAttribute()', async () => { - const data = { + const data = { 'key': 'count', 'type': 'integer', 'status': 'available', @@ -649,7 +649,7 @@ describe('Databases', () => { }); test('test method createIpAttribute()', async () => { - const data = { + const data = { 'key': 'ipAddress', 'type': 'string', 'status': 'available', @@ -674,7 +674,7 @@ describe('Databases', () => { }); test('test method updateIpAttribute()', async () => { - const data = { + const data = { 'key': 'ipAddress', 'type': 'string', 'status': 'available', @@ -700,7 +700,7 @@ describe('Databases', () => { }); test('test method createLineAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -724,7 +724,7 @@ describe('Databases', () => { }); test('test method updateLineAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -748,7 +748,7 @@ describe('Databases', () => { }); test('test method createLongtextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -772,7 +772,7 @@ describe('Databases', () => { }); test('test method updateLongtextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -797,7 +797,7 @@ describe('Databases', () => { }); test('test method createMediumtextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -821,7 +821,7 @@ describe('Databases', () => { }); test('test method updateMediumtextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -846,7 +846,7 @@ describe('Databases', () => { }); test('test method createPointAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -870,7 +870,7 @@ describe('Databases', () => { }); test('test method updatePointAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -894,7 +894,7 @@ describe('Databases', () => { }); test('test method createPolygonAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -918,7 +918,7 @@ describe('Databases', () => { }); test('test method updatePolygonAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -942,7 +942,7 @@ describe('Databases', () => { }); test('test method createRelationshipAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -972,7 +972,7 @@ describe('Databases', () => { }); test('test method updateRelationshipAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1001,7 +1001,7 @@ describe('Databases', () => { }); test('test method createStringAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1027,7 +1027,7 @@ describe('Databases', () => { }); test('test method updateStringAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1053,7 +1053,7 @@ describe('Databases', () => { }); test('test method createTextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1077,7 +1077,7 @@ describe('Databases', () => { }); test('test method updateTextAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1102,7 +1102,7 @@ describe('Databases', () => { }); test('test method createUrlAttribute()', async () => { - const data = { + const data = { 'key': 'githubUrl', 'type': 'string', 'status': 'available', @@ -1127,7 +1127,7 @@ describe('Databases', () => { }); test('test method updateUrlAttribute()', async () => { - const data = { + const data = { 'key': 'githubUrl', 'type': 'string', 'status': 'available', @@ -1153,7 +1153,7 @@ describe('Databases', () => { }); test('test method createVarcharAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1179,7 +1179,7 @@ describe('Databases', () => { }); test('test method updateVarcharAttribute()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1205,14 +1205,15 @@ describe('Databases', () => { }); test('test method getAttribute()', async () => { - const data = { - 'key': 'isEnabled', - 'type': 'boolean', + const data = { + 'key': 'fullName', + 'type': 'string', 'status': 'available', 'error': 'string', 'required': true, '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'size': 128,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.getAttribute( @@ -1228,7 +1229,7 @@ describe('Databases', () => { }); test('test method deleteAttribute()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.deleteAttribute( @@ -1244,7 +1245,7 @@ describe('Databases', () => { }); test('test method listDocuments()', async () => { - const data = { + const data = { 'total': 5, 'documents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1261,7 +1262,7 @@ describe('Databases', () => { }); test('test method createDocument()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1285,7 +1286,7 @@ describe('Databases', () => { }); test('test method createDocuments()', async () => { - const data = { + const data = { 'total': 5, 'documents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1303,7 +1304,7 @@ describe('Databases', () => { }); test('test method upsertDocuments()', async () => { - const data = { + const data = { 'total': 5, 'documents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1321,7 +1322,7 @@ describe('Databases', () => { }); test('test method updateDocuments()', async () => { - const data = { + const data = { 'total': 5, 'documents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1338,7 +1339,7 @@ describe('Databases', () => { }); test('test method deleteDocuments()', async () => { - const data = { + const data = { 'total': 5, 'documents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1355,7 +1356,7 @@ describe('Databases', () => { }); test('test method getDocument()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1378,7 +1379,7 @@ describe('Databases', () => { }); test('test method upsertDocument()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1401,7 +1402,7 @@ describe('Databases', () => { }); test('test method updateDocument()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1424,7 +1425,7 @@ describe('Databases', () => { }); test('test method deleteDocument()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.deleteDocument( @@ -1440,7 +1441,7 @@ describe('Databases', () => { }); test('test method decrementDocumentAttribute()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1464,7 +1465,7 @@ describe('Databases', () => { }); test('test method incrementDocumentAttribute()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$collectionId': '5e5ea5c15117e', @@ -1488,7 +1489,7 @@ describe('Databases', () => { }); test('test method listIndexes()', async () => { - const data = { + const data = { 'total': 5, 'indexes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1505,7 +1506,7 @@ describe('Databases', () => { }); test('test method createIndex()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1532,7 +1533,7 @@ describe('Databases', () => { }); test('test method getIndex()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1557,7 +1558,7 @@ describe('Databases', () => { }); test('test method deleteIndex()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.deleteIndex( diff --git a/test/services/functions.test.js b/test/services/functions.test.js index b057cd62..0fcdc022 100644 --- a/test/services/functions.test.js +++ b/test/services/functions.test.js @@ -11,7 +11,7 @@ describe('Functions', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'functions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Functions', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -72,7 +72,7 @@ describe('Functions', () => { }); test('test method listRuntimes()', async () => { - const data = { + const data = { 'total': 5, 'runtimes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -87,7 +87,7 @@ describe('Functions', () => { }); test('test method listSpecifications()', async () => { - const data = { + const data = { 'total': 5, 'specifications': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -102,7 +102,7 @@ describe('Functions', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -146,7 +146,7 @@ describe('Functions', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -191,7 +191,7 @@ describe('Functions', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.delete( @@ -205,7 +205,7 @@ describe('Functions', () => { }); test('test method updateFunctionDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -250,7 +250,7 @@ describe('Functions', () => { }); test('test method listDeployments()', async () => { - const data = { + const data = { 'total': 5, 'deployments': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -266,7 +266,7 @@ describe('Functions', () => { }); test('test method createDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -309,7 +309,7 @@ describe('Functions', () => { }); test('test method createDuplicateDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -351,7 +351,7 @@ describe('Functions', () => { }); test('test method createTemplateDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -397,7 +397,7 @@ describe('Functions', () => { }); test('test method createVcsDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -440,7 +440,7 @@ describe('Functions', () => { }); test('test method getDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -482,7 +482,7 @@ describe('Functions', () => { }); test('test method deleteDeployment()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.deleteDeployment( @@ -512,7 +512,7 @@ describe('Functions', () => { }); test('test method updateDeploymentStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -554,7 +554,7 @@ describe('Functions', () => { }); test('test method listExecutions()', async () => { - const data = { + const data = { 'total': 5, 'executions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -570,7 +570,7 @@ describe('Functions', () => { }); test('test method createExecution()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -601,7 +601,7 @@ describe('Functions', () => { }); test('test method getExecution()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -633,7 +633,7 @@ describe('Functions', () => { }); test('test method deleteExecution()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.deleteExecution( @@ -648,7 +648,7 @@ describe('Functions', () => { }); test('test method listVariables()', async () => { - const data = { + const data = { 'total': 5, 'variables': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -664,7 +664,7 @@ describe('Functions', () => { }); test('test method createVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -688,7 +688,7 @@ describe('Functions', () => { }); test('test method getVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -711,7 +711,7 @@ describe('Functions', () => { }); test('test method updateVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -735,7 +735,7 @@ describe('Functions', () => { }); test('test method deleteVariable()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.deleteVariable( diff --git a/test/services/graphql.test.js b/test/services/graphql.test.js index 3ff83bbd..da7e49bf 100644 --- a/test/services/graphql.test.js +++ b/test/services/graphql.test.js @@ -11,7 +11,7 @@ describe('Graphql', () => { test('test method query()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await graphql.query( @@ -25,7 +25,7 @@ describe('Graphql', () => { }); test('test method mutation()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await graphql.mutation( diff --git a/test/services/health.test.js b/test/services/health.test.js index 75178b52..17f087e2 100644 --- a/test/services/health.test.js +++ b/test/services/health.test.js @@ -11,7 +11,7 @@ describe('Health', () => { test('test method get()', async () => { - const data = { + const data = { 'name': 'database', 'ping': 128, 'status': 'pass',}; @@ -27,7 +27,7 @@ describe('Health', () => { }); test('test method getAntivirus()', async () => { - const data = { + const data = { 'version': '1.0.0', 'status': 'online',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -42,7 +42,7 @@ describe('Health', () => { }); test('test method getCache()', async () => { - const data = { + const data = { 'total': 5, 'statuses': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -57,7 +57,7 @@ describe('Health', () => { }); test('test method getCertificate()', async () => { - const data = { + const data = { 'name': '/CN=www.google.com', 'subjectSN': '', 'issuerOrganisation': '', @@ -76,7 +76,7 @@ describe('Health', () => { }); test('test method getConsolePausing()', async () => { - const data = { + const data = { 'name': 'database', 'ping': 128, 'status': 'pass',}; @@ -92,7 +92,7 @@ describe('Health', () => { }); test('test method getDB()', async () => { - const data = { + const data = { 'total': 5, 'statuses': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -107,7 +107,7 @@ describe('Health', () => { }); test('test method getPubSub()', async () => { - const data = { + const data = { 'total': 5, 'statuses': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -122,7 +122,7 @@ describe('Health', () => { }); test('test method getQueueAudits()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -136,7 +136,7 @@ describe('Health', () => { }); test('test method getQueueBuilds()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -150,7 +150,7 @@ describe('Health', () => { }); test('test method getQueueCertificates()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -164,7 +164,7 @@ describe('Health', () => { }); test('test method getQueueDatabases()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -178,7 +178,7 @@ describe('Health', () => { }); test('test method getQueueDeletes()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -192,7 +192,7 @@ describe('Health', () => { }); test('test method getFailedJobs()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -207,7 +207,7 @@ describe('Health', () => { }); test('test method getQueueFunctions()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -221,7 +221,7 @@ describe('Health', () => { }); test('test method getQueueLogs()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -235,7 +235,7 @@ describe('Health', () => { }); test('test method getQueueMails()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -249,7 +249,7 @@ describe('Health', () => { }); test('test method getQueueMessaging()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -263,7 +263,7 @@ describe('Health', () => { }); test('test method getQueueMigrations()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -277,7 +277,7 @@ describe('Health', () => { }); test('test method getQueueStatsResources()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -291,7 +291,7 @@ describe('Health', () => { }); test('test method getQueueUsage()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -305,7 +305,7 @@ describe('Health', () => { }); test('test method getQueueWebhooks()', async () => { - const data = { + const data = { 'size': 8,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -319,7 +319,7 @@ describe('Health', () => { }); test('test method getStorage()', async () => { - const data = { + const data = { 'name': 'database', 'ping': 128, 'status': 'pass',}; @@ -335,7 +335,7 @@ describe('Health', () => { }); test('test method getStorageLocal()', async () => { - const data = { + const data = { 'name': 'database', 'ping': 128, 'status': 'pass',}; @@ -351,7 +351,7 @@ describe('Health', () => { }); test('test method getTime()', async () => { - const data = { + const data = { 'remoteTime': 1639490751, 'localTime': 1639490844, 'diff': 93,}; diff --git a/test/services/locale.test.js b/test/services/locale.test.js index 4667641d..51ef111e 100644 --- a/test/services/locale.test.js +++ b/test/services/locale.test.js @@ -11,7 +11,7 @@ describe('Locale', () => { test('test method get()', async () => { - const data = { + const data = { 'ip': '127.0.0.1', 'countryCode': 'US', 'country': 'United States', @@ -31,7 +31,7 @@ describe('Locale', () => { }); test('test method listCodes()', async () => { - const data = { + const data = { 'total': 5, 'localeCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -46,7 +46,7 @@ describe('Locale', () => { }); test('test method listContinents()', async () => { - const data = { + const data = { 'total': 5, 'continents': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -61,7 +61,7 @@ describe('Locale', () => { }); test('test method listCountries()', async () => { - const data = { + const data = { 'total': 5, 'countries': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -76,7 +76,7 @@ describe('Locale', () => { }); test('test method listCountriesEU()', async () => { - const data = { + const data = { 'total': 5, 'countries': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -91,7 +91,7 @@ describe('Locale', () => { }); test('test method listCountriesPhones()', async () => { - const data = { + const data = { 'total': 5, 'phones': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -106,7 +106,7 @@ describe('Locale', () => { }); test('test method listCurrencies()', async () => { - const data = { + const data = { 'total': 5, 'currencies': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -121,7 +121,7 @@ describe('Locale', () => { }); test('test method listLanguages()', async () => { - const data = { + const data = { 'total': 5, 'languages': [],}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/messaging.test.js b/test/services/messaging.test.js index 40931583..f327a32d 100644 --- a/test/services/messaging.test.js +++ b/test/services/messaging.test.js @@ -11,7 +11,7 @@ describe('Messaging', () => { test('test method listMessages()', async () => { - const data = { + const data = { 'total': 5, 'messages': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Messaging', () => { }); test('test method createEmail()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -52,7 +52,7 @@ describe('Messaging', () => { }); test('test method updateEmail()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -76,7 +76,7 @@ describe('Messaging', () => { }); test('test method createPush()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -100,7 +100,7 @@ describe('Messaging', () => { }); test('test method updatePush()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -124,7 +124,7 @@ describe('Messaging', () => { }); test('test method createSms()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -149,7 +149,7 @@ describe('Messaging', () => { }); test('test method createSMS()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -174,7 +174,7 @@ describe('Messaging', () => { }); test('test method updateSms()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -198,7 +198,7 @@ describe('Messaging', () => { }); test('test method updateSMS()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -222,7 +222,7 @@ describe('Messaging', () => { }); test('test method getMessage()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -246,7 +246,7 @@ describe('Messaging', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await messaging.delete( @@ -260,7 +260,7 @@ describe('Messaging', () => { }); test('test method listMessageLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -276,7 +276,7 @@ describe('Messaging', () => { }); test('test method listTargets()', async () => { - const data = { + const data = { 'total': 5, 'targets': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -292,7 +292,7 @@ describe('Messaging', () => { }); test('test method listProviders()', async () => { - const data = { + const data = { 'total': 5, 'providers': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -307,7 +307,7 @@ describe('Messaging', () => { }); test('test method createApnsProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -330,7 +330,7 @@ describe('Messaging', () => { }); test('test method createAPNSProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -353,7 +353,7 @@ describe('Messaging', () => { }); test('test method updateApnsProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -375,7 +375,7 @@ describe('Messaging', () => { }); test('test method updateAPNSProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -397,7 +397,7 @@ describe('Messaging', () => { }); test('test method createFcmProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -420,7 +420,7 @@ describe('Messaging', () => { }); test('test method createFCMProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -443,7 +443,7 @@ describe('Messaging', () => { }); test('test method updateFcmProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -465,7 +465,7 @@ describe('Messaging', () => { }); test('test method updateFCMProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -487,7 +487,7 @@ describe('Messaging', () => { }); test('test method createMailgunProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -510,7 +510,7 @@ describe('Messaging', () => { }); test('test method updateMailgunProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -532,7 +532,7 @@ describe('Messaging', () => { }); test('test method createMsg91Provider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -555,7 +555,7 @@ describe('Messaging', () => { }); test('test method updateMsg91Provider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -577,7 +577,7 @@ describe('Messaging', () => { }); test('test method createResendProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -600,7 +600,7 @@ describe('Messaging', () => { }); test('test method updateResendProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -622,7 +622,7 @@ describe('Messaging', () => { }); test('test method createSendgridProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -645,7 +645,7 @@ describe('Messaging', () => { }); test('test method updateSendgridProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -667,7 +667,7 @@ describe('Messaging', () => { }); test('test method createSmtpProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -691,7 +691,7 @@ describe('Messaging', () => { }); test('test method createSMTPProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -715,7 +715,7 @@ describe('Messaging', () => { }); test('test method updateSmtpProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -737,7 +737,7 @@ describe('Messaging', () => { }); test('test method updateSMTPProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -759,7 +759,7 @@ describe('Messaging', () => { }); test('test method createTelesignProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -782,7 +782,7 @@ describe('Messaging', () => { }); test('test method updateTelesignProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -804,7 +804,7 @@ describe('Messaging', () => { }); test('test method createTextmagicProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -827,7 +827,7 @@ describe('Messaging', () => { }); test('test method updateTextmagicProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -849,7 +849,7 @@ describe('Messaging', () => { }); test('test method createTwilioProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -872,7 +872,7 @@ describe('Messaging', () => { }); test('test method updateTwilioProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -894,7 +894,7 @@ describe('Messaging', () => { }); test('test method createVonageProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -917,7 +917,7 @@ describe('Messaging', () => { }); test('test method updateVonageProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -939,7 +939,7 @@ describe('Messaging', () => { }); test('test method getProvider()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -961,7 +961,7 @@ describe('Messaging', () => { }); test('test method deleteProvider()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await messaging.deleteProvider( @@ -975,7 +975,7 @@ describe('Messaging', () => { }); test('test method listProviderLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -991,7 +991,7 @@ describe('Messaging', () => { }); test('test method listSubscriberLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1007,7 +1007,7 @@ describe('Messaging', () => { }); test('test method listTopics()', async () => { - const data = { + const data = { 'total': 5, 'topics': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1022,7 +1022,7 @@ describe('Messaging', () => { }); test('test method createTopic()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1045,7 +1045,7 @@ describe('Messaging', () => { }); test('test method getTopic()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1067,7 +1067,7 @@ describe('Messaging', () => { }); test('test method updateTopic()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1089,7 +1089,7 @@ describe('Messaging', () => { }); test('test method deleteTopic()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await messaging.deleteTopic( @@ -1103,7 +1103,7 @@ describe('Messaging', () => { }); test('test method listTopicLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1119,7 +1119,7 @@ describe('Messaging', () => { }); test('test method listSubscribers()', async () => { - const data = { + const data = { 'total': 5, 'subscribers': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1135,7 +1135,7 @@ describe('Messaging', () => { }); test('test method createSubscriber()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1160,7 +1160,7 @@ describe('Messaging', () => { }); test('test method getSubscriber()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1184,7 +1184,7 @@ describe('Messaging', () => { }); test('test method deleteSubscriber()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await messaging.deleteSubscriber( diff --git a/test/services/project.test.js b/test/services/project.test.js index 6e273b69..05131b5b 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -11,7 +11,7 @@ describe('Project', () => { test('test method listKeys()', async () => { - const data = { + const data = { 'total': 5, 'keys': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Project', () => { }); test('test method createKey()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -51,7 +51,7 @@ describe('Project', () => { }); test('test method getKey()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -74,7 +74,7 @@ describe('Project', () => { }); test('test method updateKey()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -99,7 +99,7 @@ describe('Project', () => { }); test('test method deleteKey()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.deleteKey( @@ -113,7 +113,7 @@ describe('Project', () => { }); test('test method updateLabels()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -205,7 +205,7 @@ describe('Project', () => { }); test('test method listPlatforms()', async () => { - const data = { + const data = { 'total': 5, 'platforms': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -220,7 +220,7 @@ describe('Project', () => { }); test('test method createAndroidPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -242,7 +242,7 @@ describe('Project', () => { }); test('test method updateAndroidPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -264,7 +264,7 @@ describe('Project', () => { }); test('test method createApplePlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -286,7 +286,7 @@ describe('Project', () => { }); test('test method updateApplePlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -308,7 +308,7 @@ describe('Project', () => { }); test('test method createLinuxPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -330,7 +330,7 @@ describe('Project', () => { }); test('test method updateLinuxPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -352,7 +352,7 @@ describe('Project', () => { }); test('test method createWebPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -374,7 +374,7 @@ describe('Project', () => { }); test('test method updateWebPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -396,7 +396,7 @@ describe('Project', () => { }); test('test method createWindowsPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -418,7 +418,7 @@ describe('Project', () => { }); test('test method updateWindowsPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -440,13 +440,13 @@ describe('Project', () => { }); test('test method getPlatform()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'My Web App', 'type': 'web', - 'hostname': 'app.example.com',}; + 'packageName': 'com.company.appname',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.getPlatform( @@ -460,7 +460,7 @@ describe('Project', () => { }); test('test method deletePlatform()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.deletePlatform( @@ -474,7 +474,7 @@ describe('Project', () => { }); test('test method updateProtocolStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -567,7 +567,7 @@ describe('Project', () => { }); test('test method updateServiceStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -660,7 +660,7 @@ describe('Project', () => { }); test('test method listVariables()', async () => { - const data = { + const data = { 'total': 5, 'variables': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -675,7 +675,7 @@ describe('Project', () => { }); test('test method createVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -699,7 +699,7 @@ describe('Project', () => { }); test('test method getVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -721,7 +721,7 @@ describe('Project', () => { }); test('test method updateVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -743,7 +743,7 @@ describe('Project', () => { }); test('test method deleteVariable()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.deleteVariable( diff --git a/test/services/sites.test.js b/test/services/sites.test.js index 75f88054..f12fb315 100644 --- a/test/services/sites.test.js +++ b/test/services/sites.test.js @@ -11,7 +11,7 @@ describe('Sites', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'sites': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Sites', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -75,7 +75,7 @@ describe('Sites', () => { }); test('test method listFrameworks()', async () => { - const data = { + const data = { 'total': 5, 'frameworks': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -90,7 +90,7 @@ describe('Sites', () => { }); test('test method listSpecifications()', async () => { - const data = { + const data = { 'total': 5, 'specifications': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -105,7 +105,7 @@ describe('Sites', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -151,7 +151,7 @@ describe('Sites', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -199,7 +199,7 @@ describe('Sites', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await sites.delete( @@ -213,7 +213,7 @@ describe('Sites', () => { }); test('test method updateSiteDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -260,7 +260,7 @@ describe('Sites', () => { }); test('test method listDeployments()', async () => { - const data = { + const data = { 'total': 5, 'deployments': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -276,7 +276,7 @@ describe('Sites', () => { }); test('test method createDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -318,7 +318,7 @@ describe('Sites', () => { }); test('test method createDuplicateDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -360,7 +360,7 @@ describe('Sites', () => { }); test('test method createTemplateDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -406,7 +406,7 @@ describe('Sites', () => { }); test('test method createVcsDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -449,7 +449,7 @@ describe('Sites', () => { }); test('test method getDeployment()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -491,7 +491,7 @@ describe('Sites', () => { }); test('test method deleteDeployment()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await sites.deleteDeployment( @@ -521,7 +521,7 @@ describe('Sites', () => { }); test('test method updateDeploymentStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -563,7 +563,7 @@ describe('Sites', () => { }); test('test method listLogs()', async () => { - const data = { + const data = { 'total': 5, 'executions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -579,7 +579,7 @@ describe('Sites', () => { }); test('test method getLog()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -611,7 +611,7 @@ describe('Sites', () => { }); test('test method deleteLog()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await sites.deleteLog( @@ -626,7 +626,7 @@ describe('Sites', () => { }); test('test method listVariables()', async () => { - const data = { + const data = { 'total': 5, 'variables': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -642,7 +642,7 @@ describe('Sites', () => { }); test('test method createVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -666,7 +666,7 @@ describe('Sites', () => { }); test('test method getVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -689,7 +689,7 @@ describe('Sites', () => { }); test('test method updateVariable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -713,7 +713,7 @@ describe('Sites', () => { }); test('test method deleteVariable()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await sites.deleteVariable( diff --git a/test/services/storage.test.js b/test/services/storage.test.js index 43f5d0c7..22ab1799 100644 --- a/test/services/storage.test.js +++ b/test/services/storage.test.js @@ -11,7 +11,7 @@ describe('Storage', () => { test('test method listBuckets()', async () => { - const data = { + const data = { 'total': 5, 'buckets': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Storage', () => { }); test('test method createBucket()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -55,7 +55,7 @@ describe('Storage', () => { }); test('test method getBucket()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -83,7 +83,7 @@ describe('Storage', () => { }); test('test method updateBucket()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -112,7 +112,7 @@ describe('Storage', () => { }); test('test method deleteBucket()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await storage.deleteBucket( @@ -126,7 +126,7 @@ describe('Storage', () => { }); test('test method listFiles()', async () => { - const data = { + const data = { 'total': 5, 'files': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -142,7 +142,7 @@ describe('Storage', () => { }); test('test method createFile()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'bucketId': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -171,7 +171,7 @@ describe('Storage', () => { }); test('test method getFile()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'bucketId': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -199,7 +199,7 @@ describe('Storage', () => { }); test('test method updateFile()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'bucketId': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -227,7 +227,7 @@ describe('Storage', () => { }); test('test method deleteFile()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await storage.deleteFile( diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 02012d43..53feaac1 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -11,7 +11,7 @@ describe('TablesDB', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'databases': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('TablesDB', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -49,7 +49,7 @@ describe('TablesDB', () => { }); test('test method listTransactions()', async () => { - const data = { + const data = { 'total': 5, 'transactions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -64,7 +64,7 @@ describe('TablesDB', () => { }); test('test method createTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -83,7 +83,7 @@ describe('TablesDB', () => { }); test('test method getTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -103,7 +103,7 @@ describe('TablesDB', () => { }); test('test method updateTransaction()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -123,7 +123,7 @@ describe('TablesDB', () => { }); test('test method deleteTransaction()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.deleteTransaction( @@ -137,7 +137,7 @@ describe('TablesDB', () => { }); test('test method createOperations()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -157,7 +157,7 @@ describe('TablesDB', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -179,7 +179,7 @@ describe('TablesDB', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', 'name': 'My Database', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -201,7 +201,7 @@ describe('TablesDB', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.delete( @@ -215,7 +215,7 @@ describe('TablesDB', () => { }); test('test method listTables()', async () => { - const data = { + const data = { 'total': 5, 'tables': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -231,7 +231,7 @@ describe('TablesDB', () => { }); test('test method createTable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -259,7 +259,7 @@ describe('TablesDB', () => { }); test('test method getTable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -286,7 +286,7 @@ describe('TablesDB', () => { }); test('test method updateTable()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -313,7 +313,7 @@ describe('TablesDB', () => { }); test('test method deleteTable()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.deleteTable( @@ -328,7 +328,7 @@ describe('TablesDB', () => { }); test('test method listColumns()', async () => { - const data = { + const data = { 'total': 5, 'columns': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -345,7 +345,7 @@ describe('TablesDB', () => { }); test('test method createBooleanColumn()', async () => { - const data = { + const data = { 'key': 'isEnabled', 'type': 'boolean', 'status': 'available', @@ -369,7 +369,7 @@ describe('TablesDB', () => { }); test('test method updateBooleanColumn()', async () => { - const data = { + const data = { 'key': 'isEnabled', 'type': 'boolean', 'status': 'available', @@ -394,7 +394,7 @@ describe('TablesDB', () => { }); test('test method createDatetimeColumn()', async () => { - const data = { + const data = { 'key': 'birthDay', 'type': 'datetime', 'status': 'available', @@ -419,7 +419,7 @@ describe('TablesDB', () => { }); test('test method updateDatetimeColumn()', async () => { - const data = { + const data = { 'key': 'birthDay', 'type': 'datetime', 'status': 'available', @@ -445,7 +445,7 @@ describe('TablesDB', () => { }); test('test method createEmailColumn()', async () => { - const data = { + const data = { 'key': 'userEmail', 'type': 'string', 'status': 'available', @@ -470,7 +470,7 @@ describe('TablesDB', () => { }); test('test method updateEmailColumn()', async () => { - const data = { + const data = { 'key': 'userEmail', 'type': 'string', 'status': 'available', @@ -496,7 +496,7 @@ describe('TablesDB', () => { }); test('test method createEnumColumn()', async () => { - const data = { + const data = { 'key': 'status', 'type': 'string', 'status': 'available', @@ -523,7 +523,7 @@ describe('TablesDB', () => { }); test('test method updateEnumColumn()', async () => { - const data = { + const data = { 'key': 'status', 'type': 'string', 'status': 'available', @@ -551,7 +551,7 @@ describe('TablesDB', () => { }); test('test method createFloatColumn()', async () => { - const data = { + const data = { 'key': 'percentageCompleted', 'type': 'double', 'status': 'available', @@ -575,7 +575,7 @@ describe('TablesDB', () => { }); test('test method updateFloatColumn()', async () => { - const data = { + const data = { 'key': 'percentageCompleted', 'type': 'double', 'status': 'available', @@ -600,7 +600,7 @@ describe('TablesDB', () => { }); test('test method createIntegerColumn()', async () => { - const data = { + const data = { 'key': 'count', 'type': 'integer', 'status': 'available', @@ -624,7 +624,7 @@ describe('TablesDB', () => { }); test('test method updateIntegerColumn()', async () => { - const data = { + const data = { 'key': 'count', 'type': 'integer', 'status': 'available', @@ -649,7 +649,7 @@ describe('TablesDB', () => { }); test('test method createIpColumn()', async () => { - const data = { + const data = { 'key': 'ipAddress', 'type': 'string', 'status': 'available', @@ -674,7 +674,7 @@ describe('TablesDB', () => { }); test('test method updateIpColumn()', async () => { - const data = { + const data = { 'key': 'ipAddress', 'type': 'string', 'status': 'available', @@ -700,7 +700,7 @@ describe('TablesDB', () => { }); test('test method createLineColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -724,7 +724,7 @@ describe('TablesDB', () => { }); test('test method updateLineColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -748,7 +748,7 @@ describe('TablesDB', () => { }); test('test method createLongtextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -772,7 +772,7 @@ describe('TablesDB', () => { }); test('test method updateLongtextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -797,7 +797,7 @@ describe('TablesDB', () => { }); test('test method createMediumtextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -821,7 +821,7 @@ describe('TablesDB', () => { }); test('test method updateMediumtextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -846,7 +846,7 @@ describe('TablesDB', () => { }); test('test method createPointColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -870,7 +870,7 @@ describe('TablesDB', () => { }); test('test method updatePointColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -894,7 +894,7 @@ describe('TablesDB', () => { }); test('test method createPolygonColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -918,7 +918,7 @@ describe('TablesDB', () => { }); test('test method updatePolygonColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -942,7 +942,7 @@ describe('TablesDB', () => { }); test('test method createRelationshipColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -972,7 +972,7 @@ describe('TablesDB', () => { }); test('test method createStringColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -998,7 +998,7 @@ describe('TablesDB', () => { }); test('test method updateStringColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1024,7 +1024,7 @@ describe('TablesDB', () => { }); test('test method createTextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1048,7 +1048,7 @@ describe('TablesDB', () => { }); test('test method updateTextColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1073,7 +1073,7 @@ describe('TablesDB', () => { }); test('test method createUrlColumn()', async () => { - const data = { + const data = { 'key': 'githubUrl', 'type': 'string', 'status': 'available', @@ -1098,7 +1098,7 @@ describe('TablesDB', () => { }); test('test method updateUrlColumn()', async () => { - const data = { + const data = { 'key': 'githubUrl', 'type': 'string', 'status': 'available', @@ -1124,7 +1124,7 @@ describe('TablesDB', () => { }); test('test method createVarcharColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1150,7 +1150,7 @@ describe('TablesDB', () => { }); test('test method updateVarcharColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1176,14 +1176,15 @@ describe('TablesDB', () => { }); test('test method getColumn()', async () => { - const data = { - 'key': 'isEnabled', - 'type': 'boolean', + const data = { + 'key': 'fullName', + 'type': 'string', 'status': 'available', 'error': 'string', 'required': true, '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'size': 128,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.getColumn( @@ -1199,7 +1200,7 @@ describe('TablesDB', () => { }); test('test method deleteColumn()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.deleteColumn( @@ -1215,7 +1216,7 @@ describe('TablesDB', () => { }); test('test method updateRelationshipColumn()', async () => { - const data = { + const data = { 'key': 'fullName', 'type': 'string', 'status': 'available', @@ -1244,7 +1245,7 @@ describe('TablesDB', () => { }); test('test method listIndexes()', async () => { - const data = { + const data = { 'total': 5, 'indexes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1261,7 +1262,7 @@ describe('TablesDB', () => { }); test('test method createIndex()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1288,7 +1289,7 @@ describe('TablesDB', () => { }); test('test method getIndex()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1313,7 +1314,7 @@ describe('TablesDB', () => { }); test('test method deleteIndex()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.deleteIndex( @@ -1329,7 +1330,7 @@ describe('TablesDB', () => { }); test('test method listRows()', async () => { - const data = { + const data = { 'total': 5, 'rows': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1346,7 +1347,7 @@ describe('TablesDB', () => { }); test('test method createRow()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', @@ -1370,7 +1371,7 @@ describe('TablesDB', () => { }); test('test method createRows()', async () => { - const data = { + const data = { 'total': 5, 'rows': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1388,7 +1389,7 @@ describe('TablesDB', () => { }); test('test method upsertRows()', async () => { - const data = { + const data = { 'total': 5, 'rows': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1406,7 +1407,7 @@ describe('TablesDB', () => { }); test('test method updateRows()', async () => { - const data = { + const data = { 'total': 5, 'rows': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1423,7 +1424,7 @@ describe('TablesDB', () => { }); test('test method deleteRows()', async () => { - const data = { + const data = { 'total': 5, 'rows': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1440,7 +1441,7 @@ describe('TablesDB', () => { }); test('test method getRow()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', @@ -1463,7 +1464,7 @@ describe('TablesDB', () => { }); test('test method upsertRow()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', @@ -1486,7 +1487,7 @@ describe('TablesDB', () => { }); test('test method updateRow()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', @@ -1509,7 +1510,7 @@ describe('TablesDB', () => { }); test('test method deleteRow()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.deleteRow( @@ -1525,7 +1526,7 @@ describe('TablesDB', () => { }); test('test method decrementRowColumn()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', @@ -1549,7 +1550,7 @@ describe('TablesDB', () => { }); test('test method incrementRowColumn()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$sequence': '1', '\$tableId': '5e5ea5c15117e', diff --git a/test/services/teams.test.js b/test/services/teams.test.js index df5c9ac1..16a38279 100644 --- a/test/services/teams.test.js +++ b/test/services/teams.test.js @@ -11,7 +11,7 @@ describe('Teams', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'teams': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Teams', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -47,7 +47,7 @@ describe('Teams', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -67,7 +67,7 @@ describe('Teams', () => { }); test('test method updateName()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -88,7 +88,7 @@ describe('Teams', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await teams.delete( @@ -102,7 +102,7 @@ describe('Teams', () => { }); test('test method listMemberships()', async () => { - const data = { + const data = { 'total': 5, 'memberships': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -118,7 +118,7 @@ describe('Teams', () => { }); test('test method createMembership()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -146,7 +146,7 @@ describe('Teams', () => { }); test('test method getMembership()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -174,7 +174,7 @@ describe('Teams', () => { }); test('test method updateMembership()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -203,7 +203,7 @@ describe('Teams', () => { }); test('test method deleteMembership()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await teams.deleteMembership( @@ -218,7 +218,7 @@ describe('Teams', () => { }); test('test method updateMembershipStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -248,7 +248,7 @@ describe('Teams', () => { }); test('test method getPrefs()', async () => { - const data = {}; + const data = {}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await teams.getPrefs( @@ -262,7 +262,7 @@ describe('Teams', () => { }); test('test method updatePrefs()', async () => { - const data = {}; + const data = {}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await teams.updatePrefs( diff --git a/test/services/tokens.test.js b/test/services/tokens.test.js index b9c14cb4..000f188e 100644 --- a/test/services/tokens.test.js +++ b/test/services/tokens.test.js @@ -11,7 +11,7 @@ describe('Tokens', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'tokens': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -28,7 +28,7 @@ describe('Tokens', () => { }); test('test method createFileToken()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', @@ -50,7 +50,7 @@ describe('Tokens', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', @@ -71,7 +71,7 @@ describe('Tokens', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', @@ -92,7 +92,7 @@ describe('Tokens', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tokens.delete( diff --git a/test/services/users.test.js b/test/services/users.test.js index c01295da..cb5441a2 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -11,7 +11,7 @@ describe('Users', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'users': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Users', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -56,7 +56,7 @@ describe('Users', () => { }); test('test method createArgon2User()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -88,7 +88,7 @@ describe('Users', () => { }); test('test method createBcryptUser()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -120,7 +120,7 @@ describe('Users', () => { }); test('test method listIdentities()', async () => { - const data = { + const data = { 'total': 5, 'identities': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -135,7 +135,7 @@ describe('Users', () => { }); test('test method deleteIdentity()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteIdentity( @@ -149,7 +149,7 @@ describe('Users', () => { }); test('test method createMD5User()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -181,7 +181,7 @@ describe('Users', () => { }); test('test method createPHPassUser()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -213,7 +213,7 @@ describe('Users', () => { }); test('test method createScryptUser()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -250,7 +250,7 @@ describe('Users', () => { }); test('test method createScryptModifiedUser()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -285,7 +285,7 @@ describe('Users', () => { }); test('test method createSHAUser()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -317,7 +317,7 @@ describe('Users', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -347,7 +347,7 @@ describe('Users', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.delete( @@ -361,7 +361,7 @@ describe('Users', () => { }); test('test method updateEmail()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -392,7 +392,7 @@ describe('Users', () => { }); test('test method updateImpersonator()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -423,7 +423,7 @@ describe('Users', () => { }); test('test method createJWT()', async () => { - const data = { + const data = { 'jwt': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -438,7 +438,7 @@ describe('Users', () => { }); test('test method updateLabels()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -469,7 +469,7 @@ describe('Users', () => { }); test('test method listLogs()', async () => { - const data = { + const data = { 'total': 5, 'logs': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -485,7 +485,7 @@ describe('Users', () => { }); test('test method listMemberships()', async () => { - const data = { + const data = { 'total': 5, 'memberships': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -501,7 +501,7 @@ describe('Users', () => { }); test('test method updateMfa()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -532,7 +532,7 @@ describe('Users', () => { }); test('test method updateMFA()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -563,7 +563,7 @@ describe('Users', () => { }); test('test method deleteMfaAuthenticator()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteMfaAuthenticator( @@ -578,7 +578,7 @@ describe('Users', () => { }); test('test method deleteMFAAuthenticator()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteMFAAuthenticator( @@ -593,7 +593,7 @@ describe('Users', () => { }); test('test method listMfaFactors()', async () => { - const data = { + const data = { 'totp': true, 'phone': true, 'email': true, @@ -611,7 +611,7 @@ describe('Users', () => { }); test('test method listMFAFactors()', async () => { - const data = { + const data = { 'totp': true, 'phone': true, 'email': true, @@ -629,7 +629,7 @@ describe('Users', () => { }); test('test method getMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -644,7 +644,7 @@ describe('Users', () => { }); test('test method getMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -659,7 +659,7 @@ describe('Users', () => { }); test('test method updateMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -674,7 +674,7 @@ describe('Users', () => { }); test('test method updateMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -689,7 +689,7 @@ describe('Users', () => { }); test('test method createMfaRecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -704,7 +704,7 @@ describe('Users', () => { }); test('test method createMFARecoveryCodes()', async () => { - const data = { + const data = { 'recoveryCodes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -719,7 +719,7 @@ describe('Users', () => { }); test('test method updateName()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -750,7 +750,7 @@ describe('Users', () => { }); test('test method updatePassword()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -781,7 +781,7 @@ describe('Users', () => { }); test('test method updatePhone()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -812,7 +812,7 @@ describe('Users', () => { }); test('test method getPrefs()', async () => { - const data = {}; + const data = {}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.getPrefs( @@ -826,7 +826,7 @@ describe('Users', () => { }); test('test method updatePrefs()', async () => { - const data = {}; + const data = {}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.updatePrefs( @@ -841,7 +841,7 @@ describe('Users', () => { }); test('test method listSessions()', async () => { - const data = { + const data = { 'total': 5, 'sessions': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -857,7 +857,7 @@ describe('Users', () => { }); test('test method createSession()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -900,7 +900,7 @@ describe('Users', () => { }); test('test method deleteSessions()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteSessions( @@ -914,7 +914,7 @@ describe('Users', () => { }); test('test method deleteSession()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteSession( @@ -929,7 +929,7 @@ describe('Users', () => { }); test('test method updateStatus()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -960,7 +960,7 @@ describe('Users', () => { }); test('test method listTargets()', async () => { - const data = { + const data = { 'total': 5, 'targets': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -976,7 +976,7 @@ describe('Users', () => { }); test('test method createTarget()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1001,7 +1001,7 @@ describe('Users', () => { }); test('test method getTarget()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1024,7 +1024,7 @@ describe('Users', () => { }); test('test method updateTarget()', async () => { - const data = { + const data = { '\$id': '259125845563242502', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1047,7 +1047,7 @@ describe('Users', () => { }); test('test method deleteTarget()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.deleteTarget( @@ -1062,7 +1062,7 @@ describe('Users', () => { }); test('test method createToken()', async () => { - const data = { + const data = { '\$id': 'bb8ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', 'userId': '5e5ea5c168bb8', @@ -1082,7 +1082,7 @@ describe('Users', () => { }); test('test method updateEmailVerification()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -1113,7 +1113,7 @@ describe('Users', () => { }); test('test method updatePhoneVerification()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', diff --git a/test/services/webhooks.test.js b/test/services/webhooks.test.js index d254ef7f..01e7abd3 100644 --- a/test/services/webhooks.test.js +++ b/test/services/webhooks.test.js @@ -11,7 +11,7 @@ describe('Webhooks', () => { test('test method list()', async () => { - const data = { + const data = { 'total': 5, 'webhooks': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -26,7 +26,7 @@ describe('Webhooks', () => { }); test('test method create()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -56,7 +56,7 @@ describe('Webhooks', () => { }); test('test method get()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -83,7 +83,7 @@ describe('Webhooks', () => { }); test('test method update()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', @@ -113,7 +113,7 @@ describe('Webhooks', () => { }); test('test method delete()', async () => { - const data = {message: ""}; + const data = {message: ""}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await webhooks.delete( @@ -127,7 +127,7 @@ describe('Webhooks', () => { }); test('test method updateSecret()', async () => { - const data = { + const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', From 3214b35d1e24d3efb21ddc3ba687a1f2161cd572 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 08:41:59 +0000 Subject: [PATCH 08/18] feat: Node.js SDK update for version 24.1.0 --- CHANGELOG.md | 6 + README.md | 4 +- .../databases/create-big-int-attribute.md | 21 + .../databases/update-big-int-attribute.md | 21 + docs/examples/functions/create-variable.md | 1 + docs/examples/functions/create.md | 2 +- docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/project/create-ephemeral-key.md | 15 + docs/examples/project/create-key.md | 2 +- docs/examples/project/create-mock-phone.md | 15 + docs/examples/project/create-smtp-test.md | 14 + docs/examples/project/delete-mock-phone.md | 14 + docs/examples/project/delete.md | 12 + docs/examples/project/get-email-template.md | 15 + docs/examples/project/get-mock-phone.md | 14 + .../examples/project/get-o-auth-2-provider.md | 14 + docs/examples/project/get-policy.md | 14 + docs/examples/project/list-email-templates.md | 15 + docs/examples/project/list-mock-phones.md | 15 + .../project/list-o-auth-2-providers.md | 15 + docs/examples/project/list-policies.md | 15 + docs/examples/project/update-auth-method.md | 15 + .../examples/project/update-email-template.md | 21 + docs/examples/project/update-key.md | 2 +- .../update-membership-privacy-policy.md | 18 + docs/examples/project/update-mock-phone.md | 15 + .../project/update-o-auth-2-amazon.md | 16 + .../examples/project/update-o-auth-2-apple.md | 18 + .../project/update-o-auth-2-auth-0.md | 17 + .../project/update-o-auth-2-authentik.md | 17 + .../project/update-o-auth-2-autodesk.md | 16 + .../project/update-o-auth-2-bitbucket.md | 16 + .../examples/project/update-o-auth-2-bitly.md | 16 + docs/examples/project/update-o-auth-2-box.md | 16 + .../project/update-o-auth-2-dailymotion.md | 16 + .../project/update-o-auth-2-discord.md | 16 + .../project/update-o-auth-2-disqus.md | 16 + .../project/update-o-auth-2-dropbox.md | 16 + docs/examples/project/update-o-auth-2-etsy.md | 16 + .../project/update-o-auth-2-facebook.md | 16 + .../examples/project/update-o-auth-2-figma.md | 16 + .../project/update-o-auth-2-fusion-auth.md | 17 + .../project/update-o-auth-2-git-hub.md | 16 + .../project/update-o-auth-2-gitlab.md | 17 + .../project/update-o-auth-2-google.md | 16 + .../project/update-o-auth-2-keycloak.md | 18 + docs/examples/project/update-o-auth-2-kick.md | 16 + .../project/update-o-auth-2-linkedin.md | 16 + .../project/update-o-auth-2-microsoft.md | 17 + .../project/update-o-auth-2-notion.md | 16 + docs/examples/project/update-o-auth-2-oidc.md | 20 + docs/examples/project/update-o-auth-2-okta.md | 18 + .../project/update-o-auth-2-paypal-sandbox.md | 16 + .../project/update-o-auth-2-paypal.md | 16 + .../examples/project/update-o-auth-2-podio.md | 16 + .../project/update-o-auth-2-salesforce.md | 16 + .../examples/project/update-o-auth-2-slack.md | 16 + .../project/update-o-auth-2-spotify.md | 16 + .../project/update-o-auth-2-stripe.md | 16 + .../update-o-auth-2-tradeshift-sandbox.md | 16 + .../project/update-o-auth-2-tradeshift.md | 16 + .../project/update-o-auth-2-twitch.md | 16 + .../project/update-o-auth-2-word-press.md | 16 + .../examples/project/update-o-auth-2-yahoo.md | 16 + .../project/update-o-auth-2-yandex.md | 16 + docs/examples/project/update-o-auth-2-zoho.md | 16 + docs/examples/project/update-o-auth-2-zoom.md | 16 + docs/examples/project/update-o-auth-2x.md | 16 + .../update-password-dictionary-policy.md | 14 + .../project/update-password-history-policy.md | 14 + .../update-password-personal-data-policy.md | 14 + ...-protocol-status.md => update-protocol.md} | 2 +- ...te-service-status.md => update-service.md} | 2 +- .../project/update-session-alert-policy.md | 14 + .../project/update-session-duration-policy.md | 14 + .../update-session-invalidation-policy.md | 14 + .../project/update-session-limit-policy.md | 14 + docs/examples/project/update-smtp.md | 23 + .../project/update-user-limit-policy.md | 14 + docs/examples/proxy/create-api-rule.md | 14 + docs/examples/proxy/create-function-rule.md | 16 + docs/examples/proxy/create-redirect-rule.md | 18 + docs/examples/proxy/create-site-rule.md | 16 + docs/examples/proxy/delete-rule.md | 14 + docs/examples/proxy/get-rule.md | 14 + docs/examples/proxy/list-rules.md | 15 + docs/examples/proxy/update-rule-status.md | 14 + docs/examples/sites/create-variable.md | 1 + docs/examples/sites/list-variables.md | 4 +- docs/examples/sites/update-variable.md | 2 +- .../tablesdb/create-big-int-column.md | 21 + .../tablesdb/update-big-int-column.md | 21 + package-lock.json | 4 +- package.json | 2 +- src/client.ts | 87 +- src/enums/build-runtime.ts | 1 + src/enums/email-template-locale.ts | 133 + src/enums/email-template-type.ts | 9 + src/enums/method-id.ts | 9 + src/enums/o-auth-provider.ts | 3 + src/enums/policy-id.ts | 11 + src/enums/provider-id.ts | 49 + src/enums/proxy-resource-type.ts | 4 + .../proxy-rule-deployment-resource-type.ts | 4 + src/enums/proxy-rule-status.ts | 5 + src/enums/runtime.ts | 1 + src/enums/scopes.ts | 75 +- src/enums/secure.ts | 4 + src/enums/status-code.ts | 6 + src/index.ts | 11 + src/inputFile.ts | 149 +- src/models.ts | 1608 ++++- src/services/account.ts | 5 +- src/services/activities.ts | 1 + src/services/avatars.ts | 1 + src/services/backups.ts | 1 + src/services/databases.ts | 223 + src/services/functions.ts | 88 +- src/services/graphql.ts | 1 + src/services/health.ts | 1 + src/services/locale.ts | 1 + src/services/messaging.ts | 1 + src/services/project.ts | 5564 +++++++++++++++-- src/services/proxy.ts | 541 ++ src/services/sites.ts | 88 +- src/services/storage.ts | 20 +- src/services/tables-db.ts | 221 + src/services/teams.ts | 1 + src/services/tokens.ts | 1 + src/services/users.ts | 1 + src/services/webhooks.ts | 1 + test/services/databases.test.js | 49 + test/services/functions.test.js | 2 +- test/services/project.test.js | 2312 ++++++- test/services/proxy.test.js | 215 + test/services/sites.test.js | 2 +- test/services/tables-d-b.test.js | 49 + test/services/teams.test.js | 4 + 140 files changed, 12010 insertions(+), 878 deletions(-) create mode 100644 docs/examples/databases/create-big-int-attribute.md create mode 100644 docs/examples/databases/update-big-int-attribute.md create mode 100644 docs/examples/project/create-ephemeral-key.md create mode 100644 docs/examples/project/create-mock-phone.md create mode 100644 docs/examples/project/create-smtp-test.md create mode 100644 docs/examples/project/delete-mock-phone.md create mode 100644 docs/examples/project/delete.md create mode 100644 docs/examples/project/get-email-template.md create mode 100644 docs/examples/project/get-mock-phone.md create mode 100644 docs/examples/project/get-o-auth-2-provider.md create mode 100644 docs/examples/project/get-policy.md create mode 100644 docs/examples/project/list-email-templates.md create mode 100644 docs/examples/project/list-mock-phones.md create mode 100644 docs/examples/project/list-o-auth-2-providers.md create mode 100644 docs/examples/project/list-policies.md create mode 100644 docs/examples/project/update-auth-method.md create mode 100644 docs/examples/project/update-email-template.md create mode 100644 docs/examples/project/update-membership-privacy-policy.md create mode 100644 docs/examples/project/update-mock-phone.md create mode 100644 docs/examples/project/update-o-auth-2-amazon.md create mode 100644 docs/examples/project/update-o-auth-2-apple.md create mode 100644 docs/examples/project/update-o-auth-2-auth-0.md create mode 100644 docs/examples/project/update-o-auth-2-authentik.md create mode 100644 docs/examples/project/update-o-auth-2-autodesk.md create mode 100644 docs/examples/project/update-o-auth-2-bitbucket.md create mode 100644 docs/examples/project/update-o-auth-2-bitly.md create mode 100644 docs/examples/project/update-o-auth-2-box.md create mode 100644 docs/examples/project/update-o-auth-2-dailymotion.md create mode 100644 docs/examples/project/update-o-auth-2-discord.md create mode 100644 docs/examples/project/update-o-auth-2-disqus.md create mode 100644 docs/examples/project/update-o-auth-2-dropbox.md create mode 100644 docs/examples/project/update-o-auth-2-etsy.md create mode 100644 docs/examples/project/update-o-auth-2-facebook.md create mode 100644 docs/examples/project/update-o-auth-2-figma.md create mode 100644 docs/examples/project/update-o-auth-2-fusion-auth.md create mode 100644 docs/examples/project/update-o-auth-2-git-hub.md create mode 100644 docs/examples/project/update-o-auth-2-gitlab.md create mode 100644 docs/examples/project/update-o-auth-2-google.md create mode 100644 docs/examples/project/update-o-auth-2-keycloak.md create mode 100644 docs/examples/project/update-o-auth-2-kick.md create mode 100644 docs/examples/project/update-o-auth-2-linkedin.md create mode 100644 docs/examples/project/update-o-auth-2-microsoft.md create mode 100644 docs/examples/project/update-o-auth-2-notion.md create mode 100644 docs/examples/project/update-o-auth-2-oidc.md create mode 100644 docs/examples/project/update-o-auth-2-okta.md create mode 100644 docs/examples/project/update-o-auth-2-paypal-sandbox.md create mode 100644 docs/examples/project/update-o-auth-2-paypal.md create mode 100644 docs/examples/project/update-o-auth-2-podio.md create mode 100644 docs/examples/project/update-o-auth-2-salesforce.md create mode 100644 docs/examples/project/update-o-auth-2-slack.md create mode 100644 docs/examples/project/update-o-auth-2-spotify.md create mode 100644 docs/examples/project/update-o-auth-2-stripe.md create mode 100644 docs/examples/project/update-o-auth-2-tradeshift-sandbox.md create mode 100644 docs/examples/project/update-o-auth-2-tradeshift.md create mode 100644 docs/examples/project/update-o-auth-2-twitch.md create mode 100644 docs/examples/project/update-o-auth-2-word-press.md create mode 100644 docs/examples/project/update-o-auth-2-yahoo.md create mode 100644 docs/examples/project/update-o-auth-2-yandex.md create mode 100644 docs/examples/project/update-o-auth-2-zoho.md create mode 100644 docs/examples/project/update-o-auth-2-zoom.md create mode 100644 docs/examples/project/update-o-auth-2x.md create mode 100644 docs/examples/project/update-password-dictionary-policy.md create mode 100644 docs/examples/project/update-password-history-policy.md create mode 100644 docs/examples/project/update-password-personal-data-policy.md rename docs/examples/project/{update-protocol-status.md => update-protocol.md} (87%) rename docs/examples/project/{update-service-status.md => update-service.md} (88%) create mode 100644 docs/examples/project/update-session-alert-policy.md create mode 100644 docs/examples/project/update-session-duration-policy.md create mode 100644 docs/examples/project/update-session-invalidation-policy.md create mode 100644 docs/examples/project/update-session-limit-policy.md create mode 100644 docs/examples/project/update-smtp.md create mode 100644 docs/examples/project/update-user-limit-policy.md create mode 100644 docs/examples/proxy/create-api-rule.md create mode 100644 docs/examples/proxy/create-function-rule.md create mode 100644 docs/examples/proxy/create-redirect-rule.md create mode 100644 docs/examples/proxy/create-site-rule.md create mode 100644 docs/examples/proxy/delete-rule.md create mode 100644 docs/examples/proxy/get-rule.md create mode 100644 docs/examples/proxy/list-rules.md create mode 100644 docs/examples/proxy/update-rule-status.md create mode 100644 docs/examples/tablesdb/create-big-int-column.md create mode 100644 docs/examples/tablesdb/update-big-int-column.md create mode 100644 src/enums/email-template-locale.ts create mode 100644 src/enums/email-template-type.ts create mode 100644 src/enums/method-id.ts create mode 100644 src/enums/policy-id.ts create mode 100644 src/enums/provider-id.ts create mode 100644 src/enums/proxy-resource-type.ts create mode 100644 src/enums/proxy-rule-deployment-resource-type.ts create mode 100644 src/enums/proxy-rule-status.ts create mode 100644 src/enums/secure.ts create mode 100644 src/enums/status-code.ts create mode 100644 src/services/proxy.ts create mode 100644 test/services/proxy.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f3e163e..078bc7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 24.1.0 + +* Added: Introduced `bigint` create/update APIs for legacy Databases attributes +* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` + ## 24.0.0 * [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` diff --git a/README.md b/README.md index d959a06b..4bed7d85 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md new file mode 100644 index 00000000..4aa7ddff --- /dev/null +++ b/docs/examples/databases/create-big-int-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createBigIntAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md new file mode 100644 index 00000000..75bbe092 --- /dev/null +++ b/docs/examples/databases/update-big-int-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateBigIntAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 0d8dcfaa..21246bbe 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -10,6 +10,7 @@ const functions = new sdk.Functions(client); const result = await functions.createVariable({ functionId: '', + variableId: '', key: '', value: '', secret: false // optional diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index b0004d85..4e3d5e95 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -20,7 +20,7 @@ const result = await functions.create({ logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [sdk.Scopes.SessionsWrite], // optional + scopes: [sdk.Scopes.ProjectRead], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 166effad..d09e5d05 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -9,6 +9,8 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); const result = await functions.listVariables({ - functionId: '' + functionId: '', + queries: [], // optional + total: false // optional }); ``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index abd2dad5..e0bdec98 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -11,7 +11,7 @@ const functions = new sdk.Functions(client); const result = await functions.updateVariable({ functionId: '', variableId: '', - key: '', + key: '', // optional value: '', // optional secret: false // optional }); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 915037ff..fe60cad3 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -20,7 +20,7 @@ const result = await functions.update({ logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [sdk.Scopes.SessionsWrite], // optional + scopes: [sdk.Scopes.ProjectRead], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md new file mode 100644 index 00000000..31d21013 --- /dev/null +++ b/docs/examples/project/create-ephemeral-key.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createEphemeralKey({ + scopes: [sdk.Scopes.ProjectRead], + duration: 600 +}); +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md index b5274bfc..03ba6271 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/create-key.md @@ -11,7 +11,7 @@ const project = new sdk.Project(client); const result = await project.createKey({ keyId: '', name: '', - scopes: [sdk.Scopes.SessionsWrite], + scopes: [sdk.Scopes.ProjectRead], expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md new file mode 100644 index 00000000..6bb2962c --- /dev/null +++ b/docs/examples/project/create-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createMockPhone({ + number: '+12065550100', + otp: '' +}); +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md new file mode 100644 index 00000000..708daf85 --- /dev/null +++ b/docs/examples/project/create-smtp-test.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createSMTPTest({ + emails: [] +}); +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md new file mode 100644 index 00000000..94d341a7 --- /dev/null +++ b/docs/examples/project/delete-mock-phone.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteMockPhone({ + number: '+12065550100' +}); +``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md new file mode 100644 index 00000000..150939ed --- /dev/null +++ b/docs/examples/project/delete.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.delete(); +``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md new file mode 100644 index 00000000..06b062f0 --- /dev/null +++ b/docs/examples/project/get-email-template.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getEmailTemplate({ + templateId: sdk.EmailTemplateType.Verification, + locale: sdk.EmailTemplateLocale.Af // optional +}); +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md new file mode 100644 index 00000000..73082c43 --- /dev/null +++ b/docs/examples/project/get-mock-phone.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getMockPhone({ + number: '+12065550100' +}); +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md new file mode 100644 index 00000000..a6df0d67 --- /dev/null +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getOAuth2Provider({ + providerId: sdk.ProviderId.Amazon +}); +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md new file mode 100644 index 00000000..df5abb54 --- /dev/null +++ b/docs/examples/project/get-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getPolicy({ + policyId: sdk.PolicyId.PasswordDictionary +}); +``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md new file mode 100644 index 00000000..34bc7778 --- /dev/null +++ b/docs/examples/project/list-email-templates.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listEmailTemplates({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md new file mode 100644 index 00000000..0816b18a --- /dev/null +++ b/docs/examples/project/list-mock-phones.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listMockPhones({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md new file mode 100644 index 00000000..244767d3 --- /dev/null +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listOAuth2Providers({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md new file mode 100644 index 00000000..f7b6260f --- /dev/null +++ b/docs/examples/project/list-policies.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listPolicies({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md new file mode 100644 index 00000000..d6b2c6ca --- /dev/null +++ b/docs/examples/project/update-auth-method.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateAuthMethod({ + methodId: sdk.MethodId.EmailPassword, + enabled: false +}); +``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md new file mode 100644 index 00000000..67e0fac9 --- /dev/null +++ b/docs/examples/project/update-email-template.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateEmailTemplate({ + templateId: sdk.EmailTemplateType.Verification, + locale: sdk.EmailTemplateLocale.Af, // optional + subject: '', // optional + message: '', // optional + senderName: '', // optional + senderEmail: 'email@example.com', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '' // optional +}); +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index ad191f88..488fae13 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -11,7 +11,7 @@ const project = new sdk.Project(client); const result = await project.updateKey({ keyId: '', name: '', - scopes: [sdk.Scopes.SessionsWrite], + scopes: [sdk.Scopes.ProjectRead], expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md new file mode 100644 index 00000000..66eff9f3 --- /dev/null +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateMembershipPrivacyPolicy({ + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false // optional +}); +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md new file mode 100644 index 00000000..a0c70abc --- /dev/null +++ b/docs/examples/project/update-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateMockPhone({ + number: '+12065550100', + otp: '' +}); +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 00000000..12a535ff --- /dev/null +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Amazon({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md new file mode 100644 index 00000000..ae985a4a --- /dev/null +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Apple({ + serviceId: '', // optional + keyId: '', // optional + teamId: '', // optional + p8File: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 00000000..37bf4a56 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Auth0({ + clientId: '', // optional + clientSecret: '', // optional + endpoint: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 00000000..e500466b --- /dev/null +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Authentik({ + clientId: '', // optional + clientSecret: '', // optional + endpoint: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 00000000..0b8aabce --- /dev/null +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Autodesk({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 00000000..d3b5dc7b --- /dev/null +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Bitbucket({ + key: '', // optional + secret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 00000000..feecad27 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Bitly({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md new file mode 100644 index 00000000..c9724638 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-box.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Box({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 00000000..8d176339 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Dailymotion({ + apiKey: '', // optional + apiSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md new file mode 100644 index 00000000..5469509f --- /dev/null +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Discord({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 00000000..c71bebfe --- /dev/null +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Disqus({ + publicKey: '', // optional + secretKey: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 00000000..9f2654dc --- /dev/null +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Dropbox({ + appKey: '', // optional + appSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 00000000..684c4243 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Etsy({ + keyString: '', // optional + sharedSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 00000000..7fca48a6 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Facebook({ + appId: '', // optional + appSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md new file mode 100644 index 00000000..3b805738 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Figma({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 00000000..654991c9 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2FusionAuth({ + clientId: '', // optional + clientSecret: '', // optional + endpoint: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 00000000..cc2be084 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2GitHub({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 00000000..40e1943e --- /dev/null +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Gitlab({ + applicationId: '', // optional + secret: '', // optional + endpoint: 'https://example.com', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md new file mode 100644 index 00000000..dce02e9c --- /dev/null +++ b/docs/examples/project/update-o-auth-2-google.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Google({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 00000000..bce76ee5 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Keycloak({ + clientId: '', // optional + clientSecret: '', // optional + endpoint: '', // optional + realmName: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md new file mode 100644 index 00000000..1d581052 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Kick({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 00000000..02c68d99 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Linkedin({ + clientId: '', // optional + primaryClientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 00000000..cc5a8c27 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Microsoft({ + applicationId: '', // optional + applicationSecret: '', // optional + tenant: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md new file mode 100644 index 00000000..c3297799 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Notion({ + oauthClientId: '', // optional + oauthClientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 00000000..7f1f6eb7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Oidc({ + clientId: '', // optional + clientSecret: '', // optional + wellKnownURL: 'https://example.com', // optional + authorizationURL: 'https://example.com', // optional + tokenURL: 'https://example.com', // optional + userInfoURL: 'https://example.com', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md new file mode 100644 index 00000000..a85c9809 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Okta({ + clientId: '', // optional + clientSecret: '', // optional + domain: '', // optional + authorizationServerId: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 00000000..e6b8de7f --- /dev/null +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2PaypalSandbox({ + clientId: '', // optional + secretKey: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 00000000..8f7162c7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Paypal({ + clientId: '', // optional + secretKey: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md new file mode 100644 index 00000000..3d6c2c44 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Podio({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 00000000..a1937639 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Salesforce({ + customerKey: '', // optional + customerSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md new file mode 100644 index 00000000..6dab9092 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Slack({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 00000000..72ffa64d --- /dev/null +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Spotify({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 00000000..1df015f1 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Stripe({ + clientId: '', // optional + apiSecretKey: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 00000000..df090e92 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2TradeshiftSandbox({ + oauth2ClientId: '', // optional + oauth2ClientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 00000000..afddd8c0 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Tradeshift({ + oauth2ClientId: '', // optional + oauth2ClientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 00000000..ad096ea9 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Twitch({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 00000000..597ccd5b --- /dev/null +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2WordPress({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 00000000..79b3b021 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Yahoo({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 00000000..2f79c448 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Yandex({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 00000000..031a2816 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Zoho({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 00000000..985400b1 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Zoom({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md new file mode 100644 index 00000000..183e2257 --- /dev/null +++ b/docs/examples/project/update-o-auth-2x.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2X({ + customerKey: '', // optional + secretKey: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md new file mode 100644 index 00000000..8b8bdd02 --- /dev/null +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordDictionaryPolicy({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md new file mode 100644 index 00000000..b8ab9d03 --- /dev/null +++ b/docs/examples/project/update-password-history-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordHistoryPolicy({ + total: 1 +}); +``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md new file mode 100644 index 00000000..df490a4a --- /dev/null +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordPersonalDataPolicy({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-protocol-status.md b/docs/examples/project/update-protocol.md similarity index 87% rename from docs/examples/project/update-protocol-status.md rename to docs/examples/project/update-protocol.md index b3da4bf3..06331946 100644 --- a/docs/examples/project/update-protocol-status.md +++ b/docs/examples/project/update-protocol.md @@ -8,7 +8,7 @@ const client = new sdk.Client() const project = new sdk.Project(client); -const result = await project.updateProtocolStatus({ +const result = await project.updateProtocol({ protocolId: sdk.ProtocolId.Rest, enabled: false }); diff --git a/docs/examples/project/update-service-status.md b/docs/examples/project/update-service.md similarity index 88% rename from docs/examples/project/update-service-status.md rename to docs/examples/project/update-service.md index fe9514b4..45cc56d0 100644 --- a/docs/examples/project/update-service-status.md +++ b/docs/examples/project/update-service.md @@ -8,7 +8,7 @@ const client = new sdk.Client() const project = new sdk.Project(client); -const result = await project.updateServiceStatus({ +const result = await project.updateService({ serviceId: sdk.ServiceId.Account, enabled: false }); diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md new file mode 100644 index 00000000..54546084 --- /dev/null +++ b/docs/examples/project/update-session-alert-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionAlertPolicy({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md new file mode 100644 index 00000000..2a4873be --- /dev/null +++ b/docs/examples/project/update-session-duration-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionDurationPolicy({ + duration: 5 +}); +``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md new file mode 100644 index 00000000..a5840bc2 --- /dev/null +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionInvalidationPolicy({ + enabled: false +}); +``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md new file mode 100644 index 00000000..514d77aa --- /dev/null +++ b/docs/examples/project/update-session-limit-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionLimitPolicy({ + total: 1 +}); +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md new file mode 100644 index 00000000..ac001956 --- /dev/null +++ b/docs/examples/project/update-smtp.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSMTP({ + host: '', // optional + port: null, // optional + username: '', // optional + password: '', // optional + senderEmail: 'email@example.com', // optional + senderName: '', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '', // optional + secure: sdk.Secure.Tls, // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md new file mode 100644 index 00000000..bb372042 --- /dev/null +++ b/docs/examples/project/update-user-limit-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateUserLimitPolicy({ + total: 1 +}); +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md new file mode 100644 index 00000000..25fcf691 --- /dev/null +++ b/docs/examples/proxy/create-api-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createAPIRule({ + domain: '' +}); +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md new file mode 100644 index 00000000..cf225f67 --- /dev/null +++ b/docs/examples/proxy/create-function-rule.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createFunctionRule({ + domain: '', + functionId: '', + branch: '' // optional +}); +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md new file mode 100644 index 00000000..0f33abd6 --- /dev/null +++ b/docs/examples/proxy/create-redirect-rule.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createRedirectRule({ + domain: '', + url: 'https://example.com', + statusCode: sdk.StatusCode.MovedPermanently301, + resourceId: '', + resourceType: sdk.ProxyResourceType.Site +}); +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md new file mode 100644 index 00000000..bafbee3d --- /dev/null +++ b/docs/examples/proxy/create-site-rule.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createSiteRule({ + domain: '', + siteId: '', + branch: '' // optional +}); +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md new file mode 100644 index 00000000..2d07a110 --- /dev/null +++ b/docs/examples/proxy/delete-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.deleteRule({ + ruleId: '' +}); +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md new file mode 100644 index 00000000..e89612dc --- /dev/null +++ b/docs/examples/proxy/get-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.getRule({ + ruleId: '' +}); +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md new file mode 100644 index 00000000..b161a085 --- /dev/null +++ b/docs/examples/proxy/list-rules.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.listRules({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md new file mode 100644 index 00000000..9e050fc7 --- /dev/null +++ b/docs/examples/proxy/update-rule-status.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.updateRuleStatus({ + ruleId: '' +}); +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index be07336b..cad7be76 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -10,6 +10,7 @@ const sites = new sdk.Sites(client); const result = await sites.createVariable({ siteId: '', + variableId: '', key: '', value: '', secret: false // optional diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 0451b1eb..26ae3212 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -9,6 +9,8 @@ const client = new sdk.Client() const sites = new sdk.Sites(client); const result = await sites.listVariables({ - siteId: '' + siteId: '', + queries: [], // optional + total: false // optional }); ``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 40a98106..2853a180 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -11,7 +11,7 @@ const sites = new sdk.Sites(client); const result = await sites.updateVariable({ siteId: '', variableId: '', - key: '', + key: '', // optional value: '', // optional secret: false // optional }); diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md new file mode 100644 index 00000000..9c1c01f4 --- /dev/null +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createBigIntColumn({ + databaseId: '', + tableId: '', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md new file mode 100644 index 00000000..87c20e4b --- /dev/null +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateBigIntColumn({ + databaseId: '', + tableId: '', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); +``` diff --git a/package-lock.json b/package-lock.json index 848f3d9c..69c1e71e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "24.0.0", + "version": "24.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "24.0.0", + "version": "24.1.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index bcf42393..24e2e0ca 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "24.0.0", + "version": "24.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index d413d82b..84774c0a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,7 @@ import { fetch, FormData, File } from 'node-fetch-native-with-agent'; import { createAgent } from 'node-fetch-native-with-agent/agent'; import { Models } from './models'; +import { InputFile } from './inputFile'; import JSONbigModule from 'json-bigint'; const JSONbigParser = JSONbigModule({ storeAsString: false }); const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true }); @@ -73,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/24.0.0'; + let ua = 'AppwriteNodeJSSDK/24.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -117,6 +118,8 @@ class Client { locale: '', session: '', forwardeduseragent: '', + devkey: '', + cookie: '', impersonateuserid: '', impersonateuseremail: '', impersonateuserphone: '', @@ -125,9 +128,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '24.0.0', + 'x-sdk-version': '24.1.0', 'user-agent' : getUserAgent(), - 'X-Appwrite-Response-Format': '1.9.1', + 'X-Appwrite-Response-Format': '1.9.4', }; /** @@ -278,6 +281,34 @@ class Client { this.config.forwardeduseragent = value; return this; } + /** + * Set DevKey + * + * Your secret dev API key + * + * @param value string + * + * @return {this} + */ + setDevKey(value: string): this { + this.headers['X-Appwrite-Dev-Key'] = value; + this.config.devkey = value; + return this; + } + /** + * Set Cookie + * + * The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. + * + * @param value string + * + * @return {this} + */ + setCookie(value: string): this { + this.headers['Cookie'] = value; + this.config.cookie = value; + return this; + } /** * Set ImpersonateUserId * @@ -367,12 +398,60 @@ class Client { } async chunkedUpload(method: string, url: URL, headers: Headers = {}, originalPayload: Payload = {}, onProgress: (progress: UploadProgress) => void) { - const [fileParam, file] = Object.entries(originalPayload).find(([_, value]) => value instanceof File) ?? []; + const [fileParam, file] = Object.entries(originalPayload).find( + ([_, value]) => value instanceof File || value instanceof InputFile + ) ?? []; if (!file || !fileParam) { throw new Error('File not found in payload'); } + if (file instanceof InputFile) { + const size = await file.size(); + + if (size <= Client.CHUNK_SIZE) { + const payload = { ...originalPayload }; + payload[fileParam] = await file.toFile(); + return await this.call(method, url, headers, payload); + } + + let start = 0; + let response = null; + + while (start < size) { + let end = start + Client.CHUNK_SIZE; + if (end >= size) { + end = size; + } + + headers['content-range'] = `bytes ${start}-${end - 1}/${size}`; + const chunk = await file.slice(start, end); + + const payload = { ...originalPayload }; + payload[fileParam] = new File([chunk], file.filename); + + response = await this.call(method, url, headers, payload); + + if (onProgress && typeof onProgress === 'function') { + onProgress({ + $id: response.$id, + progress: Math.round((end / size) * 100), + sizeUploaded: end, + chunksTotal: Math.ceil(size / Client.CHUNK_SIZE), + chunksUploaded: Math.ceil(end / Client.CHUNK_SIZE) + }); + } + + if (response && response.$id) { + headers['x-appwrite-id'] = response.$id; + } + + start = end; + } + + return response; + } + if (file.size <= Client.CHUNK_SIZE) { return await this.call(method, url, headers, originalPayload); } diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 6aea9aa5..1466d635 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -79,6 +79,7 @@ export enum BuildRuntime { Go124 = 'go-1.24', Go125 = 'go-1.25', Go126 = 'go-1.26', + Rust183 = 'rust-1.83', Static1 = 'static-1', Flutter324 = 'flutter-3.24', Flutter327 = 'flutter-3.27', diff --git a/src/enums/email-template-locale.ts b/src/enums/email-template-locale.ts new file mode 100644 index 00000000..82656b89 --- /dev/null +++ b/src/enums/email-template-locale.ts @@ -0,0 +1,133 @@ +export enum EmailTemplateLocale { + Af = 'af', + Arae = 'ar-ae', + Arbh = 'ar-bh', + Ardz = 'ar-dz', + Areg = 'ar-eg', + Ariq = 'ar-iq', + Arjo = 'ar-jo', + Arkw = 'ar-kw', + Arlb = 'ar-lb', + Arly = 'ar-ly', + Arma = 'ar-ma', + Arom = 'ar-om', + Arqa = 'ar-qa', + Arsa = 'ar-sa', + Arsy = 'ar-sy', + Artn = 'ar-tn', + Arye = 'ar-ye', + As = 'as', + Az = 'az', + Be = 'be', + Bg = 'bg', + Bh = 'bh', + Bn = 'bn', + Bs = 'bs', + Ca = 'ca', + Cs = 'cs', + Cy = 'cy', + Da = 'da', + De = 'de', + Deat = 'de-at', + Dech = 'de-ch', + Deli = 'de-li', + Delu = 'de-lu', + El = 'el', + En = 'en', + Enau = 'en-au', + Enbz = 'en-bz', + Enca = 'en-ca', + Engb = 'en-gb', + Enie = 'en-ie', + Enjm = 'en-jm', + Ennz = 'en-nz', + Entt = 'en-tt', + Enus = 'en-us', + Enza = 'en-za', + Eo = 'eo', + Es = 'es', + Esar = 'es-ar', + Esbo = 'es-bo', + Escl = 'es-cl', + Esco = 'es-co', + Escr = 'es-cr', + Esdo = 'es-do', + Esec = 'es-ec', + Esgt = 'es-gt', + Eshn = 'es-hn', + Esmx = 'es-mx', + Esni = 'es-ni', + Espa = 'es-pa', + Espe = 'es-pe', + Espr = 'es-pr', + Espy = 'es-py', + Essv = 'es-sv', + Esuy = 'es-uy', + Esve = 'es-ve', + Et = 'et', + Eu = 'eu', + Fa = 'fa', + Fi = 'fi', + Fo = 'fo', + Fr = 'fr', + Frbe = 'fr-be', + Frca = 'fr-ca', + Frch = 'fr-ch', + Frlu = 'fr-lu', + Ga = 'ga', + Gd = 'gd', + He = 'he', + Hi = 'hi', + Hr = 'hr', + Hu = 'hu', + Id = 'id', + Is = 'is', + It = 'it', + Itch = 'it-ch', + Ja = 'ja', + Ji = 'ji', + Ko = 'ko', + Ku = 'ku', + Lt = 'lt', + Lv = 'lv', + Mk = 'mk', + Ml = 'ml', + Ms = 'ms', + Mt = 'mt', + Nb = 'nb', + Ne = 'ne', + Nl = 'nl', + Nlbe = 'nl-be', + Nn = 'nn', + No = 'no', + Pa = 'pa', + Pl = 'pl', + Pt = 'pt', + Ptbr = 'pt-br', + Rm = 'rm', + Ro = 'ro', + Romd = 'ro-md', + Ru = 'ru', + Rumd = 'ru-md', + Sb = 'sb', + Sk = 'sk', + Sl = 'sl', + Sq = 'sq', + Sr = 'sr', + Sv = 'sv', + Svfi = 'sv-fi', + Th = 'th', + Tn = 'tn', + Tr = 'tr', + Ts = 'ts', + Ua = 'ua', + Ur = 'ur', + Ve = 've', + Vi = 'vi', + Xh = 'xh', + Zhcn = 'zh-cn', + Zhhk = 'zh-hk', + Zhsg = 'zh-sg', + Zhtw = 'zh-tw', + Zu = 'zu', +} \ No newline at end of file diff --git a/src/enums/email-template-type.ts b/src/enums/email-template-type.ts new file mode 100644 index 00000000..2a561bf0 --- /dev/null +++ b/src/enums/email-template-type.ts @@ -0,0 +1,9 @@ +export enum EmailTemplateType { + Verification = 'verification', + MagicSession = 'magicSession', + Recovery = 'recovery', + Invitation = 'invitation', + MfaChallenge = 'mfaChallenge', + SessionAlert = 'sessionAlert', + OtpSession = 'otpSession', +} \ No newline at end of file diff --git a/src/enums/method-id.ts b/src/enums/method-id.ts new file mode 100644 index 00000000..062d0d0e --- /dev/null +++ b/src/enums/method-id.ts @@ -0,0 +1,9 @@ +export enum MethodId { + Emailpassword = 'email-password', + Magicurl = 'magic-url', + Emailotp = 'email-otp', + Anonymous = 'anonymous', + Invites = 'invites', + Jwt = 'jwt', + Phone = 'phone', +} \ No newline at end of file diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index efc44844..cc9e340b 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -14,9 +14,12 @@ export enum OAuthProvider { Etsy = 'etsy', Facebook = 'facebook', Figma = 'figma', + Fusionauth = 'fusionauth', Github = 'github', Gitlab = 'gitlab', Google = 'google', + Keycloak = 'keycloak', + Kick = 'kick', Linkedin = 'linkedin', Microsoft = 'microsoft', Notion = 'notion', diff --git a/src/enums/policy-id.ts b/src/enums/policy-id.ts new file mode 100644 index 00000000..ab1c4cd2 --- /dev/null +++ b/src/enums/policy-id.ts @@ -0,0 +1,11 @@ +export enum PolicyId { + Passworddictionary = 'password-dictionary', + Passwordhistory = 'password-history', + Passwordpersonaldata = 'password-personal-data', + Sessionalert = 'session-alert', + Sessionduration = 'session-duration', + Sessioninvalidation = 'session-invalidation', + Sessionlimit = 'session-limit', + Userlimit = 'user-limit', + Membershipprivacy = 'membership-privacy', +} \ No newline at end of file diff --git a/src/enums/provider-id.ts b/src/enums/provider-id.ts new file mode 100644 index 00000000..943d7334 --- /dev/null +++ b/src/enums/provider-id.ts @@ -0,0 +1,49 @@ +export enum ProviderId { + Amazon = 'amazon', + Apple = 'apple', + Auth0 = 'auth0', + Authentik = 'authentik', + Autodesk = 'autodesk', + Bitbucket = 'bitbucket', + Bitly = 'bitly', + Box = 'box', + Dailymotion = 'dailymotion', + Discord = 'discord', + Disqus = 'disqus', + Dropbox = 'dropbox', + Etsy = 'etsy', + Facebook = 'facebook', + Figma = 'figma', + Fusionauth = 'fusionauth', + Github = 'github', + Gitlab = 'gitlab', + Google = 'google', + Keycloak = 'keycloak', + Kick = 'kick', + Linkedin = 'linkedin', + Microsoft = 'microsoft', + Notion = 'notion', + Oidc = 'oidc', + Okta = 'okta', + Paypal = 'paypal', + PaypalSandbox = 'paypalSandbox', + Podio = 'podio', + Salesforce = 'salesforce', + Slack = 'slack', + Spotify = 'spotify', + Stripe = 'stripe', + Tradeshift = 'tradeshift', + TradeshiftBox = 'tradeshiftBox', + Twitch = 'twitch', + Wordpress = 'wordpress', + X = 'x', + Yahoo = 'yahoo', + Yammer = 'yammer', + Yandex = 'yandex', + Zoho = 'zoho', + Zoom = 'zoom', + Mock = 'mock', + Mockunverified = 'mock-unverified', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', +} \ No newline at end of file diff --git a/src/enums/proxy-resource-type.ts b/src/enums/proxy-resource-type.ts new file mode 100644 index 00000000..e04c8046 --- /dev/null +++ b/src/enums/proxy-resource-type.ts @@ -0,0 +1,4 @@ +export enum ProxyResourceType { + Site = 'site', + Function = 'function', +} \ No newline at end of file diff --git a/src/enums/proxy-rule-deployment-resource-type.ts b/src/enums/proxy-rule-deployment-resource-type.ts new file mode 100644 index 00000000..89236c74 --- /dev/null +++ b/src/enums/proxy-rule-deployment-resource-type.ts @@ -0,0 +1,4 @@ +export enum ProxyRuleDeploymentResourceType { + Function = 'function', + Site = 'site', +} \ No newline at end of file diff --git a/src/enums/proxy-rule-status.ts b/src/enums/proxy-rule-status.ts new file mode 100644 index 00000000..67b8e4cb --- /dev/null +++ b/src/enums/proxy-rule-status.ts @@ -0,0 +1,5 @@ +export enum ProxyRuleStatus { + Unverified = 'unverified', + Verifying = 'verifying', + Verified = 'verified', +} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index 3a57958b..f4d20688 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -79,6 +79,7 @@ export enum Runtime { Go124 = 'go-1.24', Go125 = 'go-1.25', Go126 = 'go-1.26', + Rust183 = 'rust-1.83', Static1 = 'static-1', Flutter324 = 'flutter-3.24', Flutter327 = 'flutter-3.27', diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index d98f20ab..5c812100 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -1,71 +1,84 @@ export enum Scopes { - SessionsWrite = 'sessions.write', + ProjectRead = 'project.read', + ProjectWrite = 'project.write', + KeysRead = 'keys.read', + KeysWrite = 'keys.write', + PlatformsRead = 'platforms.read', + PlatformsWrite = 'platforms.write', + MocksRead = 'mocks.read', + MocksWrite = 'mocks.write', + PoliciesRead = 'policies.read', + PoliciesWrite = 'policies.write', + ProjectPoliciesRead = 'project.policies.read', + ProjectPoliciesWrite = 'project.policies.write', + TemplatesRead = 'templates.read', + TemplatesWrite = 'templates.write', + Oauth2Read = 'oauth2.read', + Oauth2Write = 'oauth2.write', UsersRead = 'users.read', UsersWrite = 'users.write', + SessionsRead = 'sessions.read', + SessionsWrite = 'sessions.write', TeamsRead = 'teams.read', TeamsWrite = 'teams.write', DatabasesRead = 'databases.read', DatabasesWrite = 'databases.write', - CollectionsRead = 'collections.read', - CollectionsWrite = 'collections.write', TablesRead = 'tables.read', TablesWrite = 'tables.write', - AttributesRead = 'attributes.read', - AttributesWrite = 'attributes.write', ColumnsRead = 'columns.read', ColumnsWrite = 'columns.write', IndexesRead = 'indexes.read', IndexesWrite = 'indexes.write', - DocumentsRead = 'documents.read', - DocumentsWrite = 'documents.write', RowsRead = 'rows.read', RowsWrite = 'rows.write', - FilesRead = 'files.read', - FilesWrite = 'files.write', + CollectionsRead = 'collections.read', + CollectionsWrite = 'collections.write', + AttributesRead = 'attributes.read', + AttributesWrite = 'attributes.write', + DocumentsRead = 'documents.read', + DocumentsWrite = 'documents.write', BucketsRead = 'buckets.read', BucketsWrite = 'buckets.write', + FilesRead = 'files.read', + FilesWrite = 'files.write', + TokensRead = 'tokens.read', + TokensWrite = 'tokens.write', FunctionsRead = 'functions.read', FunctionsWrite = 'functions.write', + ExecutionsRead = 'executions.read', + ExecutionsWrite = 'executions.write', + ExecutionRead = 'execution.read', + ExecutionWrite = 'execution.write', SitesRead = 'sites.read', SitesWrite = 'sites.write', LogRead = 'log.read', LogWrite = 'log.write', - ExecutionRead = 'execution.read', - ExecutionWrite = 'execution.write', - LocaleRead = 'locale.read', - AvatarsRead = 'avatars.read', - HealthRead = 'health.read', ProvidersRead = 'providers.read', ProvidersWrite = 'providers.write', - MessagesRead = 'messages.read', - MessagesWrite = 'messages.write', TopicsRead = 'topics.read', TopicsWrite = 'topics.write', SubscribersRead = 'subscribers.read', SubscribersWrite = 'subscribers.write', TargetsRead = 'targets.read', TargetsWrite = 'targets.write', + MessagesRead = 'messages.read', + MessagesWrite = 'messages.write', RulesRead = 'rules.read', RulesWrite = 'rules.write', - SchedulesRead = 'schedules.read', - SchedulesWrite = 'schedules.write', + WebhooksRead = 'webhooks.read', + WebhooksWrite = 'webhooks.write', + LocaleRead = 'locale.read', + AvatarsRead = 'avatars.read', + HealthRead = 'health.read', + AssistantRead = 'assistant.read', MigrationsRead = 'migrations.read', MigrationsWrite = 'migrations.write', + SchedulesRead = 'schedules.read', + SchedulesWrite = 'schedules.write', VcsRead = 'vcs.read', VcsWrite = 'vcs.write', - AssistantRead = 'assistant.read', - TokensRead = 'tokens.read', - TokensWrite = 'tokens.write', - WebhooksRead = 'webhooks.read', - WebhooksWrite = 'webhooks.write', - ProjectRead = 'project.read', - ProjectWrite = 'project.write', - KeysRead = 'keys.read', - KeysWrite = 'keys.write', - PlatformsRead = 'platforms.read', - PlatformsWrite = 'platforms.write', - PoliciesWrite = 'policies.write', - PoliciesRead = 'policies.read', + BackupsPoliciesRead = 'backups.policies.read', + BackupsPoliciesWrite = 'backups.policies.write', ArchivesRead = 'archives.read', ArchivesWrite = 'archives.write', RestorationsRead = 'restorations.read', diff --git a/src/enums/secure.ts b/src/enums/secure.ts new file mode 100644 index 00000000..0ab54cf8 --- /dev/null +++ b/src/enums/secure.ts @@ -0,0 +1,4 @@ +export enum Secure { + Tls = 'tls', + Ssl = 'ssl', +} \ No newline at end of file diff --git a/src/enums/status-code.ts b/src/enums/status-code.ts new file mode 100644 index 00000000..1f3adf8b --- /dev/null +++ b/src/enums/status-code.ts @@ -0,0 +1,6 @@ +export enum StatusCode { + MovedPermanently301 = '301', + Found302 = '302', + TemporaryRedirect307 = '307', + PermanentRedirect308 = '308', +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 743e850e..be8503ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,7 @@ export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; export { Project } from './services/project'; +export { Proxy } from './services/proxy'; export { Sites } from './services/sites'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; @@ -47,8 +48,16 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; +export { MethodId } from './enums/method-id'; +export { ProviderId } from './enums/provider-id'; +export { PolicyId } from './enums/policy-id'; export { ProtocolId } from './enums/protocol-id'; export { ServiceId } from './enums/service-id'; +export { Secure } from './enums/secure'; +export { EmailTemplateType } from './enums/email-template-type'; +export { EmailTemplateLocale } from './enums/email-template-locale'; +export { StatusCode } from './enums/status-code'; +export { ProxyResourceType } from './enums/proxy-resource-type'; export { Framework } from './enums/framework'; export { BuildRuntime } from './enums/build-runtime'; export { Adapter } from './enums/adapter'; @@ -67,4 +76,6 @@ export { ExecutionStatus } from './enums/execution-status'; export { PlatformType } from './enums/platform-type'; export { HealthAntivirusStatus } from './enums/health-antivirus-status'; export { HealthCheckStatus } from './enums/health-check-status'; +export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; +export { ProxyRuleStatus } from './enums/proxy-rule-status'; export { MessageStatus } from './enums/message-status'; diff --git a/src/inputFile.ts b/src/inputFile.ts index a30ea55d..94afbe23 100644 --- a/src/inputFile.ts +++ b/src/inputFile.ts @@ -1,23 +1,144 @@ import { File } from "node-fetch-native-with-agent"; -import { realpathSync, readFileSync } from "fs"; -import type { BinaryLike } from "crypto"; + +type FsPromises = { + stat: (path: string) => Promise<{ size: number }>; + open: (path: string, flags: string) => Promise<{ + read: (buffer: Uint8Array, offset: number, length: number, position: number) => Promise<{ bytesRead: number }>; + close: () => Promise; + }>; + readFile: (path: string) => Promise; +}; + +function isEdgeRuntime(): boolean { + return typeof globalThis !== 'undefined' && typeof (globalThis as { EdgeRuntime?: unknown }).EdgeRuntime !== 'undefined'; +} + +function assertFileSystemAvailable(): void { + if (isEdgeRuntime()) { + throw new Error('File system operations are not supported in edge runtimes. Please use InputFile.fromBuffer instead.'); + } +} + +async function getFs(): Promise { + assertFileSystemAvailable(); + + try { + const fs = await import('fs'); + return fs.promises; + } catch { + throw new Error('File system operations are not available in this runtime. Please use InputFile.fromBuffer instead.'); + } +} + +function getFilename(path: string): string { + const segments = path.replace(/\\/g, '/').split('/').filter(Boolean); + return segments.pop() ?? 'file'; +} + +type BlobLike = { + size: number; + slice: (start: number, end: number) => BlobLike; + arrayBuffer: () => Promise; +}; + +type InputFileSource = + | { type: 'path'; path: string } + | { type: 'buffer'; data: Uint8Array } + | { type: 'blob'; data: BlobLike }; export class InputFile { - static fromBuffer( - parts: Blob | BinaryLike, - name: string - ): File { - return new File([parts], name); + private source: InputFileSource; + filename: string; + + private constructor(source: InputFileSource, filename: string) { + this.source = source; + this.filename = filename; + } + + static fromBuffer(parts: BlobLike | Uint8Array | ArrayBuffer | string, name: string): InputFile { + if (parts && !ArrayBuffer.isView(parts) && typeof (parts as BlobLike).arrayBuffer === 'function') { + return new InputFile({ type: 'blob', data: parts as BlobLike }, name); + } + + if (typeof parts === 'string') { + return new InputFile({ type: 'buffer', data: new TextEncoder().encode(parts) }, name); + } + + if (parts instanceof ArrayBuffer) { + return new InputFile({ type: 'buffer', data: new Uint8Array(parts) }, name); + } + + if (ArrayBuffer.isView(parts)) { + return new InputFile({ + type: 'buffer', + data: new Uint8Array(parts.buffer, parts.byteOffset, parts.byteLength), + }, name); + } + + throw new Error('Unsupported input type for InputFile.fromBuffer'); + } + + static fromPath(path: string, name?: string): InputFile { + assertFileSystemAvailable(); + return new InputFile({ type: 'path', path }, name ?? getFilename(path)); + } + + static fromPlainText(content: string, name: string): InputFile { + return new InputFile({ type: 'buffer', data: new TextEncoder().encode(content) }, name); + } + + async size(): Promise { + switch (this.source.type) { + case 'path': { + const fs = await getFs(); + return (await fs.stat(this.source.path)).size; + } + case 'buffer': + return this.source.data.length; + case 'blob': + return this.source.data.size; + } + } + + async slice(start: number, end: number): Promise { + const length = end - start; + + switch (this.source.type) { + case 'path': { + const fs = await getFs(); + const handle = await fs.open(this.source.path, 'r'); + try { + const buffer = new Uint8Array(length); + const result = await handle.read(buffer, 0, length, start); + return result.bytesRead === buffer.length ? buffer : buffer.subarray(0, result.bytesRead); + } finally { + await handle.close(); + } + } + case 'buffer': + return this.source.data.subarray(start, end); + case 'blob': { + const arrayBuffer = await this.source.data.slice(start, end).arrayBuffer(); + return new Uint8Array(arrayBuffer); + } + } } - static fromPath(path: string, name: string): File { - const realPath = realpathSync(path); - const contents = readFileSync(realPath); - return this.fromBuffer(contents, name); + async toFile(): Promise { + const data = await this.toUint8Array(); + return new File([data], this.filename); } - static fromPlainText(content: string, name: string): File { - const arrayBytes = new TextEncoder().encode(content); - return this.fromBuffer(arrayBytes, name); + private async toUint8Array(): Promise { + switch (this.source.type) { + case 'path': { + const fs = await getFs(); + return await fs.readFile(this.source.path); + } + case 'buffer': + return this.source.data; + case 'blob': + return new Uint8Array(await this.source.data.arrayBuffer()); + } } } diff --git a/src/models.ts b/src/models.ts index 0f9546a3..64911ce6 100644 --- a/src/models.ts +++ b/src/models.ts @@ -8,6 +8,8 @@ import { ExecutionStatus } from "./enums/execution-status" import { PlatformType } from "./enums/platform-type" import { HealthAntivirusStatus } from "./enums/health-antivirus-status" import { HealthCheckStatus } from "./enums/health-check-status" +import { ProxyRuleDeploymentResourceType } from "./enums/proxy-rule-deployment-resource-type" +import { ProxyRuleStatus } from "./enums/proxy-rule-status" import { MessageStatus } from "./enums/message-status" /** @@ -437,6 +439,48 @@ export namespace Models { variables: Variable[]; } + /** + * Mock Numbers List + */ + export type MockNumberList = { + /** + * Total number of mockNumbers that matched your query. + */ + total: number; + /** + * List of mockNumbers. + */ + mockNumbers: MockNumber[]; + } + + /** + * Policies List + */ + export type PolicyList = { + /** + * Total number of policies in the given project. + */ + total: number; + /** + * List of policies. + */ + policies: (Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy)[]; + } + + /** + * Email Templates List + */ + export type EmailTemplateList = { + /** + * Total number of templates that matched your query. + */ + total: number; + /** + * List of templates. + */ + templates: EmailTemplate[]; + } + /** * Status List */ @@ -451,6 +495,20 @@ export namespace Models { statuses: HealthStatus[]; } + /** + * Rule List + */ + export type ProxyRuleList = { + /** + * Total number of rules that matched your query. + */ + total: number; + /** + * List of rules. + */ + rules: ProxyRule[]; + } + /** * Locale codes list */ @@ -640,7 +698,7 @@ export namespace Models { /** * Collection attributes. */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; + attributes: (Models.AttributeBoolean | Models.AttributeBigint | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; /** * Collection indexes. */ @@ -666,7 +724,7 @@ export namespace Models { /** * List of attributes. */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; + attributes: (Models.AttributeBoolean | Models.AttributeBigint | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; } /** @@ -769,6 +827,56 @@ export namespace Models { default?: number; } + /** + * AttributeBigInt + */ + export type AttributeBigint = { + /** + * Attribute Key. + */ + key: string; + /** + * Attribute type. + */ + type: string; + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: AttributeStatus; + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + error: string; + /** + * Is attribute required? + */ + required: boolean; + /** + * Is attribute an array? + */ + array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number | bigint; + /** + * Maximum value to enforce for new documents. + */ + max?: number | bigint; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + default?: number | bigint; + } + /** * AttributeFloat */ @@ -1510,7 +1618,7 @@ export namespace Models { /** * Table columns. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + columns: (Models.ColumnBoolean | Models.ColumnBigint | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; /** * Table indexes. */ @@ -1536,7 +1644,7 @@ export namespace Models { /** * List of columns. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + columns: (Models.ColumnBoolean | Models.ColumnBigint | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; } /** @@ -1639,6 +1747,56 @@ export namespace Models { default?: number; } + /** + * ColumnBigInt + */ + export type ColumnBigint = { + /** + * Column Key. + */ + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: ColumnStatus; + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + error: string; + /** + * Is column required? + */ + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number | bigint; + /** + * Maximum value to enforce for new documents. + */ + max?: number | bigint; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: number | bigint; + } + /** * ColumnFloat */ @@ -3284,6 +3442,10 @@ export namespace Models { * User email address. Hide this attribute by toggling membership privacy in the Console. */ userEmail: string; + /** + * User phone number. Hide this attribute by toggling membership privacy in the Console. + */ + userPhone: string; /** * Team ID. */ @@ -3972,6 +4134,14 @@ export namespace Models { * Whether or not to show user MFA status in the teams membership response. */ authMembershipsMfa: boolean; + /** + * Whether or not to show user IDs in the teams membership response. + */ + authMembershipsUserId: boolean; + /** + * Whether or not to show user phone numbers in the teams membership response. + */ + authMembershipsUserPhone: boolean; /** * Whether or not all existing sessions should be invalidated on password change */ @@ -4008,10 +4178,14 @@ export namespace Models { * SMTP sender email */ smtpSenderEmail: string; + /** + * SMTP reply to name + */ + smtpReplyToName: string; /** * SMTP reply to email */ - smtpReplyTo: string; + smtpReplyToEmail: string; /** * SMTP server host name */ @@ -4025,7 +4199,7 @@ export namespace Models { */ smtpUsername: string; /** - * SMTP server password + * SMTP server password. This property is write-only and always returned empty. */ smtpPassword: string; /** @@ -4275,9 +4449,9 @@ export namespace Models { } /** - * DevKey + * Ephemeral Key */ - export type DevKey = { + export type EphemeralKey = { /** * Key ID. */ @@ -4298,6 +4472,10 @@ export namespace Models { * Key expiration date in ISO 8601 format. */ expire: string; + /** + * Allowed permission scopes. + */ + scopes: string[]; /** * Secret key. */ @@ -4313,153 +4491,1295 @@ export namespace Models { } /** - * Mock Number + * DevKey */ - export type MockNumber = { + export type DevKey = { /** - * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + * Key ID. */ - phone: string; + $id: string; /** - * Mock OTP for the number. + * Key creation date in ISO 8601 format. */ - otp: string; - } - - /** - * AuthProvider - */ - export type AuthProvider = { + $createdAt: string; /** - * Auth Provider. + * Key update date in ISO 8601 format. */ - key: string; + $updatedAt: string; /** - * Auth Provider name. + * Key name. */ name: string; /** - * OAuth 2.0 application ID. + * Key expiration date in ISO 8601 format. */ - appId: string; + expire: string; /** - * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + * Secret key. */ secret: string; /** - * Auth Provider is active and can be used to create session. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - enabled: boolean; + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; } /** - * Platform Web + * Mock Number */ - export type PlatformWeb = { + export type MockNumber = { /** - * Platform ID. + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. */ - $id: string; + number: string; /** - * Platform creation date in ISO 8601 format. + * Mock OTP for the number. + */ + otp: string; + /** + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Platform update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; + } + + /** + * OAuth2GitHub + */ + export type OAuth2Github = { /** - * Platform name. + * OAuth2 provider ID. */ - name: string; + $id: string; /** - * Platform type. Possible values are: windows, apple, android, linux, web. + * OAuth2 provider is active and can be used to create sessions. */ - type: PlatformType; + enabled: boolean; /** - * Web app hostname. Empty string for other platforms. + * GitHub OAuth2 client ID. For GitHub Apps, use the "App ID" when both an App ID and client ID are available. */ - hostname: string; + clientId: string; + /** + * GitHub OAuth2 client secret. + */ + clientSecret: string; } /** - * Platform Apple + * OAuth2Discord */ - export type PlatformApple = { + export type OAuth2Discord = { /** - * Platform ID. + * OAuth2 provider ID. */ $id: string; /** - * Platform creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Platform update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Platform name. + * OAuth2 provider is active and can be used to create sessions. */ - name: string; + enabled: boolean; /** - * Platform type. Possible values are: windows, apple, android, linux, web. + * Discord OAuth2 client ID. */ - type: PlatformType; + clientId: string; /** - * Apple bundle identifier. + * Discord OAuth2 client secret. */ - bundleIdentifier: string; + clientSecret: string; } /** - * Platform Android + * OAuth2Figma */ - export type PlatformAndroid = { + export type OAuth2Figma = { /** - * Platform ID. + * OAuth2 provider ID. */ $id: string; /** - * Platform creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Platform update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Platform name. + * OAuth2 provider is active and can be used to create sessions. */ - name: string; + enabled: boolean; /** - * Platform type. Possible values are: windows, apple, android, linux, web. + * Figma OAuth2 client ID. */ - type: PlatformType; + clientId: string; /** - * Android application ID. + * Figma OAuth2 client secret. */ - applicationId: string; + clientSecret: string; } /** - * Platform Windows + * OAuth2Dropbox */ - export type PlatformWindows = { + export type OAuth2Dropbox = { /** - * Platform ID. + * OAuth2 provider ID. */ $id: string; /** - * Platform creation date in ISO 8601 format. + * OAuth2 provider is active and can be used to create sessions. */ - $createdAt: string; + enabled: boolean; /** - * Platform update date in ISO 8601 format. + * Dropbox OAuth2 app key. */ - $updatedAt: string; + appKey: string; /** - * Platform name. + * Dropbox OAuth2 app secret. + */ + appSecret: string; + } + + /** + * OAuth2Dailymotion + */ + export type OAuth2Dailymotion = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Dailymotion OAuth2 API key. + */ + apiKey: string; + /** + * Dailymotion OAuth2 API secret. + */ + apiSecret: string; + } + + /** + * OAuth2Bitbucket + */ + export type OAuth2Bitbucket = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Bitbucket OAuth2 key. + */ + key: string; + /** + * Bitbucket OAuth2 secret. + */ + secret: string; + } + + /** + * OAuth2Bitly + */ + export type OAuth2Bitly = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Bitly OAuth2 client ID. + */ + clientId: string; + /** + * Bitly OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Box + */ + export type OAuth2Box = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Box OAuth2 client ID. + */ + clientId: string; + /** + * Box OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Autodesk + */ + export type OAuth2Autodesk = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Autodesk OAuth2 client ID. + */ + clientId: string; + /** + * Autodesk OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Google + */ + export type OAuth2Google = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Google OAuth2 client ID. + */ + clientId: string; + /** + * Google OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Zoom + */ + export type OAuth2Zoom = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Zoom OAuth2 client ID. + */ + clientId: string; + /** + * Zoom OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Zoho + */ + export type OAuth2Zoho = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Zoho OAuth2 client ID. + */ + clientId: string; + /** + * Zoho OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Yandex + */ + export type OAuth2Yandex = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Yandex OAuth2 client ID. + */ + clientId: string; + /** + * Yandex OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2X + */ + export type OAuth2X = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * X OAuth2 customer key. + */ + customerKey: string; + /** + * X OAuth2 secret key. + */ + secretKey: string; + } + + /** + * OAuth2WordPress + */ + export type OAuth2WordPress = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * WordPress OAuth2 client ID. + */ + clientId: string; + /** + * WordPress OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Twitch + */ + export type OAuth2Twitch = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Twitch OAuth2 client ID. + */ + clientId: string; + /** + * Twitch OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Stripe + */ + export type OAuth2Stripe = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Stripe OAuth2 client ID. + */ + clientId: string; + /** + * Stripe OAuth2 API secret key. + */ + apiSecretKey: string; + } + + /** + * OAuth2Spotify + */ + export type OAuth2Spotify = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Spotify OAuth2 client ID. + */ + clientId: string; + /** + * Spotify OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Slack + */ + export type OAuth2Slack = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Slack OAuth2 client ID. + */ + clientId: string; + /** + * Slack OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Podio + */ + export type OAuth2Podio = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Podio OAuth2 client ID. + */ + clientId: string; + /** + * Podio OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Notion + */ + export type OAuth2Notion = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Notion OAuth2 client ID. + */ + oauthClientId: string; + /** + * Notion OAuth2 client secret. + */ + oauthClientSecret: string; + } + + /** + * OAuth2Salesforce + */ + export type OAuth2Salesforce = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Salesforce OAuth2 consumer key. + */ + customerKey: string; + /** + * Salesforce OAuth2 consumer secret. + */ + customerSecret: string; + } + + /** + * OAuth2Yahoo + */ + export type OAuth2Yahoo = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Yahoo OAuth2 client ID. + */ + clientId: string; + /** + * Yahoo OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Linkedin + */ + export type OAuth2Linkedin = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * LinkedIn OAuth2 client ID. + */ + clientId: string; + /** + * LinkedIn OAuth2 primary client secret. + */ + primaryClientSecret: string; + } + + /** + * OAuth2Disqus + */ + export type OAuth2Disqus = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Disqus OAuth2 public key. + */ + publicKey: string; + /** + * Disqus OAuth2 secret key. + */ + secretKey: string; + } + + /** + * OAuth2Amazon + */ + export type OAuth2Amazon = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Amazon OAuth2 client ID. + */ + clientId: string; + /** + * Amazon OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Etsy + */ + export type OAuth2Etsy = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Etsy OAuth2 keystring. + */ + keyString: string; + /** + * Etsy OAuth2 shared secret. + */ + sharedSecret: string; + } + + /** + * OAuth2Facebook + */ + export type OAuth2Facebook = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Facebook OAuth2 app ID. + */ + appId: string; + /** + * Facebook OAuth2 app secret. + */ + appSecret: string; + } + + /** + * OAuth2Tradeshift + */ + export type OAuth2Tradeshift = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Tradeshift OAuth2 client ID. + */ + oauth2ClientId: string; + /** + * Tradeshift OAuth2 client secret. + */ + oauth2ClientSecret: string; + } + + /** + * OAuth2Paypal + */ + export type OAuth2Paypal = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * PayPal OAuth2 client ID. + */ + clientId: string; + /** + * PayPal OAuth2 secret key. + */ + secretKey: string; + } + + /** + * OAuth2Gitlab + */ + export type OAuth2Gitlab = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * GitLab OAuth2 application ID. + */ + applicationId: string; + /** + * GitLab OAuth2 secret. + */ + secret: string; + /** + * GitLab OAuth2 endpoint URL. Defaults to https://gitlab.com for self-hosted instances. + */ + endpoint: string; + } + + /** + * OAuth2Authentik + */ + export type OAuth2Authentik = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Authentik OAuth2 client ID. + */ + clientId: string; + /** + * Authentik OAuth2 client secret. + */ + clientSecret: string; + /** + * Authentik OAuth2 endpoint domain. + */ + endpoint: string; + } + + /** + * OAuth2Auth0 + */ + export type OAuth2Auth0 = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Auth0 OAuth2 client ID. + */ + clientId: string; + /** + * Auth0 OAuth2 client secret. + */ + clientSecret: string; + /** + * Auth0 OAuth2 endpoint domain. + */ + endpoint: string; + } + + /** + * OAuth2FusionAuth + */ + export type OAuth2FusionAuth = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * FusionAuth OAuth2 client ID. + */ + clientId: string; + /** + * FusionAuth OAuth2 client secret. + */ + clientSecret: string; + /** + * FusionAuth OAuth2 endpoint domain. + */ + endpoint: string; + } + + /** + * OAuth2Keycloak + */ + export type OAuth2Keycloak = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Keycloak OAuth2 client ID. + */ + clientId: string; + /** + * Keycloak OAuth2 client secret. + */ + clientSecret: string; + /** + * Keycloak OAuth2 endpoint domain. + */ + endpoint: string; + /** + * Keycloak OAuth2 realm name. + */ + realmName: string; + } + + /** + * OAuth2Oidc + */ + export type OAuth2Oidc = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * OpenID Connect OAuth2 client ID. + */ + clientId: string; + /** + * OpenID Connect OAuth2 client secret. + */ + clientSecret: string; + /** + * OpenID Connect well-known configuration URL. When set, authorization, token, and user info endpoints can be discovered automatically. + */ + wellKnownURL: string; + /** + * OpenID Connect authorization endpoint URL. + */ + authorizationURL: string; + /** + * OpenID Connect token endpoint URL. + */ + tokenURL: string; + /** + * OpenID Connect user info endpoint URL. + */ + userInfoURL: string; + } + + /** + * OAuth2Okta + */ + export type OAuth2Okta = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Okta OAuth2 client ID. + */ + clientId: string; + /** + * Okta OAuth2 client secret. + */ + clientSecret: string; + /** + * Okta OAuth2 domain. + */ + domain: string; + /** + * Okta OAuth2 authorization server ID. + */ + authorizationServerId: string; + } + + /** + * OAuth2Kick + */ + export type OAuth2Kick = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Kick OAuth2 client ID. + */ + clientId: string; + /** + * Kick OAuth2 client secret. + */ + clientSecret: string; + } + + /** + * OAuth2Apple + */ + export type OAuth2Apple = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Apple OAuth2 service ID. + */ + serviceId: string; + /** + * Apple OAuth2 key ID. + */ + keyId: string; + /** + * Apple OAuth2 team ID. + */ + teamId: string; + /** + * Apple OAuth2 .p8 private key file contents. The secret key wrapped by the PEM markers is 200 characters long. + */ + p8File: string; + } + + /** + * OAuth2Microsoft + */ + export type OAuth2Microsoft = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Microsoft OAuth2 application ID. + */ + applicationId: string; + /** + * Microsoft OAuth2 application secret. + */ + applicationSecret: string; + /** + * Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. + */ + tenant: string; + } + + /** + * OAuth2 Providers List + */ + export type OAuth2ProviderList = { + /** + * Total number of OAuth2 providers in the given project. + */ + total: number; + /** + * List of OAuth2 providers. + */ + providers: (Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft)[]; + } + + /** + * Policy Password Dictionary + */ + export type PolicyPasswordDictionary = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether password dictionary policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Password History + */ + export type PolicyPasswordHistory = { + /** + * Policy ID. + */ + $id: string; + /** + * Password history length. A value of 0 means the policy is disabled. + */ + total: number; + } + + /** + * Policy Password Personal Data + */ + export type PolicyPasswordPersonalData = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether password personal data policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Session Alert + */ + export type PolicySessionAlert = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether session alert policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Session Duration + */ + export type PolicySessionDuration = { + /** + * Policy ID. + */ + $id: string; + /** + * Session duration in seconds. + */ + duration: number; + } + + /** + * Policy Session Invalidation + */ + export type PolicySessionInvalidation = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether session invalidation policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Session Limit + */ + export type PolicySessionLimit = { + /** + * Policy ID. + */ + $id: string; + /** + * Maximum number of sessions allowed per user. A value of 0 means the policy is disabled. + */ + total: number; + } + + /** + * Policy User Limit + */ + export type PolicyUserLimit = { + /** + * Policy ID. + */ + $id: string; + /** + * Maximum number of users allowed in the project. A value of 0 means the policy is disabled. + */ + total: number; + } + + /** + * Policy Membership Privacy + */ + export type PolicyMembershipPrivacy = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether user ID is visible in memberships. + */ + userId: boolean; + /** + * Whether user email is visible in memberships. + */ + userEmail: boolean; + /** + * Whether user phone is visible in memberships. + */ + userPhone: boolean; + /** + * Whether user name is visible in memberships. + */ + userName: boolean; + /** + * Whether user MFA status is visible in memberships. + */ + userMFA: boolean; + } + + /** + * AuthProvider + */ + export type AuthProvider = { + /** + * Auth Provider. + */ + key: string; + /** + * Auth Provider name. + */ + name: string; + /** + * OAuth 2.0 application ID. + */ + appId: string; + /** + * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. This property is write-only and always returned empty. + */ + secret: string; + /** + * Auth Provider is active and can be used to create session. + */ + enabled: boolean; + } + + /** + * Platform Web + */ + export type PlatformWeb = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Web app hostname. Empty string for other platforms. + */ + hostname: string; + } + + /** + * Platform Apple + */ + export type PlatformApple = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Apple bundle identifier. + */ + bundleIdentifier: string; + } + + /** + * Platform Android + */ + export type PlatformAndroid = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Android application ID. + */ + applicationId: string; + } + + /** + * Platform Windows + */ + export type PlatformWindows = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. */ name: string; /** @@ -4778,6 +6098,110 @@ export namespace Models { slug: string; } + /** + * Rule + */ + export type ProxyRule = { + /** + * Rule ID. + */ + $id: string; + /** + * Rule creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Rule update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Domain name. + */ + domain: string; + /** + * Action definition for the rule. Possible values are "api", "deployment", or "redirect" + */ + type: string; + /** + * Defines how the rule was created. Possible values are "manual" or "deployment" + */ + trigger: string; + /** + * URL to redirect to. Used if type is "redirect" + */ + redirectUrl: string; + /** + * Status code to apply during redirect. Used if type is "redirect" + */ + redirectStatusCode: number; + /** + * ID of deployment. Used if type is "deployment" + */ + deploymentId: string; + /** + * Type of deployment. Possible values are "function", "site". Used if rule's type is "deployment". + */ + deploymentResourceType?: ProxyRuleDeploymentResourceType; + /** + * ID of deployment's resource (site or function ID). Used if type is "deployment" + */ + deploymentResourceId: string; + /** + * Name of Git branch that updates rule. Used if type is "deployment" + */ + deploymentVcsProviderBranch: string; + /** + * Domain verification status. Possible values are "unverified", "verifying", "verified" + */ + status: ProxyRuleStatus; + /** + * Logs from rule verification or certificate generation. Certificate generation logs are prioritized if both are available. + */ + logs: string; + /** + * Certificate auto-renewal date in ISO 8601 format. + */ + renewAt: string; + } + + /** + * EmailTemplate + */ + export type EmailTemplate = { + /** + * Template type + */ + templateId: string; + /** + * Template locale + */ + locale: string; + /** + * Template message + */ + message: string; + /** + * Name of the sender + */ + senderName: string; + /** + * Email of the sender + */ + senderEmail: string; + /** + * Reply to email address + */ + replyToEmail: string; + /** + * Reply to name + */ + replyToName: string; + /** + * Email subject + */ + subject: string; + } + /** * MFA Challenge */ @@ -5348,6 +6772,26 @@ export namespace Models { * Block expiration date in ISO 8601 format. Can be null if the block does not expire. */ expiredAt?: string; + /** + * Name of the project this block applies to. + */ + projectName: string; + /** + * Region of the project this block applies to. + */ + region: string; + /** + * Name of the organization that owns the project. + */ + organizationName: string; + /** + * ID of the organization that owns the project. + */ + organizationId: string; + /** + * Billing plan of the organization that owns the project. + */ + billingPlan: string; } /** diff --git a/src/services/account.ts b/src/services/account.ts index 07b94599..c98e454b 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { AuthenticatorType } from '../enums/authenticator-type'; import { AuthenticationFactor } from '../enums/authentication-factor'; import { OAuthProvider } from '../enums/o-auth-provider'; @@ -2338,7 +2339,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2353,7 +2354,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/activities.ts b/src/services/activities.ts index 23071821..64e79410 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Activities { client: Client; diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 5090ba03..37ed3bd3 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { Browser } from '../enums/browser'; import { CreditCard } from '../enums/credit-card'; import { Flag } from '../enums/flag'; diff --git a/src/services/backups.ts b/src/services/backups.ts index 32774270..ef8dbc03 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { BackupServices } from '../enums/backup-services'; export class Backups { diff --git a/src/services/databases.ts b/src/services/databases.ts index 54fb8bdc..9a2e744c 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { RelationshipType } from '../enums/relationship-type'; import { RelationMutate } from '../enums/relation-mutate'; import { DatabasesIndexType } from '../enums/databases-index-type'; @@ -1136,6 +1137,228 @@ export class Databases { ); } + /** + * Create a bigint attribute. Optionally, minimum and maximum values can be provided. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.key - Attribute Key. + * @param {boolean} params.required - Is attribute required? + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {boolean} params.array - Is attribute an array? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBigIntColumn` instead. + */ + createBigIntAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; + /** + * Create a bigint attribute. Optionally, minimum and maximum values can be provided. + * + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} key - Attribute Key. + * @param {boolean} required - Is attribute required? + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. + * @param {boolean} array - Is attribute an array? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createBigIntAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; + createBigIntAttribute( + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string, + required: rest[2] as boolean, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, + array: rest[6] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + const required = params.required; + const min = params.min; + const max = params.max; + const xdefault = params.xdefault; + const array = params.array; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a bigint attribute. Changing the `default` value will not update already existing documents. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.key - Attribute Key. + * @param {boolean} params.required - Is attribute required? + * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {string} params.newKey - New Attribute Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBigIntColumn` instead. + */ + updateBigIntAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; + /** + * Update a bigint attribute. Changing the `default` value will not update already existing documents. + * + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} key - Attribute Key. + * @param {boolean} required - Is attribute required? + * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {string} newKey - New Attribute Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateBigIntAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; + updateBigIntAttribute( + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string, + required: rest[2] as boolean, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, + newKey: rest[6] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + const required = params.required; + const xdefault = params.xdefault; + const min = params.min; + const max = params.max; + const newKey = params.newKey; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const payload: Payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Create a boolean attribute. * diff --git a/src/services/functions.ts b/src/services/functions.ts index 743acc04..75835a0b 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -1,6 +1,8 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { InputFile } from '../inputFile'; + import { Runtime } from '../enums/runtime'; import { Scopes } from '../enums/scopes'; import { TemplateReferenceType } from '../enums/template-reference-type'; @@ -758,14 +760,14 @@ export class Functions { * Use the "command" param to set the entrypoint used to execute your code. * * @param {string} params.functionId - Function ID. - * @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + * @param {File | InputFile} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. * @param {boolean} params.activate - Automatically activate the deployment when it is finished building. * @param {string} params.entrypoint - Entrypoint File. * @param {string} params.commands - Build Commands. * @throws {AppwriteException} * @returns {Promise} */ - createDeployment(params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void }): Promise; + createDeployment(params: { functionId: string, code: File | InputFile, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void }): Promise; /** * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. * @@ -774,7 +776,7 @@ export class Functions { * Use the "command" param to set the entrypoint used to execute your code. * * @param {string} functionId - Function ID. - * @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + * @param {File | InputFile} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. * @param {boolean} activate - Automatically activate the deployment when it is finished building. * @param {string} entrypoint - Entrypoint File. * @param {string} commands - Build Commands. @@ -782,21 +784,21 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise; + createDeployment(functionId: string, code: File | InputFile, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise; createDeployment( - paramsOrFirst: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(File)?, (boolean)?, (string)?, (string)?,((progress: UploadProgress) => void)?] + paramsOrFirst: { functionId: string, code: File | InputFile, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void } | string, + ...rest: [(File | InputFile)?, (boolean)?, (string)?, (string)?,((progress: UploadProgress) => void)?] ): Promise { - let params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string }; + let params: { functionId: string, code: File | InputFile, activate: boolean, entrypoint?: string, commands?: string }; let onProgress: ((progress: UploadProgress) => void); if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string }; + params = (paramsOrFirst || {}) as { functionId: string, code: File | InputFile, activate: boolean, entrypoint?: string, commands?: string }; onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { functionId: paramsOrFirst as string, - code: rest[0] as File, + code: rest[0] as File | InputFile, activate: rest[1] as boolean, entrypoint: rest[2] as string, commands: rest[3] as string @@ -1647,33 +1649,42 @@ export class Functions { * Get a list of all variables of a specific function. * * @param {string} params.functionId - Function 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. You may filter on the following attributes: key, resourceType, resourceId, secret + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ - listVariables(params: { functionId: string }): Promise; + listVariables(params: { functionId: string, queries?: string[], total?: boolean }): Promise; /** * Get a list of all variables of a specific function. * * @param {string} functionId - Function 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. You may filter on the following attributes: key, resourceType, resourceId, secret + * @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. */ - listVariables(functionId: string): Promise; + listVariables(functionId: string, queries?: string[], total?: boolean): Promise; listVariables( - paramsOrFirst: { functionId: string } | string + paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] ): Promise { - let params: { functionId: string }; + let params: { functionId: string, queries?: string[], total?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string }; + params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean }; } else { params = { - functionId: paramsOrFirst as string + functionId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean }; } const functionId = params.functionId; + const queries = params.queries; + const total = params.total; if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); @@ -1681,6 +1692,12 @@ export class Functions { const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1698,17 +1715,19 @@ export class Functions { * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. * * @param {string} params.functionId - Function unique ID. + * @param {string} params.variableId - Variable 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.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. * @throws {AppwriteException} * @returns {Promise} */ - createVariable(params: { functionId: string, key: string, value: string, secret?: boolean }): Promise; + createVariable(params: { functionId: string, variableId: string, key: string, value: string, secret?: boolean }): Promise; /** * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. * * @param {string} functionId - Function unique ID. + * @param {string} variableId - Variable 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} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. @@ -1716,25 +1735,27 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise; + createVariable(functionId: string, variableId: string, key: string, value: string, secret?: boolean): Promise; createVariable( - paramsOrFirst: { functionId: string, key: string, value: string, secret?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?] + paramsOrFirst: { functionId: string, variableId: string, key: string, value: string, secret?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { functionId: string, key: string, value: string, secret?: boolean }; + let params: { functionId: string, variableId: string, key: string, value: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, key: string, value: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { functionId: string, variableId: string, key: string, value: string, secret?: boolean }; } else { params = { functionId: paramsOrFirst as string, - key: rest[0] as string, - value: rest[1] as string, - secret: rest[2] as boolean + variableId: rest[0] as string, + key: rest[1] as string, + value: rest[2] as string, + secret: rest[3] as boolean }; } const functionId = params.functionId; + const variableId = params.variableId; const key = params.key; const value = params.value; const secret = params.secret; @@ -1742,6 +1763,9 @@ export class Functions { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } @@ -1751,6 +1775,9 @@ export class Functions { const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); const payload: Payload = {}; + if (typeof variableId !== 'undefined') { + payload['variableId'] = variableId; + } if (typeof key !== 'undefined') { payload['key'] = key; } @@ -1844,7 +1871,7 @@ export class Functions { * @throws {AppwriteException} * @returns {Promise} */ - updateVariable(params: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean }): Promise; + updateVariable(params: { functionId: string, variableId: string, key?: string, value?: string, secret?: boolean }): Promise; /** * Update variable by its unique ID. * @@ -1857,15 +1884,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise; + updateVariable(functionId: string, variableId: string, key?: string, value?: string, secret?: boolean): Promise; updateVariable( - paramsOrFirst: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean } | string, + paramsOrFirst: { functionId: string, variableId: string, key?: string, value?: string, secret?: boolean } | string, ...rest: [(string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean }; + let params: { functionId: string, variableId: string, key?: string, value?: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, variableId: string, key: string, value?: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { functionId: string, variableId: string, key?: string, value?: string, secret?: boolean }; } else { params = { functionId: paramsOrFirst as string, @@ -1888,9 +1915,6 @@ export class Functions { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); const payload: Payload = {}; diff --git a/src/services/graphql.ts b/src/services/graphql.ts index b5f9ffcf..fc553978 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Graphql { client: Client; diff --git a/src/services/health.ts b/src/services/health.ts index 713f33ba..1bd2cf03 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { Name } from '../enums/name'; export class Health { diff --git a/src/services/locale.ts b/src/services/locale.ts index e6b40879..865a085f 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Locale { client: Client; diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 16dd8998..1b8ac968 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { MessagePriority } from '../enums/message-priority'; import { SmtpEncryption } from '../enums/smtp-encryption'; diff --git a/src/services/project.ts b/src/services/project.ts index f2829b93..187567dc 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,9 +1,16 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + +import { MethodId } from '../enums/method-id'; import { Scopes } from '../enums/scopes'; +import { ProviderId } from '../enums/provider-id'; +import { PolicyId } from '../enums/policy-id'; import { ProtocolId } from '../enums/protocol-id'; import { ServiceId } from '../enums/service-id'; +import { Secure } from '../enums/secure'; +import { EmailTemplateType } from '../enums/email-template-type'; +import { EmailTemplateLocale } from '../enums/email-template-locale'; export class Project { client: Client; @@ -12,6 +19,93 @@ export class Project { this.client = client; } + /** + * Delete a project. + * + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(): Promise<{}> { + + const apiPath = '/project'; + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. + * + * @param {MethodId} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {boolean} params.enabled - Auth method status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAuthMethod(params: { methodId: MethodId, enabled: boolean }): Promise; + /** + * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. + * + * @param {MethodId} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {boolean} enabled - Auth method status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAuthMethod(methodId: MethodId, enabled: boolean): Promise; + updateAuthMethod( + paramsOrFirst: { methodId: MethodId, enabled: boolean } | MethodId, + ...rest: [(boolean)?] + ): Promise { + let params: { methodId: MethodId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('methodId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { methodId: MethodId, enabled: boolean }; + } else { + params = { + methodId: paramsOrFirst as MethodId, + enabled: rest[0] as boolean + }; + } + + const methodId = params.methodId; + const enabled = params.enabled; + + if (typeof methodId === 'undefined') { + throw new AppwriteException('Missing required parameter: "methodId"'); + } + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/auth-methods/{methodId}'.replace('{methodId}', methodId); + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all API keys from the current project. * @@ -73,6 +167,8 @@ export class Project { /** * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * You can also create an ephemeral API key if you need a short-lived key instead. * * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Key name. Max length: 128 chars. @@ -84,6 +180,8 @@ export class Project { createKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; /** * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * You can also create an ephemeral API key if you need a short-lived key instead. * * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Key name. Max length: 128 chars. @@ -154,6 +252,76 @@ export class Project { ); } + /** + * Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * You can also create a standard API key if you need a longer-lived key instead. + * + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {number} params.duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. + * @throws {AppwriteException} + * @returns {Promise} + */ + createEphemeralKey(params: { scopes: Scopes[], duration: number }): Promise; + /** + * Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * You can also create a standard API key if you need a longer-lived key instead. + * + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {number} duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createEphemeralKey(scopes: Scopes[], duration: number): Promise; + createEphemeralKey( + paramsOrFirst: { scopes: Scopes[], duration: number } | Scopes[], + ...rest: [(number)?] + ): Promise { + let params: { scopes: Scopes[], duration: number }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scopes' in paramsOrFirst || 'duration' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { scopes: Scopes[], duration: number }; + } else { + params = { + scopes: paramsOrFirst as Scopes[], + duration: rest[0] as number + }; + } + + const scopes = params.scopes; + const duration = params.duration; + + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + if (typeof duration === 'undefined') { + throw new AppwriteException('Missing required parameter: "duration"'); + } + + const apiPath = '/project/keys/ephemeral'; + const payload: Payload = {}; + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof duration !== 'undefined') { + payload['duration'] = duration; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** * Get a key by its unique ID. * @@ -393,28 +561,28 @@ export class Project { } /** - * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * Get a list of all mock phones in the project. This endpoint returns an array of all mock phones and their OTPs. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - listPlatforms(params?: { queries?: string[], total?: boolean }): Promise; + listMockPhones(params?: { queries?: string[], total?: boolean }): Promise; /** - * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * Get a list of all mock phones in the project. This endpoint returns an array of all mock phones and their OTPs. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listPlatforms(queries?: string[], total?: boolean): Promise; - listPlatforms( + listMockPhones(queries?: string[], total?: boolean): Promise; + listMockPhones( paramsOrFirst?: { queries?: string[], total?: boolean } | string[], ...rest: [(boolean)?] - ): Promise { + ): Promise { let params: { queries?: string[], total?: boolean }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -430,7 +598,7 @@ export class Project { const total = params.total; - const apiPath = '/project/platforms'; + const apiPath = '/project/mock-phones'; const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -452,66 +620,56 @@ export class Project { } /** - * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * Create a new mock phone for your project. Use this endpoint to register a mock phone number and its sign-in OTP for your testers. * - * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @param {string} params.number - Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number. + * @param {string} params.otp - One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + createMockPhone(params: { number: string, otp: string }): Promise; /** - * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * Create a new mock phone for your project. Use this endpoint to register a mock phone number and its sign-in OTP for your testers. * - * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @param {string} number - Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number. + * @param {string} otp - One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; - createAndroidPlatform( - paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, applicationId: string }; + createMockPhone(number: string, otp: string): Promise; + createMockPhone( + paramsOrFirst: { number: string, otp: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { number: string, otp: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + params = (paramsOrFirst || {}) as { number: string, otp: string }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - applicationId: rest[1] as string + number: paramsOrFirst as string, + otp: rest[0] as string }; } - const platformId = params.platformId; - const name = params.name; - const applicationId = params.applicationId; + const number = params.number; + const otp = params.otp; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + if (typeof number === 'undefined') { + throw new AppwriteException('Missing required parameter: "number"'); } - if (typeof applicationId === 'undefined') { - throw new AppwriteException('Missing required parameter: "applicationId"'); + if (typeof otp === 'undefined') { + throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/project/platforms/android'; + const apiPath = '/project/mock-phones'; const payload: Payload = {}; - if (typeof platformId !== 'undefined') { - payload['platformId'] = platformId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; + if (typeof number !== 'undefined') { + payload['number'] = number; } - if (typeof applicationId !== 'undefined') { - payload['applicationId'] = applicationId; + if (typeof otp !== 'undefined') { + payload['otp'] = otp; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -528,72 +686,50 @@ export class Project { } /** - * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. * - * @param {string} params.platformId - Platform ID. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @param {string} params.number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + getMockPhone(params: { number: string }): Promise; /** - * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. * - * @param {string} platformId - Platform ID. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @param {string} number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; - updateAndroidPlatform( - paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, applicationId: string }; + getMockPhone(number: string): Promise; + getMockPhone( + paramsOrFirst: { number: string } | string + ): Promise { + let params: { number: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + params = (paramsOrFirst || {}) as { number: string }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - applicationId: rest[1] as string + number: paramsOrFirst as string }; } - const platformId = params.platformId; - const name = params.name; - const applicationId = params.applicationId; + const number = params.number; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof applicationId === 'undefined') { - throw new AppwriteException('Missing required parameter: "applicationId"'); + if (typeof number === 'undefined') { + throw new AppwriteException('Missing required parameter: "number"'); } - const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof applicationId !== 'undefined') { - payload['applicationId'] = applicationId; - } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( - 'put', + 'get', uri, apiHeaders, payload, @@ -601,66 +737,53 @@ export class Project { } /** - * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. * - * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @param {string} params.number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. + * @param {string} params.otp - One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + updateMockPhone(params: { number: string, otp: string }): Promise; /** - * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. * - * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @param {string} number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. + * @param {string} otp - One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; - createApplePlatform( - paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, bundleIdentifier: string }; + updateMockPhone(number: string, otp: string): Promise; + updateMockPhone( + paramsOrFirst: { number: string, otp: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { number: string, otp: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + params = (paramsOrFirst || {}) as { number: string, otp: string }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - bundleIdentifier: rest[1] as string + number: paramsOrFirst as string, + otp: rest[0] as string }; } - const platformId = params.platformId; - const name = params.name; - const bundleIdentifier = params.bundleIdentifier; + const number = params.number; + const otp = params.otp; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); + if (typeof number === 'undefined') { + throw new AppwriteException('Missing required parameter: "number"'); } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof bundleIdentifier === 'undefined') { - throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + if (typeof otp === 'undefined') { + throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/project/platforms/apple'; + const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); const payload: Payload = {}; - if (typeof platformId !== 'undefined') { - payload['platformId'] = platformId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof bundleIdentifier !== 'undefined') { - payload['bundleIdentifier'] = bundleIdentifier; + if (typeof otp !== 'undefined') { + payload['otp'] = otp; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -669,7 +792,7 @@ export class Project { } return this.client.call( - 'post', + 'put', uri, apiHeaders, payload, @@ -677,63 +800,4400 @@ export class Project { } /** - * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * Delete a mock phone by its unique number. This endpoint removes the mock phone and its OTP configuration from the project. * - * @param {string} params.platformId - Platform ID. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @param {string} params.number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise<{}>} */ - updateApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + deleteMockPhone(params: { number: string }): Promise<{}>; /** - * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * Delete a mock phone by its unique number. This endpoint removes the mock phone and its OTP configuration from the project. * - * @param {string} platformId - Platform ID. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @param {string} number - Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteMockPhone(number: string): Promise<{}>; + deleteMockPhone( + paramsOrFirst: { number: string } | string + ): Promise<{}> { + let params: { number: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { number: string }; + } else { + params = { + number: paramsOrFirst as string + }; + } + + const number = params.number; + + if (typeof number === 'undefined') { + throw new AppwriteException('Missing required parameter: "number"'); + } + + const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listOAuth2Providers(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listOAuth2Providers(queries?: string[], total?: boolean): Promise; + listOAuth2Providers( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/oauth2'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. + * + * @param {ProviderId} params.providerId - OAuth2 provider key. For example: github, google, apple. + * @throws {AppwriteException} + * @returns {Promise} + */ + getOAuth2Provider(params: { providerId: ProviderId }): Promise; + /** + * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. + * + * @param {ProviderId} providerId - OAuth2 provider key. For example: github, google, apple. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getOAuth2Provider(providerId: ProviderId): Promise; + getOAuth2Provider( + paramsOrFirst: { providerId: ProviderId } | ProviderId + ): Promise { + let params: { providerId: ProviderId }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('providerId' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { providerId: ProviderId }; + } else { + params = { + providerId: paramsOrFirst as ProviderId + }; + } + + const providerId = params.providerId; + + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/project/oauth2/:provider'; + const payload: Payload = {}; + if (typeof providerId !== 'undefined') { + payload['providerId'] = providerId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Amazon configuration. + * + * @param {string} params.clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 + * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Amazon(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Amazon configuration. + * + * @param {string} clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 + * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Amazon(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Amazon( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/amazon'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Apple configuration. + * + * @param {string} params.serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web + * @param {string} params.keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 + * @param {string} params.teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 + * @param {string} params.p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Apple(params?: { serviceId?: string, keyId?: string, teamId?: string, p8File?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Apple configuration. + * + * @param {string} serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web + * @param {string} keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 + * @param {string} teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 + * @param {string} p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Apple(serviceId?: string, keyId?: string, teamId?: string, p8File?: string, enabled?: boolean): Promise; + updateOAuth2Apple( + paramsOrFirst?: { serviceId?: string, keyId?: string, teamId?: string, p8File?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { serviceId?: string, keyId?: string, teamId?: string, p8File?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { serviceId?: string, keyId?: string, teamId?: string, p8File?: string, enabled?: boolean }; + } else { + params = { + serviceId: paramsOrFirst as string, + keyId: rest[0] as string, + teamId: rest[1] as string, + p8File: rest[2] as string, + enabled: rest[3] as boolean + }; + } + + const serviceId = params.serviceId; + const keyId = params.keyId; + const teamId = params.teamId; + const p8File = params.p8File; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/apple'; + const payload: Payload = {}; + if (typeof serviceId !== 'undefined') { + payload['serviceId'] = serviceId; + } + if (typeof keyId !== 'undefined') { + payload['keyId'] = keyId; + } + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + if (typeof p8File !== 'undefined') { + payload['p8File'] = p8File; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Auth0 configuration. + * + * @param {string} params.clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq + * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} params.endpoint - Domain of Auth0 instance. For example: example.us.auth0.com + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Auth0(params?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Auth0 configuration. + * + * @param {string} clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq + * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} endpoint - Domain of Auth0 instance. For example: example.us.auth0.com + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Auth0(clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean): Promise; + updateOAuth2Auth0( + paramsOrFirst?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + endpoint: rest[1] as string, + enabled: rest[2] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const endpoint = params.endpoint; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/auth0'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof endpoint !== 'undefined') { + payload['endpoint'] = endpoint; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Authentik configuration. + * + * @param {string} params.clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv + * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} params.endpoint - Domain of Authentik instance. For example: example.authentik.com + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Authentik(params?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Authentik configuration. + * + * @param {string} clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv + * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} endpoint - Domain of Authentik instance. For example: example.authentik.com + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Authentik(clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean): Promise; + updateOAuth2Authentik( + paramsOrFirst?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + endpoint: rest[1] as string, + enabled: rest[2] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const endpoint = params.endpoint; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/authentik'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof endpoint !== 'undefined') { + payload['endpoint'] = endpoint; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Autodesk configuration. + * + * @param {string} params.clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 + * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Autodesk(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Autodesk configuration. + * + * @param {string} clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 + * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Autodesk(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Autodesk( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/autodesk'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Bitbucket configuration. + * + * @param {string} params.key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc + * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Bitbucket(params?: { key?: string, secret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Bitbucket configuration. + * + * @param {string} key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc + * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Bitbucket(key?: string, secret?: string, enabled?: boolean): Promise; + updateOAuth2Bitbucket( + paramsOrFirst?: { key?: string, secret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { key?: string, secret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { key?: string, secret?: string, enabled?: boolean }; + } else { + params = { + key: paramsOrFirst as string, + secret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const key = params.key; + const secret = params.secret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/bitbucket'; + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Bitly configuration. + * + * @param {string} params.clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b + * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Bitly(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Bitly configuration. + * + * @param {string} clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b + * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Bitly(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Bitly( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/bitly'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Box configuration. + * + * @param {string} params.clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y + * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Box(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Box configuration. + * + * @param {string} clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y + * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Box(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Box( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/box'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Dailymotion configuration. + * + * @param {string} params.apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f + * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Dailymotion(params?: { apiKey?: string, apiSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Dailymotion configuration. + * + * @param {string} apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f + * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Dailymotion(apiKey?: string, apiSecret?: string, enabled?: boolean): Promise; + updateOAuth2Dailymotion( + paramsOrFirst?: { apiKey?: string, apiSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { apiKey?: string, apiSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { apiKey?: string, apiSecret?: string, enabled?: boolean }; + } else { + params = { + apiKey: paramsOrFirst as string, + apiSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const apiKey = params.apiKey; + const apiSecret = params.apiSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/dailymotion'; + const payload: Payload = {}; + if (typeof apiKey !== 'undefined') { + payload['apiKey'] = apiKey; + } + if (typeof apiSecret !== 'undefined') { + payload['apiSecret'] = apiSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Discord configuration. + * + * @param {string} params.clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 + * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Discord(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Discord configuration. + * + * @param {string} clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 + * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Discord(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Discord( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/discord'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Disqus configuration. + * + * @param {string} params.publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX + * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Disqus(params?: { publicKey?: string, secretKey?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Disqus configuration. + * + * @param {string} publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX + * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Disqus(publicKey?: string, secretKey?: string, enabled?: boolean): Promise; + updateOAuth2Disqus( + paramsOrFirst?: { publicKey?: string, secretKey?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { publicKey?: string, secretKey?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { publicKey?: string, secretKey?: string, enabled?: boolean }; + } else { + params = { + publicKey: paramsOrFirst as string, + secretKey: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const publicKey = params.publicKey; + const secretKey = params.secretKey; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/disqus'; + const payload: Payload = {}; + if (typeof publicKey !== 'undefined') { + payload['publicKey'] = publicKey; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Dropbox configuration. + * + * @param {string} params.appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t + * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Dropbox(params?: { appKey?: string, appSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Dropbox configuration. + * + * @param {string} appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t + * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Dropbox(appKey?: string, appSecret?: string, enabled?: boolean): Promise; + updateOAuth2Dropbox( + paramsOrFirst?: { appKey?: string, appSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { appKey?: string, appSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appKey?: string, appSecret?: string, enabled?: boolean }; + } else { + params = { + appKey: paramsOrFirst as string, + appSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const appKey = params.appKey; + const appSecret = params.appSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/dropbox'; + const payload: Payload = {}; + if (typeof appKey !== 'undefined') { + payload['appKey'] = appKey; + } + if (typeof appSecret !== 'undefined') { + payload['appSecret'] = appSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Etsy configuration. + * + * @param {string} params.keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 + * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Etsy(params?: { keyString?: string, sharedSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Etsy configuration. + * + * @param {string} keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 + * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Etsy(keyString?: string, sharedSecret?: string, enabled?: boolean): Promise; + updateOAuth2Etsy( + paramsOrFirst?: { keyString?: string, sharedSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { keyString?: string, sharedSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyString?: string, sharedSecret?: string, enabled?: boolean }; + } else { + params = { + keyString: paramsOrFirst as string, + sharedSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const keyString = params.keyString; + const sharedSecret = params.sharedSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/etsy'; + const payload: Payload = {}; + if (typeof keyString !== 'undefined') { + payload['keyString'] = keyString; + } + if (typeof sharedSecret !== 'undefined') { + payload['sharedSecret'] = sharedSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Facebook configuration. + * + * @param {string} params.appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 + * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Facebook(params?: { appId?: string, appSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Facebook configuration. + * + * @param {string} appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 + * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Facebook(appId?: string, appSecret?: string, enabled?: boolean): Promise; + updateOAuth2Facebook( + paramsOrFirst?: { appId?: string, appSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { appId?: string, appSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId?: string, appSecret?: string, enabled?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + appSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const appId = params.appId; + const appSecret = params.appSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/facebook'; + const payload: Payload = {}; + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + if (typeof appSecret !== 'undefined') { + payload['appSecret'] = appSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Figma configuration. + * + * @param {string} params.clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 + * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Figma(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Figma configuration. + * + * @param {string} clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 + * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Figma(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Figma( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/figma'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 FusionAuth configuration. + * + * @param {string} params.clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 + * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} params.endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2FusionAuth(params?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 FusionAuth configuration. + * + * @param {string} clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 + * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2FusionAuth(clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean): Promise; + updateOAuth2FusionAuth( + paramsOrFirst?: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, endpoint?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + endpoint: rest[1] as string, + enabled: rest[2] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const endpoint = params.endpoint; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/fusionauth'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof endpoint !== 'undefined') { + payload['endpoint'] = endpoint; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 GitHub configuration. + * + * @param {string} params.clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 + * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2GitHub(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 GitHub configuration. + * + * @param {string} clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 + * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2GitHub(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2GitHub( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/github'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Gitlab configuration. + * + * @param {string} params.applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 + * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} params.endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Gitlab(params?: { applicationId?: string, secret?: string, endpoint?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Gitlab configuration. + * + * @param {string} applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 + * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Gitlab(applicationId?: string, secret?: string, endpoint?: string, enabled?: boolean): Promise; + updateOAuth2Gitlab( + paramsOrFirst?: { applicationId?: string, secret?: string, endpoint?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] + ): Promise { + let params: { applicationId?: string, secret?: string, endpoint?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { applicationId?: string, secret?: string, endpoint?: string, enabled?: boolean }; + } else { + params = { + applicationId: paramsOrFirst as string, + secret: rest[0] as string, + endpoint: rest[1] as string, + enabled: rest[2] as boolean + }; + } + + const applicationId = params.applicationId; + const secret = params.secret; + const endpoint = params.endpoint; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/gitlab'; + const payload: Payload = {}; + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + if (typeof endpoint !== 'undefined') { + payload['endpoint'] = endpoint; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Google configuration. + * + * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com + * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Google(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Google configuration. + * + * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com + * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Google(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Google( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/google'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Keycloak configuration. + * + * @param {string} params.clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app + * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string} params.endpoint - Domain of Keycloak instance. For example: keycloak.example.com + * @param {string} params.realmName - Keycloak realm name. For example: appwrite-realm + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Keycloak(params?: { clientId?: string, clientSecret?: string, endpoint?: string, realmName?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Keycloak configuration. + * + * @param {string} clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app + * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string} endpoint - Domain of Keycloak instance. For example: keycloak.example.com + * @param {string} realmName - Keycloak realm name. For example: appwrite-realm + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Keycloak(clientId?: string, clientSecret?: string, endpoint?: string, realmName?: string, enabled?: boolean): Promise; + updateOAuth2Keycloak( + paramsOrFirst?: { clientId?: string, clientSecret?: string, endpoint?: string, realmName?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, endpoint?: string, realmName?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, endpoint?: string, realmName?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + endpoint: rest[1] as string, + realmName: rest[2] as string, + enabled: rest[3] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const endpoint = params.endpoint; + const realmName = params.realmName; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/keycloak'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof endpoint !== 'undefined') { + payload['endpoint'] = endpoint; + } + if (typeof realmName !== 'undefined') { + payload['realmName'] = realmName; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Kick configuration. + * + * @param {string} params.clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 + * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Kick(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Kick configuration. + * + * @param {string} clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 + * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Kick(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Kick( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/kick'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Linkedin configuration. + * + * @param {string} params.clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv + * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Linkedin(params?: { clientId?: string, primaryClientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Linkedin configuration. + * + * @param {string} clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv + * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Linkedin(clientId?: string, primaryClientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Linkedin( + paramsOrFirst?: { clientId?: string, primaryClientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, primaryClientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, primaryClientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + primaryClientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const primaryClientSecret = params.primaryClientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/linkedin'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof primaryClientSecret !== 'undefined') { + payload['primaryClientSecret'] = primaryClientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Microsoft configuration. + * + * @param {string} params.applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 + * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string} params.tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Microsoft(params?: { applicationId?: string, applicationSecret?: string, tenant?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Microsoft configuration. + * + * @param {string} applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 + * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string} tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Microsoft(applicationId?: string, applicationSecret?: string, tenant?: string, enabled?: boolean): Promise; + updateOAuth2Microsoft( + paramsOrFirst?: { applicationId?: string, applicationSecret?: string, tenant?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] + ): Promise { + let params: { applicationId?: string, applicationSecret?: string, tenant?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { applicationId?: string, applicationSecret?: string, tenant?: string, enabled?: boolean }; + } else { + params = { + applicationId: paramsOrFirst as string, + applicationSecret: rest[0] as string, + tenant: rest[1] as string, + enabled: rest[2] as boolean + }; + } + + const applicationId = params.applicationId; + const applicationSecret = params.applicationSecret; + const tenant = params.tenant; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/microsoft'; + const payload: Payload = {}; + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + if (typeof applicationSecret !== 'undefined') { + payload['applicationSecret'] = applicationSecret; + } + if (typeof tenant !== 'undefined') { + payload['tenant'] = tenant; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Notion configuration. + * + * @param {string} params.oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 + * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Notion(params?: { oauthClientId?: string, oauthClientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Notion configuration. + * + * @param {string} oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 + * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Notion(oauthClientId?: string, oauthClientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Notion( + paramsOrFirst?: { oauthClientId?: string, oauthClientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { oauthClientId?: string, oauthClientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { oauthClientId?: string, oauthClientSecret?: string, enabled?: boolean }; + } else { + params = { + oauthClientId: paramsOrFirst as string, + oauthClientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const oauthClientId = params.oauthClientId; + const oauthClientSecret = params.oauthClientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/notion'; + const payload: Payload = {}; + if (typeof oauthClientId !== 'undefined') { + payload['oauthClientId'] = oauthClientId; + } + if (typeof oauthClientSecret !== 'undefined') { + payload['oauthClientSecret'] = oauthClientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Oidc configuration. + * + * @param {string} params.clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG + * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} params.wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration + * @param {string} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize + * @param {string} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token + * @param {string} params.userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Oidc(params?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Oidc configuration. + * + * @param {string} clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG + * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration + * @param {string} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize + * @param {string} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token + * @param {string} userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Oidc(clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean): Promise; + updateOAuth2Oidc( + paramsOrFirst?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + wellKnownURL: rest[1] as string, + authorizationURL: rest[2] as string, + tokenURL: rest[3] as string, + userInfoURL: rest[4] as string, + enabled: rest[5] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const wellKnownURL = params.wellKnownURL; + const authorizationURL = params.authorizationURL; + const tokenURL = params.tokenURL; + const userInfoURL = params.userInfoURL; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/oidc'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof wellKnownURL !== 'undefined') { + payload['wellKnownURL'] = wellKnownURL; + } + if (typeof authorizationURL !== 'undefined') { + payload['authorizationURL'] = authorizationURL; + } + if (typeof tokenURL !== 'undefined') { + payload['tokenURL'] = tokenURL; + } + if (typeof userInfoURL !== 'undefined') { + payload['userInfoURL'] = userInfoURL; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Okta configuration. + * + * @param {string} params.clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 + * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} params.domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ + * @param {string} params.authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Okta(params?: { clientId?: string, clientSecret?: string, domain?: string, authorizationServerId?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Okta configuration. + * + * @param {string} clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 + * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ + * @param {string} authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Okta(clientId?: string, clientSecret?: string, domain?: string, authorizationServerId?: string, enabled?: boolean): Promise; + updateOAuth2Okta( + paramsOrFirst?: { clientId?: string, clientSecret?: string, domain?: string, authorizationServerId?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, domain?: string, authorizationServerId?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, domain?: string, authorizationServerId?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + domain: rest[1] as string, + authorizationServerId: rest[2] as string, + enabled: rest[3] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const domain = params.domain; + const authorizationServerId = params.authorizationServerId; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/okta'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + if (typeof authorizationServerId !== 'undefined') { + payload['authorizationServerId'] = authorizationServerId; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Paypal configuration. + * + * @param {string} params.clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Paypal(params?: { clientId?: string, secretKey?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Paypal configuration. + * + * @param {string} clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Paypal(clientId?: string, secretKey?: string, enabled?: boolean): Promise; + updateOAuth2Paypal( + paramsOrFirst?: { clientId?: string, secretKey?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, secretKey?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, secretKey?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + secretKey: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const secretKey = params.secretKey; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/paypal'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 PaypalSandbox configuration. + * + * @param {string} params.clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2PaypalSandbox(params?: { clientId?: string, secretKey?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 PaypalSandbox configuration. + * + * @param {string} clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2PaypalSandbox(clientId?: string, secretKey?: string, enabled?: boolean): Promise; + updateOAuth2PaypalSandbox( + paramsOrFirst?: { clientId?: string, secretKey?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, secretKey?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, secretKey?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + secretKey: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const secretKey = params.secretKey; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/paypalSandbox'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Podio configuration. + * + * @param {string} params.clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app + * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Podio(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Podio configuration. + * + * @param {string} clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app + * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Podio(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Podio( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/podio'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Salesforce configuration. + * + * @param {string} params.customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq + * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Salesforce(params?: { customerKey?: string, customerSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Salesforce configuration. + * + * @param {string} customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq + * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Salesforce(customerKey?: string, customerSecret?: string, enabled?: boolean): Promise; + updateOAuth2Salesforce( + paramsOrFirst?: { customerKey?: string, customerSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { customerKey?: string, customerSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { customerKey?: string, customerSecret?: string, enabled?: boolean }; + } else { + params = { + customerKey: paramsOrFirst as string, + customerSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const customerKey = params.customerKey; + const customerSecret = params.customerSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/salesforce'; + const payload: Payload = {}; + if (typeof customerKey !== 'undefined') { + payload['customerKey'] = customerKey; + } + if (typeof customerSecret !== 'undefined') { + payload['customerSecret'] = customerSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Slack configuration. + * + * @param {string} params.clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 + * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Slack(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Slack configuration. + * + * @param {string} clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 + * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Slack(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Slack( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/slack'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Spotify configuration. + * + * @param {string} params.clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace + * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Spotify(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Spotify configuration. + * + * @param {string} clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace + * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Spotify(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Spotify( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/spotify'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Stripe configuration. + * + * @param {string} params.clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR + * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Stripe(params?: { clientId?: string, apiSecretKey?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Stripe configuration. + * + * @param {string} clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR + * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Stripe(clientId?: string, apiSecretKey?: string, enabled?: boolean): Promise; + updateOAuth2Stripe( + paramsOrFirst?: { clientId?: string, apiSecretKey?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, apiSecretKey?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, apiSecretKey?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + apiSecretKey: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const apiSecretKey = params.apiSecretKey; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/stripe'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof apiSecretKey !== 'undefined') { + payload['apiSecretKey'] = apiSecretKey; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Tradeshift configuration. + * + * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Tradeshift(params?: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Tradeshift configuration. + * + * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Tradeshift(oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Tradeshift( + paramsOrFirst?: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }; + } else { + params = { + oauth2ClientId: paramsOrFirst as string, + oauth2ClientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const oauth2ClientId = params.oauth2ClientId; + const oauth2ClientSecret = params.oauth2ClientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/tradeshift'; + const payload: Payload = {}; + if (typeof oauth2ClientId !== 'undefined') { + payload['oauth2ClientId'] = oauth2ClientId; + } + if (typeof oauth2ClientSecret !== 'undefined') { + payload['oauth2ClientSecret'] = oauth2ClientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Tradeshift Sandbox configuration. + * + * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2TradeshiftSandbox(params?: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Tradeshift Sandbox configuration. + * + * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2TradeshiftSandbox(oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean): Promise; + updateOAuth2TradeshiftSandbox( + paramsOrFirst?: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { oauth2ClientId?: string, oauth2ClientSecret?: string, enabled?: boolean }; + } else { + params = { + oauth2ClientId: paramsOrFirst as string, + oauth2ClientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const oauth2ClientId = params.oauth2ClientId; + const oauth2ClientSecret = params.oauth2ClientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/tradeshiftBox'; + const payload: Payload = {}; + if (typeof oauth2ClientId !== 'undefined') { + payload['oauth2ClientId'] = oauth2ClientId; + } + if (typeof oauth2ClientSecret !== 'undefined') { + payload['oauth2ClientSecret'] = oauth2ClientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Twitch configuration. + * + * @param {string} params.clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p + * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Twitch(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Twitch configuration. + * + * @param {string} clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p + * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Twitch(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Twitch( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/twitch'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 WordPress configuration. + * + * @param {string} params.clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 + * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2WordPress(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 WordPress configuration. + * + * @param {string} clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 + * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2WordPress(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2WordPress( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/wordpress'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 X configuration. + * + * @param {string} params.customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT + * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2X(params?: { customerKey?: string, secretKey?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 X configuration. + * + * @param {string} customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT + * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2X(customerKey?: string, secretKey?: string, enabled?: boolean): Promise; + updateOAuth2X( + paramsOrFirst?: { customerKey?: string, secretKey?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { customerKey?: string, secretKey?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { customerKey?: string, secretKey?: string, enabled?: boolean }; + } else { + params = { + customerKey: paramsOrFirst as string, + secretKey: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const customerKey = params.customerKey; + const secretKey = params.secretKey; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/x'; + const payload: Payload = {}; + if (typeof customerKey !== 'undefined') { + payload['customerKey'] = customerKey; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Yahoo configuration. + * + * @param {string} params.clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm + * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Yahoo(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Yahoo configuration. + * + * @param {string} clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm + * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Yahoo(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Yahoo( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/yahoo'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Yandex configuration. + * + * @param {string} params.clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c + * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Yandex(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Yandex configuration. + * + * @param {string} clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c + * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Yandex(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Yandex( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/yandex'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Zoho configuration. + * + * @param {string} params.clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B + * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Zoho(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Zoho configuration. + * + * @param {string} clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B + * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Zoho(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Zoho( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/zoho'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project OAuth2 Zoom configuration. + * + * @param {string} params.clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ + * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Zoom(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Zoom configuration. + * + * @param {string} clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ + * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Zoom(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Zoom( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/zoom'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPlatforms(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPlatforms(queries?: string[], total?: boolean): Promise; + listPlatforms( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/platforms'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + createAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + updateAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + createApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + updateApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + createLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + updateLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWebPlatform(platformId: string, name: string, hostname: string): Promise; + createWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWebPlatform(platformId: string, name: string, hostname: string): Promise; + updateWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + createWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + updateWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPlatform(params: { platformId: string }): Promise; + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPlatform(platformId: string): Promise; + getPlatform( + paramsOrFirst: { platformId: string } | string + ): Promise { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deletePlatform(params: { platformId: string }): Promise<{}>; + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deletePlatform(platformId: string): Promise<{}>; + deletePlatform( + paramsOrFirst: { platformId: string } | string + ): Promise<{}> { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all project policies and their current configuration. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPolicies(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all project policies and their current configuration. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPolicies(queries?: string[], total?: boolean): Promise; + listPolicies( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/policies'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members.. + * + * @param {boolean} params.userId - Set to true if you want make user ID visible to all team members, or false to hide it. + * @param {boolean} params.userEmail - Set to true if you want make user email visible to all team members, or false to hide it. + * @param {boolean} params.userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. + * @param {boolean} params.userName - Set to true if you want make user name visible to all team members, or false to hide it. + * @param {boolean} params.userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMembershipPrivacyPolicy(params?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }): Promise; + /** + * Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members.. + * + * @param {boolean} userId - Set to true if you want make user ID visible to all team members, or false to hide it. + * @param {boolean} userEmail - Set to true if you want make user email visible to all team members, or false to hide it. + * @param {boolean} userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. + * @param {boolean} userName - Set to true if you want make user name visible to all team members, or false to hide it. + * @param {boolean} userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateMembershipPrivacyPolicy(userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean): Promise; + updateMembershipPrivacyPolicy( + paramsOrFirst?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean } | boolean, + ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?] + ): Promise { + let params: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + } else { + params = { + userId: paramsOrFirst as boolean, + userEmail: rest[0] as boolean, + userPhone: rest[1] as boolean, + userName: rest[2] as boolean, + userMFA: rest[3] as boolean + }; + } + + const userId = params.userId; + const userEmail = params.userEmail; + const userPhone = params.userPhone; + const userName = params.userName; + const userMFA = params.userMFA; + + + const apiPath = '/project/policies/membership-privacy'; + const payload: Payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof userEmail !== 'undefined') { + payload['userEmail'] = userEmail; + } + if (typeof userPhone !== 'undefined') { + payload['userPhone'] = userPhone; + } + if (typeof userName !== 'undefined') { + payload['userName'] = userName; + } + if (typeof userMFA !== 'undefined') { + payload['userMFA'] = userMFA; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. + * + * @param {boolean} params.enabled - Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePasswordDictionaryPolicy(params: { enabled: boolean }): Promise; + /** + * Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. + * + * @param {boolean} enabled - Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePasswordDictionaryPolicy(enabled: boolean): Promise; + updatePasswordDictionaryPolicy( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/policies/password-dictionary'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery. + * + * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. + * + * @param {number} params.total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePasswordHistoryPolicy(params: { total?: number }): Promise; + /** + * Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery. + * + * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. + * + * @param {number} total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePasswordHistoryPolicy(total?: number): Promise; + updatePasswordHistoryPolicy( + paramsOrFirst?: { total?: number } | number + ): Promise { + let params: { total?: number }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { total?: number }; + } else { + params = { + total: paramsOrFirst as number + }; + } + + const total = params.total; + + if (typeof total === 'undefined') { + throw new AppwriteException('Missing required parameter: "total"'); + } + + const apiPath = '/project/policies/password-history'; + const payload: Payload = {}; + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number. + * + * @param {boolean} params.enabled - Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePasswordPersonalDataPolicy(params: { enabled: boolean }): Promise; + /** + * Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number. + * + * @param {boolean} enabled - Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePasswordPersonalDataPolicy(enabled: boolean): Promise; + updatePasswordPersonalDataPolicy( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/policies/password-personal-data'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled. + * + * @param {boolean} params.enabled - Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateSessionAlertPolicy(params: { enabled: boolean }): Promise; + /** + * Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled. + * + * @param {boolean} enabled - Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateSessionAlertPolicy(enabled: boolean): Promise; + updateSessionAlertPolicy( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/policies/session-alert'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update maximum duration how long sessions created within a project should stay active for. + * + * @param {number} params.duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateSessionDurationPolicy(params: { duration: number }): Promise; + /** + * Update maximum duration how long sessions created within a project should stay active for. + * + * @param {number} duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. + * @throws {AppwriteException} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; - updateApplePlatform( - paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, bundleIdentifier: string }; + updateSessionDurationPolicy(duration: number): Promise; + updateSessionDurationPolicy( + paramsOrFirst: { duration: number } | number + ): Promise { + let params: { duration: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + params = (paramsOrFirst || {}) as { duration: number }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - bundleIdentifier: rest[1] as string + duration: paramsOrFirst as number }; } - const platformId = params.platformId; - const name = params.name; - const bundleIdentifier = params.bundleIdentifier; + const duration = params.duration; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof bundleIdentifier === 'undefined') { - throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + if (typeof duration === 'undefined') { + throw new AppwriteException('Missing required parameter: "duration"'); } - const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/policies/session-duration'; const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof bundleIdentifier !== 'undefined') { - payload['bundleIdentifier'] = bundleIdentifier; + if (typeof duration !== 'undefined') { + payload['duration'] = duration; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -742,7 +5202,7 @@ export class Project { } return this.client.call( - 'put', + 'patch', uri, apiHeaders, payload, @@ -750,66 +5210,45 @@ export class Project { } /** - * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices. * - * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @param {boolean} params.enabled - Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + updateSessionInvalidationPolicy(params: { enabled: boolean }): Promise; /** - * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices. * - * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} packageName - Linux package name. Max length: 256 chars. + * @param {boolean} enabled - Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createLinuxPlatform(platformId: string, name: string, packageName: string): Promise; - createLinuxPlatform( - paramsOrFirst: { platformId: string, name: string, packageName: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, packageName: string }; + updateSessionInvalidationPolicy(enabled: boolean): Promise; + updateSessionInvalidationPolicy( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + params = (paramsOrFirst || {}) as { enabled: boolean }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - packageName: rest[1] as string + enabled: paramsOrFirst as boolean }; } - const platformId = params.platformId; - const name = params.name; - const packageName = params.packageName; + const enabled = params.enabled; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof packageName === 'undefined') { - throw new AppwriteException('Missing required parameter: "packageName"'); + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/platforms/linux'; + const apiPath = '/project/policies/session-invalidation'; const payload: Payload = {}; - if (typeof platformId !== 'undefined') { - payload['platformId'] = platformId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof packageName !== 'undefined') { - payload['packageName'] = packageName; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -818,7 +5257,7 @@ export class Project { } return this.client.call( - 'post', + 'patch', uri, apiHeaders, payload, @@ -826,63 +5265,45 @@ export class Project { } /** - * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one. * - * @param {string} params.platformId - Platform ID. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @param {number} params.total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + updateSessionLimitPolicy(params: { total?: number }): Promise; /** - * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one. * - * @param {string} platformId - Platform ID. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} packageName - Linux package name. Max length: 256 chars. + * @param {number} total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateLinuxPlatform(platformId: string, name: string, packageName: string): Promise; - updateLinuxPlatform( - paramsOrFirst: { platformId: string, name: string, packageName: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, packageName: string }; + updateSessionLimitPolicy(total?: number): Promise; + updateSessionLimitPolicy( + paramsOrFirst?: { total?: number } | number + ): Promise { + let params: { total?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + params = (paramsOrFirst || {}) as { total?: number }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - packageName: rest[1] as string + total: paramsOrFirst as number }; } - const platformId = params.platformId; - const name = params.name; - const packageName = params.packageName; + const total = params.total; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof packageName === 'undefined') { - throw new AppwriteException('Missing required parameter: "packageName"'); + if (typeof total === 'undefined') { + throw new AppwriteException('Missing required parameter: "total"'); } - const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/policies/session-limit'; const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof packageName !== 'undefined') { - payload['packageName'] = packageName; + if (typeof total !== 'undefined') { + payload['total'] = total; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -891,7 +5312,7 @@ export class Project { } return this.client.call( - 'put', + 'patch', uri, apiHeaders, payload, @@ -899,66 +5320,45 @@ export class Project { } /** - * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + updateUserLimitPolicy(params: { total?: number }): Promise; /** - * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createWebPlatform(platformId: string, name: string, hostname: string): Promise; - createWebPlatform( - paramsOrFirst: { platformId: string, name: string, hostname: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, hostname: string }; + updateUserLimitPolicy(total?: number): Promise; + updateUserLimitPolicy( + paramsOrFirst?: { total?: number } | number + ): Promise { + let params: { total?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + params = (paramsOrFirst || {}) as { total?: number }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - hostname: rest[1] as string + total: paramsOrFirst as number }; } - const platformId = params.platformId; - const name = params.name; - const hostname = params.hostname; + const total = params.total; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof hostname === 'undefined') { - throw new AppwriteException('Missing required parameter: "hostname"'); + if (typeof total === 'undefined') { + throw new AppwriteException('Missing required parameter: "total"'); } - const apiPath = '/project/platforms/web'; + const apiPath = '/project/policies/user-limit'; const payload: Payload = {}; - if (typeof platformId !== 'undefined') { - payload['platformId'] = platformId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof hostname !== 'undefined') { - payload['hostname'] = hostname; + if (typeof total !== 'undefined') { + payload['total'] = total; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -967,7 +5367,7 @@ export class Project { } return this.client.call( - 'post', + 'patch', uri, apiHeaders, payload, @@ -975,63 +5375,104 @@ export class Project { } /** - * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {string} params.platformId - Platform ID. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @param {PolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + getPolicy(params: { policyId: PolicyId }): Promise; /** - * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {string} platformId - Platform ID. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @param {PolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateWebPlatform(platformId: string, name: string, hostname: string): Promise; - updateWebPlatform( - paramsOrFirst: { platformId: string, name: string, hostname: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, hostname: string }; + getPolicy(policyId: PolicyId): Promise; + getPolicy( + paramsOrFirst: { policyId: PolicyId } | PolicyId + ): Promise { + let params: { policyId: PolicyId }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: PolicyId }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - hostname: rest[1] as string + policyId: paramsOrFirst as PolicyId }; } - const platformId = params.platformId; - const name = params.name; - const hostname = params.hostname; + const policyId = params.policyId; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + + const apiPath = '/project/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} params.protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} params.enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateProtocol(params: { protocolId: ProtocolId, enabled: boolean }): Promise; + /** + * Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateProtocol(protocolId: ProtocolId, enabled: boolean): Promise; + updateProtocol( + paramsOrFirst: { protocolId: ProtocolId, enabled: boolean } | ProtocolId, + ...rest: [(boolean)?] + ): Promise { + let params: { protocolId: ProtocolId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { protocolId: ProtocolId, enabled: boolean }; + } else { + params = { + protocolId: paramsOrFirst as ProtocolId, + enabled: rest[0] as boolean + }; + } + + const protocolId = params.protocolId; + const enabled = params.enabled; + + if (typeof protocolId === 'undefined') { + throw new AppwriteException('Missing required parameter: "protocolId"'); } - if (typeof hostname === 'undefined') { - throw new AppwriteException('Missing required parameter: "hostname"'); + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/protocols/{protocolId}'.replace('{protocolId}', protocolId); const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof hostname !== 'undefined') { - payload['hostname'] = hostname; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1040,7 +5481,7 @@ export class Project { } return this.client.call( - 'put', + 'patch', uri, apiHeaders, payload, @@ -1048,66 +5489,53 @@ export class Project { } /** - * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * Update properties of a specific service. Use this endpoint to enable or disable a service in your project. * - * @param {string} params.platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @param {ServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} params.enabled - Service status. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + updateService(params: { serviceId: ServiceId, enabled: boolean }): Promise; /** - * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * Update properties of a specific service. Use this endpoint to enable or disable a service in your project. * - * @param {string} platformId - Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @param {ServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} enabled - Service status. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; - createWindowsPlatform( - paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, packageIdentifierName: string }; + updateService(serviceId: ServiceId, enabled: boolean): Promise; + updateService( + paramsOrFirst: { serviceId: ServiceId, enabled: boolean } | ServiceId, + ...rest: [(boolean)?] + ): Promise { + let params: { serviceId: ServiceId, enabled: boolean }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { serviceId: ServiceId, enabled: boolean }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - packageIdentifierName: rest[1] as string + serviceId: paramsOrFirst as ServiceId, + enabled: rest[0] as boolean }; } - const platformId = params.platformId; - const name = params.name; - const packageIdentifierName = params.packageIdentifierName; + const serviceId = params.serviceId; + const enabled = params.enabled; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + if (typeof serviceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "serviceId"'); } - if (typeof packageIdentifierName === 'undefined') { - throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/platforms/windows'; + const apiPath = '/project/services/{serviceId}'.replace('{serviceId}', serviceId); const payload: Payload = {}; - if (typeof platformId !== 'undefined') { - payload['platformId'] = platformId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof packageIdentifierName !== 'undefined') { - payload['packageIdentifierName'] = packageIdentifierName; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1116,7 +5544,7 @@ export class Project { } return this.client.call( - 'post', + 'patch', uri, apiHeaders, payload, @@ -1124,63 +5552,106 @@ export class Project { } /** - * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. * - * @param {string} params.platformId - Platform ID. - * @param {string} params.name - Platform name. Max length: 128 chars. - * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @param {string} params.host - SMTP server hostname (domain) + * @param {number} params.port - SMTP server port + * @param {string} params.username - SMTP server username. Leave empty for no authorization. + * @param {string} params.password - SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). + * @param {string} params.senderEmail - Email address shown in inbox as the sender of the email. + * @param {string} params.senderName - Name shown in inbox as the sender of the email. + * @param {string} params.replyToEmail - Email used when user replies to the email. + * @param {string} params.replyToName - Name used when user replies to the email. + * @param {Secure} params.secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. + * @param {boolean} params.enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + updateSMTP(params?: { host?: string, port?: number, username?: string, password?: string, senderEmail?: string, senderName?: string, replyToEmail?: string, replyToName?: string, secure?: Secure, enabled?: boolean }): Promise; /** - * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. * - * @param {string} platformId - Platform ID. - * @param {string} name - Platform name. Max length: 128 chars. - * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @param {string} host - SMTP server hostname (domain) + * @param {number} port - SMTP server port + * @param {string} username - SMTP server username. Leave empty for no authorization. + * @param {string} password - SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). + * @param {string} senderEmail - Email address shown in inbox as the sender of the email. + * @param {string} senderName - Name shown in inbox as the sender of the email. + * @param {string} replyToEmail - Email used when user replies to the email. + * @param {string} replyToName - Name used when user replies to the email. + * @param {Secure} secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. + * @param {boolean} enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; - updateWindowsPlatform( - paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { platformId: string, name: string, packageIdentifierName: string }; + updateSMTP(host?: string, port?: number, username?: string, password?: string, senderEmail?: string, senderName?: string, replyToEmail?: string, replyToName?: string, secure?: Secure, enabled?: boolean): Promise; + updateSMTP( + paramsOrFirst?: { host?: string, port?: number, username?: string, password?: string, senderEmail?: string, senderName?: string, replyToEmail?: string, replyToName?: string, secure?: Secure, enabled?: boolean } | string, + ...rest: [(number)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (Secure)?, (boolean)?] + ): Promise { + let params: { host?: string, port?: number, username?: string, password?: string, senderEmail?: string, senderName?: string, replyToEmail?: string, replyToName?: string, secure?: Secure, enabled?: boolean }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { host?: string, port?: number, username?: string, password?: string, senderEmail?: string, senderName?: string, replyToEmail?: string, replyToName?: string, secure?: Secure, enabled?: boolean }; } else { params = { - platformId: paramsOrFirst as string, - name: rest[0] as string, - packageIdentifierName: rest[1] as string + host: paramsOrFirst as string, + port: rest[0] as number, + username: rest[1] as string, + password: rest[2] as string, + senderEmail: rest[3] as string, + senderName: rest[4] as string, + replyToEmail: rest[5] as string, + replyToName: rest[6] as string, + secure: rest[7] as Secure, + enabled: rest[8] as boolean }; } - const platformId = params.platformId; - const name = params.name; - const packageIdentifierName = params.packageIdentifierName; + const host = params.host; + const port = params.port; + const username = params.username; + const password = params.password; + const senderEmail = params.senderEmail; + const senderName = params.senderName; + const replyToEmail = params.replyToEmail; + const replyToName = params.replyToName; + const secure = params.secure; + const enabled = params.enabled; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); + + const apiPath = '/project/smtp'; + const payload: Payload = {}; + if (typeof host !== 'undefined') { + payload['host'] = host; } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + if (typeof port !== 'undefined') { + payload['port'] = port; } - if (typeof packageIdentifierName === 'undefined') { - throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + if (typeof username !== 'undefined') { + payload['username'] = username; } - - const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', platformId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; + if (typeof password !== 'undefined') { + payload['password'] = password; } - if (typeof packageIdentifierName !== 'undefined') { - payload['packageIdentifierName'] = packageIdentifierName; + if (typeof senderEmail !== 'undefined') { + payload['senderEmail'] = senderEmail; + } + if (typeof senderName !== 'undefined') { + payload['senderName'] = senderName; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; + } + if (typeof secure !== 'undefined') { + payload['secure'] = secure; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1189,7 +5660,7 @@ export class Project { } return this.client.call( - 'put', + 'patch', uri, apiHeaders, payload, @@ -1197,50 +5668,54 @@ export class Project { } /** - * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * Send a test email to verify SMTP configuration. * - * @param {string} params.platformId - Platform ID. + * @param {string[]} params.emails - Array of emails to send test email to. Maximum of 10 emails are allowed. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise<{}>} */ - getPlatform(params: { platformId: string }): Promise; + createSMTPTest(params: { emails: string[] }): Promise<{}>; /** - * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * Send a test email to verify SMTP configuration. * - * @param {string} platformId - Platform ID. + * @param {string[]} emails - Array of emails to send test email to. Maximum of 10 emails are allowed. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - getPlatform(platformId: string): Promise; - getPlatform( - paramsOrFirst: { platformId: string } | string - ): Promise { - let params: { platformId: string }; + createSMTPTest(emails: string[]): Promise<{}>; + createSMTPTest( + paramsOrFirst: { emails: string[] } | string[] + ): Promise<{}> { + let params: { emails: string[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string }; + params = (paramsOrFirst || {}) as { emails: string[] }; } else { params = { - platformId: paramsOrFirst as string + emails: paramsOrFirst as string[] }; } - const platformId = params.platformId; + const emails = params.emails; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); + if (typeof emails === 'undefined') { + throw new AppwriteException('Missing required parameter: "emails"'); } - const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/smtp/tests'; const payload: Payload = {}; + if (typeof emails !== 'undefined') { + payload['emails'] = emails; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', } return this.client.call( - 'get', + 'post', uri, apiHeaders, payload, @@ -1248,51 +5723,58 @@ export class Project { } /** - * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * Get a list of all custom email templates configured for the project. This endpoint returns an array of all configured email templates and their locales. * - * @param {string} params.platformId - Platform ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} */ - deletePlatform(params: { platformId: string }): Promise<{}>; + listEmailTemplates(params?: { queries?: string[], total?: boolean }): Promise; /** - * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * Get a list of all custom email templates configured for the project. This endpoint returns an array of all configured email templates and their locales. * - * @param {string} platformId - Platform ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - deletePlatform(platformId: string): Promise<{}>; - deletePlatform( - paramsOrFirst: { platformId: string } | string - ): Promise<{}> { - let params: { platformId: string }; + listEmailTemplates(queries?: string[], total?: boolean): Promise; + listEmailTemplates( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { platformId: string }; + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; } else { params = { - platformId: paramsOrFirst as string + queries: paramsOrFirst as string[], + total: rest[0] as boolean }; } - const platformId = params.platformId; + const queries = params.queries; + const total = params.total; - if (typeof platformId === 'undefined') { - throw new AppwriteException('Missing required parameter: "platformId"'); - } - const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/templates/email'; const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( - 'delete', + 'get', uri, apiHeaders, payload, @@ -1300,53 +5782,95 @@ export class Project { } /** - * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. * - * @param {ProtocolId} params.protocolId - Protocol name. Can be one of: rest, graphql, websocket - * @param {boolean} params.enabled - Protocol status. + * @param {EmailTemplateType} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {EmailTemplateLocale} params.locale - Custom email template locale. If left empty, the fallback locale (en) will be used. + * @param {string} params.subject - Subject of the email template. Can be up to 255 characters. + * @param {string} params.message - Plain or HTML body of the email template message. Can be up to 10MB of content. + * @param {string} params.senderName - Name of the email sender. + * @param {string} params.senderEmail - Email of the sender. + * @param {string} params.replyToEmail - Reply to email. + * @param {string} params.replyToName - Reply to name. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateProtocolStatus(params: { protocolId: ProtocolId, enabled: boolean }): Promise; + updateEmailTemplate(params: { templateId: EmailTemplateType, locale?: EmailTemplateLocale, subject?: string, message?: string, senderName?: string, senderEmail?: string, replyToEmail?: string, replyToName?: string }): Promise; /** - * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. * - * @param {ProtocolId} protocolId - Protocol name. Can be one of: rest, graphql, websocket - * @param {boolean} enabled - Protocol status. + * @param {EmailTemplateType} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {EmailTemplateLocale} locale - Custom email template locale. If left empty, the fallback locale (en) will be used. + * @param {string} subject - Subject of the email template. Can be up to 255 characters. + * @param {string} message - Plain or HTML body of the email template message. Can be up to 10MB of content. + * @param {string} senderName - Name of the email sender. + * @param {string} senderEmail - Email of the sender. + * @param {string} replyToEmail - Reply to email. + * @param {string} replyToName - Reply to name. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateProtocolStatus(protocolId: ProtocolId, enabled: boolean): Promise; - updateProtocolStatus( - paramsOrFirst: { protocolId: ProtocolId, enabled: boolean } | ProtocolId, - ...rest: [(boolean)?] - ): Promise { - let params: { protocolId: ProtocolId, enabled: boolean }; + updateEmailTemplate(templateId: EmailTemplateType, locale?: EmailTemplateLocale, subject?: string, message?: string, senderName?: string, senderEmail?: string, replyToEmail?: string, replyToName?: string): Promise; + updateEmailTemplate( + paramsOrFirst: { templateId: EmailTemplateType, locale?: EmailTemplateLocale, subject?: string, message?: string, senderName?: string, senderEmail?: string, replyToEmail?: string, replyToName?: string } | EmailTemplateType, + ...rest: [(EmailTemplateLocale)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { templateId: EmailTemplateType, locale?: EmailTemplateLocale, subject?: string, message?: string, senderName?: string, senderEmail?: string, replyToEmail?: string, replyToName?: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { protocolId: ProtocolId, enabled: boolean }; + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst || 'subject' in paramsOrFirst || 'message' in paramsOrFirst || 'senderName' in paramsOrFirst || 'senderEmail' in paramsOrFirst || 'replyToEmail' in paramsOrFirst || 'replyToName' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { templateId: EmailTemplateType, locale?: EmailTemplateLocale, subject?: string, message?: string, senderName?: string, senderEmail?: string, replyToEmail?: string, replyToName?: string }; } else { params = { - protocolId: paramsOrFirst as ProtocolId, - enabled: rest[0] as boolean + templateId: paramsOrFirst as EmailTemplateType, + locale: rest[0] as EmailTemplateLocale, + subject: rest[1] as string, + message: rest[2] as string, + senderName: rest[3] as string, + senderEmail: rest[4] as string, + replyToEmail: rest[5] as string, + replyToName: rest[6] as string }; } - const protocolId = params.protocolId; - const enabled = params.enabled; + const templateId = params.templateId; + const locale = params.locale; + const subject = params.subject; + const message = params.message; + const senderName = params.senderName; + const senderEmail = params.senderEmail; + const replyToEmail = params.replyToEmail; + const replyToName = params.replyToName; - if (typeof protocolId === 'undefined') { - throw new AppwriteException('Missing required parameter: "protocolId"'); - } - if (typeof enabled === 'undefined') { - throw new AppwriteException('Missing required parameter: "enabled"'); + if (typeof templateId === 'undefined') { + throw new AppwriteException('Missing required parameter: "templateId"'); } - const apiPath = '/project/protocols/{protocolId}/status'.replace('{protocolId}', protocolId); + const apiPath = '/project/templates/email'; const payload: Payload = {}; - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; + if (typeof templateId !== 'undefined') { + payload['templateId'] = templateId; + } + if (typeof locale !== 'undefined') { + payload['locale'] = locale; + } + if (typeof subject !== 'undefined') { + payload['subject'] = subject; + } + if (typeof message !== 'undefined') { + payload['message'] = message; + } + if (typeof senderName !== 'undefined') { + payload['senderName'] = senderName; + } + if (typeof senderEmail !== 'undefined') { + payload['senderEmail'] = senderEmail; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1363,62 +5887,58 @@ export class Project { } /** - * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. * - * @param {ServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging - * @param {boolean} params.enabled - Service status. + * @param {EmailTemplateType} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {EmailTemplateLocale} params.locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateServiceStatus(params: { serviceId: ServiceId, enabled: boolean }): Promise; + getEmailTemplate(params: { templateId: EmailTemplateType, locale?: EmailTemplateLocale }): Promise; /** - * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. * - * @param {ServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging - * @param {boolean} enabled - Service status. + * @param {EmailTemplateType} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {EmailTemplateLocale} locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateServiceStatus(serviceId: ServiceId, enabled: boolean): Promise; - updateServiceStatus( - paramsOrFirst: { serviceId: ServiceId, enabled: boolean } | ServiceId, - ...rest: [(boolean)?] - ): Promise { - let params: { serviceId: ServiceId, enabled: boolean }; + getEmailTemplate(templateId: EmailTemplateType, locale?: EmailTemplateLocale): Promise; + getEmailTemplate( + paramsOrFirst: { templateId: EmailTemplateType, locale?: EmailTemplateLocale } | EmailTemplateType, + ...rest: [(EmailTemplateLocale)?] + ): Promise { + let params: { templateId: EmailTemplateType, locale?: EmailTemplateLocale }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { serviceId: ServiceId, enabled: boolean }; + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { templateId: EmailTemplateType, locale?: EmailTemplateLocale }; } else { params = { - serviceId: paramsOrFirst as ServiceId, - enabled: rest[0] as boolean + templateId: paramsOrFirst as EmailTemplateType, + locale: rest[0] as EmailTemplateLocale }; } - const serviceId = params.serviceId; - const enabled = params.enabled; + const templateId = params.templateId; + const locale = params.locale; - if (typeof serviceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "serviceId"'); - } - if (typeof enabled === 'undefined') { - throw new AppwriteException('Missing required parameter: "enabled"'); + if (typeof templateId === 'undefined') { + throw new AppwriteException('Missing required parameter: "templateId"'); } - const apiPath = '/project/services/{serviceId}/status'.replace('{serviceId}', serviceId); + const apiPath = '/project/templates/email/{templateId}'.replace('{templateId}', templateId); const payload: Payload = {}; - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; + if (typeof locale !== 'undefined') { + payload['locale'] = locale; } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( - 'patch', + 'get', uri, apiHeaders, payload, @@ -1487,7 +6007,7 @@ export class Project { /** * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. * - * @param {string} params.variableId - Variable 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.variableId - Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -1498,7 +6018,7 @@ export class Project { /** * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. * - * @param {string} variableId - Variable 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} variableId - Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -1570,7 +6090,7 @@ export class Project { /** * Get a variable by its unique ID. * - * @param {string} params.variableId - Variable ID. + * @param {string} params.variableId - Variable unique ID. * @throws {AppwriteException} * @returns {Promise} */ @@ -1578,7 +6098,7 @@ export class Project { /** * Get a variable by its unique ID. * - * @param {string} variableId - Variable ID. + * @param {string} variableId - Variable unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -1621,7 +6141,7 @@ export class Project { /** * Update variable by its unique ID. * - * @param {string} params.variableId - Variable ID. + * @param {string} params.variableId - Variable unique ID. * @param {string} params.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -1632,7 +6152,7 @@ export class Project { /** * Update variable by its unique ID. * - * @param {string} variableId - Variable ID. + * @param {string} variableId - Variable unique ID. * @param {string} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -1695,7 +6215,7 @@ export class Project { /** * Delete a variable by its unique ID. * - * @param {string} params.variableId - Variable ID. + * @param {string} params.variableId - Variable unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ @@ -1703,7 +6223,7 @@ export class Project { /** * Delete a variable by its unique ID. * - * @param {string} variableId - Variable ID. + * @param {string} variableId - Variable unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/proxy.ts b/src/services/proxy.ts new file mode 100644 index 00000000..83e4ecc8 --- /dev/null +++ b/src/services/proxy.ts @@ -0,0 +1,541 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +import { StatusCode } from '../enums/status-code'; +import { ProxyResourceType } from '../enums/proxy-resource-type'; + +export class Proxy { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Get a list of all the proxy rules. You can use the query params to filter your results. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listRules(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all the proxy rules. You can use the query params to filter your results. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch + * @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. + */ + listRules(queries?: string[], total?: boolean): Promise; + listRules( + 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 = '/proxy/rules'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new proxy rule for serving Appwrite's API on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} params.domain - Domain name. + * @throws {AppwriteException} + * @returns {Promise} + */ + createAPIRule(params: { domain: string }): Promise; + /** + * Create a new proxy rule for serving Appwrite's API on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} domain - Domain name. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createAPIRule(domain: string): Promise; + createAPIRule( + paramsOrFirst: { domain: string } | string + ): Promise { + let params: { domain: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domain: string }; + } else { + params = { + domain: paramsOrFirst as string + }; + } + + const domain = params.domain; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + + const apiPath = '/proxy/rules/api'; + const payload: Payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new proxy rule for executing Appwrite Function on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} params.domain - Domain name. + * @param {string} params.functionId - ID of function to be executed. + * @param {string} params.branch - Name of VCS branch to deploy changes automatically + * @throws {AppwriteException} + * @returns {Promise} + */ + createFunctionRule(params: { domain: string, functionId: string, branch?: string }): Promise; + /** + * Create a new proxy rule for executing Appwrite Function on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} domain - Domain name. + * @param {string} functionId - ID of function to be executed. + * @param {string} branch - Name of VCS branch to deploy changes automatically + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createFunctionRule(domain: string, functionId: string, branch?: string): Promise; + createFunctionRule( + paramsOrFirst: { domain: string, functionId: string, branch?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { domain: string, functionId: string, branch?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domain: string, functionId: string, branch?: string }; + } else { + params = { + domain: paramsOrFirst as string, + functionId: rest[0] as string, + branch: rest[1] as string + }; + } + + const domain = params.domain; + const functionId = params.functionId; + const branch = params.branch; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + if (typeof functionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + + const apiPath = '/proxy/rules/function'; + const payload: Payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + if (typeof functionId !== 'undefined') { + payload['functionId'] = functionId; + } + if (typeof branch !== 'undefined') { + payload['branch'] = branch; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new proxy rule for to redirect from custom domain to another domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} params.domain - Domain name. + * @param {string} params.url - Target URL of redirection + * @param {StatusCode} params.statusCode - Status code of redirection + * @param {string} params.resourceId - ID of parent resource. + * @param {ProxyResourceType} params.resourceType - Type of parent resource. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRedirectRule(params: { domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType }): Promise; + /** + * Create a new proxy rule for to redirect from custom domain to another domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} domain - Domain name. + * @param {string} url - Target URL of redirection + * @param {StatusCode} statusCode - Status code of redirection + * @param {string} resourceId - ID of parent resource. + * @param {ProxyResourceType} resourceType - Type of parent resource. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRedirectRule(domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType): Promise; + createRedirectRule( + paramsOrFirst: { domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType } | string, + ...rest: [(string)?, (StatusCode)?, (string)?, (ProxyResourceType)?] + ): Promise { + let params: { domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType }; + } else { + params = { + domain: paramsOrFirst as string, + url: rest[0] as string, + statusCode: rest[1] as StatusCode, + resourceId: rest[2] as string, + resourceType: rest[3] as ProxyResourceType + }; + } + + const domain = params.domain; + const url = params.url; + const statusCode = params.statusCode; + const resourceId = params.resourceId; + const resourceType = params.resourceType; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + if (typeof url === 'undefined') { + throw new AppwriteException('Missing required parameter: "url"'); + } + if (typeof statusCode === 'undefined') { + throw new AppwriteException('Missing required parameter: "statusCode"'); + } + if (typeof resourceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "resourceId"'); + } + if (typeof resourceType === 'undefined') { + throw new AppwriteException('Missing required parameter: "resourceType"'); + } + + const apiPath = '/proxy/rules/redirect'; + const payload: Payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof statusCode !== 'undefined') { + payload['statusCode'] = statusCode; + } + if (typeof resourceId !== 'undefined') { + payload['resourceId'] = resourceId; + } + if (typeof resourceType !== 'undefined') { + payload['resourceType'] = resourceType; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new proxy rule for serving Appwrite Site on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} params.domain - Domain name. + * @param {string} params.siteId - ID of site to be executed. + * @param {string} params.branch - Name of VCS branch to deploy changes automatically + * @throws {AppwriteException} + * @returns {Promise} + */ + createSiteRule(params: { domain: string, siteId: string, branch?: string }): Promise; + /** + * Create a new proxy rule for serving Appwrite Site on custom domain. + * + * Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. + * + * @param {string} domain - Domain name. + * @param {string} siteId - ID of site to be executed. + * @param {string} branch - Name of VCS branch to deploy changes automatically + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createSiteRule(domain: string, siteId: string, branch?: string): Promise; + createSiteRule( + paramsOrFirst: { domain: string, siteId: string, branch?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { domain: string, siteId: string, branch?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domain: string, siteId: string, branch?: string }; + } else { + params = { + domain: paramsOrFirst as string, + siteId: rest[0] as string, + branch: rest[1] as string + }; + } + + const domain = params.domain; + const siteId = params.siteId; + const branch = params.branch; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + + const apiPath = '/proxy/rules/site'; + const payload: Payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + if (typeof siteId !== 'undefined') { + payload['siteId'] = siteId; + } + if (typeof branch !== 'undefined') { + payload['branch'] = branch; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a proxy rule by its unique ID. + * + * @param {string} params.ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getRule(params: { ruleId: string }): Promise; + /** + * Get a proxy rule by its unique ID. + * + * @param {string} ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getRule(ruleId: string): Promise; + getRule( + paramsOrFirst: { ruleId: string } | string + ): Promise { + let params: { ruleId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { ruleId: string }; + } else { + params = { + ruleId: paramsOrFirst as string + }; + } + + const ruleId = params.ruleId; + + if (typeof ruleId === 'undefined') { + throw new AppwriteException('Missing required parameter: "ruleId"'); + } + + const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a proxy rule by its unique ID. + * + * @param {string} params.ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteRule(params: { ruleId: string }): Promise<{}>; + /** + * Delete a proxy rule by its unique ID. + * + * @param {string} ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteRule(ruleId: string): Promise<{}>; + deleteRule( + paramsOrFirst: { ruleId: string } | string + ): Promise<{}> { + let params: { ruleId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { ruleId: string }; + } else { + params = { + ruleId: paramsOrFirst as string + }; + } + + const ruleId = params.ruleId; + + if (typeof ruleId === 'undefined') { + throw new AppwriteException('Missing required parameter: "ruleId"'); + } + + const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background. + * + * @param {string} params.ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRuleStatus(params: { ruleId: string }): Promise; + /** + * If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background. + * + * @param {string} ruleId - Rule ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRuleStatus(ruleId: string): Promise; + updateRuleStatus( + paramsOrFirst: { ruleId: string } | string + ): Promise { + let params: { ruleId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { ruleId: string }; + } else { + params = { + ruleId: paramsOrFirst as string + }; + } + + const ruleId = params.ruleId; + + if (typeof ruleId === 'undefined') { + throw new AppwriteException('Missing required parameter: "ruleId"'); + } + + const apiPath = '/proxy/rules/{ruleId}/status'.replace('{ruleId}', ruleId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/sites.ts b/src/services/sites.ts index 4ae79aaf..a45f6478 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -1,6 +1,8 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { InputFile } from '../inputFile'; + import { Framework } from '../enums/framework'; import { BuildRuntime } from '../enums/build-runtime'; import { Adapter } from '../enums/adapter'; @@ -774,7 +776,7 @@ export class Sites { * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. * * @param {string} params.siteId - Site ID. - * @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + * @param {File | InputFile} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. * @param {string} params.installCommand - Install Commands. * @param {string} params.buildCommand - Build Commands. * @param {string} params.outputDirectory - Output Directory. @@ -782,12 +784,12 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - createDeployment(params: { siteId: string, code: File, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void }): Promise; + createDeployment(params: { siteId: string, code: File | InputFile, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void }): Promise; /** * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. * * @param {string} siteId - Site ID. - * @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + * @param {File | InputFile} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. * @param {string} installCommand - Install Commands. * @param {string} buildCommand - Build Commands. * @param {string} outputDirectory - Output Directory. @@ -796,21 +798,21 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createDeployment(siteId: string, code: File, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void): Promise; + createDeployment(siteId: string, code: File | InputFile, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void): Promise; createDeployment( - paramsOrFirst: { siteId: string, code: File, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(File)?, (string)?, (string)?, (string)?, (boolean)?,((progress: UploadProgress) => void)?] + paramsOrFirst: { siteId: string, code: File | InputFile, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean, onProgress?: (progress: UploadProgress) => void } | string, + ...rest: [(File | InputFile)?, (string)?, (string)?, (string)?, (boolean)?,((progress: UploadProgress) => void)?] ): Promise { - let params: { siteId: string, code: File, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean }; + let params: { siteId: string, code: File | InputFile, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean }; let onProgress: ((progress: UploadProgress) => void); if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, code: File, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean }; + params = (paramsOrFirst || {}) as { siteId: string, code: File | InputFile, installCommand?: string, buildCommand?: string, outputDirectory?: string, activate?: boolean }; onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { siteId: paramsOrFirst as string, - code: rest[0] as File, + code: rest[0] as File | InputFile, installCommand: rest[1] as string, buildCommand: rest[2] as string, outputDirectory: rest[3] as string, @@ -1561,33 +1563,42 @@ export class Sites { * Get a list of all variables of a specific site. * * @param {string} params.siteId - Site 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. You may filter on the following attributes: key, resourceType, resourceId, secret + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ - listVariables(params: { siteId: string }): Promise; + listVariables(params: { siteId: string, queries?: string[], total?: boolean }): Promise; /** * Get a list of all variables of a specific site. * * @param {string} siteId - Site 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. You may filter on the following attributes: key, resourceType, resourceId, secret + * @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. */ - listVariables(siteId: string): Promise; + listVariables(siteId: string, queries?: string[], total?: boolean): Promise; listVariables( - paramsOrFirst: { siteId: string } | string + paramsOrFirst: { siteId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] ): Promise { - let params: { siteId: string }; + let params: { siteId: string, queries?: string[], total?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string }; + params = (paramsOrFirst || {}) as { siteId: string, queries?: string[], total?: boolean }; } else { params = { - siteId: paramsOrFirst as string + siteId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean }; } const siteId = params.siteId; + const queries = params.queries; + const total = params.total; if (typeof siteId === 'undefined') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -1595,6 +1606,12 @@ export class Sites { const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1612,17 +1629,19 @@ export class Sites { * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. * * @param {string} params.siteId - Site unique ID. + * @param {string} params.variableId - Variable 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.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. * @throws {AppwriteException} * @returns {Promise} */ - createVariable(params: { siteId: string, key: string, value: string, secret?: boolean }): Promise; + createVariable(params: { siteId: string, variableId: string, key: string, value: string, secret?: boolean }): Promise; /** * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. * * @param {string} siteId - Site unique ID. + * @param {string} variableId - Variable 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} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. @@ -1630,25 +1649,27 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise; + createVariable(siteId: string, variableId: string, key: string, value: string, secret?: boolean): Promise; createVariable( - paramsOrFirst: { siteId: string, key: string, value: string, secret?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?] + paramsOrFirst: { siteId: string, variableId: string, key: string, value: string, secret?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { siteId: string, key: string, value: string, secret?: boolean }; + let params: { siteId: string, variableId: string, key: string, value: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, key: string, value: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { siteId: string, variableId: string, key: string, value: string, secret?: boolean }; } else { params = { siteId: paramsOrFirst as string, - key: rest[0] as string, - value: rest[1] as string, - secret: rest[2] as boolean + variableId: rest[0] as string, + key: rest[1] as string, + value: rest[2] as string, + secret: rest[3] as boolean }; } const siteId = params.siteId; + const variableId = params.variableId; const key = params.key; const value = params.value; const secret = params.secret; @@ -1656,6 +1677,9 @@ export class Sites { if (typeof siteId === 'undefined') { throw new AppwriteException('Missing required parameter: "siteId"'); } + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } @@ -1665,6 +1689,9 @@ export class Sites { const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); const payload: Payload = {}; + if (typeof variableId !== 'undefined') { + payload['variableId'] = variableId; + } if (typeof key !== 'undefined') { payload['key'] = key; } @@ -1758,7 +1785,7 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - updateVariable(params: { siteId: string, variableId: string, key: string, value?: string, secret?: boolean }): Promise; + updateVariable(params: { siteId: string, variableId: string, key?: string, value?: string, secret?: boolean }): Promise; /** * Update variable by its unique ID. * @@ -1771,15 +1798,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise; + updateVariable(siteId: string, variableId: string, key?: string, value?: string, secret?: boolean): Promise; updateVariable( - paramsOrFirst: { siteId: string, variableId: string, key: string, value?: string, secret?: boolean } | string, + paramsOrFirst: { siteId: string, variableId: string, key?: string, value?: string, secret?: boolean } | string, ...rest: [(string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { siteId: string, variableId: string, key: string, value?: string, secret?: boolean }; + let params: { siteId: string, variableId: string, key?: string, value?: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, variableId: string, key: string, value?: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { siteId: string, variableId: string, key?: string, value?: string, secret?: boolean }; } else { params = { siteId: paramsOrFirst as string, @@ -1802,9 +1829,6 @@ export class Sites { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); const payload: Payload = {}; diff --git a/src/services/storage.ts b/src/services/storage.ts index 794ac76d..f38792b7 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -1,6 +1,8 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { InputFile } from '../inputFile'; + import { Compression } from '../enums/compression'; import { ImageGravity } from '../enums/image-gravity'; import { ImageFormat } from '../enums/image-format'; @@ -521,12 +523,12 @@ export class Storage { * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {File} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). + * @param {File | InputFile} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @throws {AppwriteException} * @returns {Promise} */ - createFile(params: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void }): Promise; + createFile(params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void }): Promise; /** * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. * @@ -539,28 +541,28 @@ export class Storage { * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {File} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). + * @param {File | InputFile} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise; + createFile(bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise; createFile( - paramsOrFirst: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(string)?, (File)?, (string[])?,((progress: UploadProgress) => void)?] + paramsOrFirst: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string, + ...rest: [(string)?, (File | InputFile)?, (string[])?,((progress: UploadProgress) => void)?] ): Promise { - let params: { bucketId: string, fileId: string, file: File, permissions?: string[] }; + let params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[] }; let onProgress: ((progress: UploadProgress) => void); if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File, permissions?: string[] }; + params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[] }; onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - file: rest[1] as File, + file: rest[1] as File | InputFile, permissions: rest[2] as string[] }; onProgress = rest[3] as ((progress: UploadProgress) => void); diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 6ec5cf43..40766d5e 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { RelationshipType } from '../enums/relationship-type'; import { RelationMutate } from '../enums/relation-mutate'; import { TablesDBIndexType } from '../enums/tables-db-index-type'; @@ -1125,6 +1126,226 @@ export class TablesDB { ); } + /** + * Create a bigint column. Optionally, minimum and maximum values can be provided. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.tableId - Table ID. + * @param {string} params.key - Column Key. + * @param {boolean} params.required - Is column required? + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required. + * @param {boolean} params.array - Is column an array? + * @throws {AppwriteException} + * @returns {Promise} + */ + createBigIntColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; + /** + * Create a bigint column. Optionally, minimum and maximum values can be provided. + * + * + * @param {string} databaseId - Database ID. + * @param {string} tableId - Table ID. + * @param {string} key - Column Key. + * @param {boolean} required - Is column required? + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when column is required. + * @param {boolean} array - Is column an array? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createBigIntColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; + createBigIntColumn( + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] + ): Promise { + let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + tableId: rest[0] as string, + key: rest[1] as string, + required: rest[2] as boolean, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, + array: rest[6] as boolean + }; + } + + const databaseId = params.databaseId; + const tableId = params.tableId; + const key = params.key; + const required = params.required; + const min = params.min; + const max = params.max; + const xdefault = params.xdefault; + const array = params.array; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a bigint column. Changing the `default` value will not update already existing rows. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.tableId - Table ID. + * @param {string} params.key - Column Key. + * @param {boolean} params.required - Is column required? + * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {string} params.newKey - New Column Key. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateBigIntColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; + /** + * Update a bigint column. Changing the `default` value will not update already existing rows. + * + * + * @param {string} databaseId - Database ID. + * @param {string} tableId - Table ID. + * @param {string} key - Column Key. + * @param {boolean} required - Is column required? + * @param {number | bigint} xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {string} newKey - New Column Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateBigIntColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; + updateBigIntColumn( + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] + ): Promise { + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + tableId: rest[0] as string, + key: rest[1] as string, + required: rest[2] as boolean, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, + newKey: rest[6] as string + }; + } + + const databaseId = params.databaseId; + const tableId = params.tableId; + const key = params.key; + const required = params.required; + const xdefault = params.xdefault; + const min = params.min; + const max = params.max; + const newKey = params.newKey; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof tableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tableId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof required === 'undefined') { + throw new AppwriteException('Missing required parameter: "required"'); + } + if (typeof xdefault === 'undefined') { + throw new AppwriteException('Missing required parameter: "xdefault"'); + } + + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const payload: Payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Create a boolean column. * diff --git a/src/services/teams.ts b/src/services/teams.ts index 0666aec8..21e81152 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Teams { client: Client; diff --git a/src/services/tokens.ts b/src/services/tokens.ts index e092894f..1e453a72 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Tokens { client: Client; diff --git a/src/services/users.ts b/src/services/users.ts index 7bef1693..19faa4d1 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; + import { PasswordHash } from '../enums/password-hash'; import { AuthenticatorType } from '../enums/authenticator-type'; import { MessagingProviderType } from '../enums/messaging-provider-type'; diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index ddad942e..796cc425 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; + export class Webhooks { client: Client; diff --git a/test/services/databases.test.js b/test/services/databases.test.js index 26c78bac..241f44f8 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -344,6 +344,55 @@ describe('Databases', () => { expect(response).toEqual(data); }); + test('test method createBigIntAttribute()', async () => { + const data = { + 'key': 'count', + 'type': 'bigint', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await databases.createBigIntAttribute( + '', + '', + '', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateBigIntAttribute()', async () => { + const data = { + 'key': 'count', + 'type': 'bigint', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await databases.updateBigIntAttribute( + '', + '', + '', + true, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createBooleanAttribute()', async () => { const data = { 'key': 'isEnabled', diff --git a/test/services/functions.test.js b/test/services/functions.test.js index 0fcdc022..f5e19c8d 100644 --- a/test/services/functions.test.js +++ b/test/services/functions.test.js @@ -677,6 +677,7 @@ describe('Functions', () => { const response = await functions.createVariable( '', + '', '', '', ); @@ -725,7 +726,6 @@ describe('Functions', () => { const response = await functions.updateVariable( '', '', - '', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/project.test.js b/test/services/project.test.js index 05131b5b..06fe2715 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -10,6 +10,115 @@ describe('Project', () => { const project = new Project(client); + test('test method delete()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.delete( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateAuthMethod()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateAuthMethod( + 'email-password', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listKeys()', async () => { const data = { 'total': 5, @@ -50,6 +159,30 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method createEphemeralKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createEphemeralKey( + [], + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getKey()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -142,6 +275,8 @@ describe('Project', () => { 'authMembershipsUserName': true, 'authMembershipsUserEmail': true, 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, 'authInvalidateSessions': true, 'oAuthProviders': [], 'platforms': [], @@ -151,11 +286,12 @@ describe('Project', () => { 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', + 'smtpPassword': '', 'smtpSecure': 'tls', 'pingCount': 1, 'pingedAt': '2020-10-15T06:38:00.000+00:00', @@ -204,13 +340,13 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method listPlatforms()', async () => { + test('test method listMockPhones()', async () => { const data = { 'total': 5, - 'platforms': [],}; + 'mockNumbers': [],}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.listPlatforms( + const response = await project.listMockPhones( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -219,20 +355,17 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method createAndroidPlatform()', async () => { + test('test method createMockPhone()', async () => { const data = { - '\$id': '5e5ea5c16897e', + 'number': '+1612842323', + 'otp': '123456', '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'applicationId': 'com.company.appname',}; + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.createAndroidPlatform( - '', - '', - '', + const response = await project.createMockPhone( + '+12065550100', + '', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -241,20 +374,16 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateAndroidPlatform()', async () => { + test('test method getMockPhone()', async () => { const data = { - '\$id': '5e5ea5c16897e', + 'number': '+1612842323', + 'otp': '123456', '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'applicationId': 'com.company.appname',}; + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateAndroidPlatform( - '', - '', - '', + const response = await project.getMockPhone( + '+12065550100', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -263,20 +392,17 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method createApplePlatform()', async () => { + test('test method updateMockPhone()', async () => { const data = { - '\$id': '5e5ea5c16897e', + 'number': '+1612842323', + 'otp': '123456', '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'bundleIdentifier': 'com.company.appname',}; + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.createApplePlatform( - '', - '', - '', + const response = await project.updateMockPhone( + '+12065550100', + '', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -285,20 +411,27 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateApplePlatform()', async () => { + test('test method deleteMockPhone()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deleteMockPhone( + '+12065550100', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listOAuth2Providers()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'bundleIdentifier': 'com.company.appname',}; + 'total': 5, + 'providers': [],}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateApplePlatform( - '', - '', - '', + const response = await project.listOAuth2Providers( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -307,20 +440,17 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method createLinuxPlatform()', async () => { + test('test method getOAuth2Provider()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'packageName': 'com.company.appname',}; + '\$id': 'github', + 'enabled': true, + 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', + 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', + 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.createLinuxPlatform( - '', - '', - '', + const response = await project.getOAuth2Provider( + 'amazon', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -329,20 +459,15 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateLinuxPlatform()', async () => { + test('test method updateOAuth2Amazon()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'packageName': 'com.company.appname',}; + '\$id': 'github', + 'enabled': true, + 'clientId': 'amzn1.application-oa2-client.87400c00000000000000000000063d5b2', + 'clientSecret': '79ffe4000000000000000000000000000000000000000000000000000002de55',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateLinuxPlatform( - '', - '', - '', + const response = await project.updateOAuth2Amazon( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -351,20 +476,17 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method createWebPlatform()', async () => { + test('test method updateOAuth2Apple()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'hostname': 'app.example.com',}; + '\$id': 'apple', + 'enabled': true, + 'serviceId': 'ip.appwrite.app.web', + 'keyId': 'P4000000N8', + 'teamId': 'D4000000R6', + 'p8File': '-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.createWebPlatform( - '', - '', - 'app.example.com', + const response = await project.updateOAuth2Apple( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -373,20 +495,16 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateWebPlatform()', async () => { + test('test method updateOAuth2Auth0()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'hostname': 'app.example.com',}; + '\$id': 'github', + 'enabled': true, + 'clientId': 'OaOkIA000000000000000000005KLSYq', + 'clientSecret': 'zXz0000-00000000000000000000000000000-00000000000000000000PJafnF', + 'endpoint': 'example.us.auth0.com',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateWebPlatform( - '', - '', - 'app.example.com', + const response = await project.updateOAuth2Auth0( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -395,20 +513,16 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method createWindowsPlatform()', async () => { + test('test method updateOAuth2Authentik()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'packageIdentifierName': 'com.company.appname',}; + '\$id': 'github', + 'enabled': true, + 'clientId': 'dTKOPa0000000000000000000000000000e7G8hv', + 'clientSecret': 'ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK', + 'endpoint': 'example.authentik.com',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.createWindowsPlatform( - '', - '', - '', + const response = await project.updateOAuth2Authentik( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -417,20 +531,15 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateWindowsPlatform()', async () => { + test('test method updateOAuth2Autodesk()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'packageIdentifierName': 'com.company.appname',}; + '\$id': 'github', + 'enabled': true, + 'clientId': '5zw90v00000000000000000000kVYXN7', + 'clientSecret': '7I000000000000MW',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateWindowsPlatform( - '', - '', - '', + const response = await project.updateOAuth2Autodesk( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -439,18 +548,15 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method getPlatform()', async () => { + test('test method updateOAuth2Bitbucket()', async () => { const data = { - '\$id': '5e5ea5c16897e', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'name': 'My Web App', - 'type': 'web', - 'packageName': 'com.company.appname',}; + '\$id': 'github', + 'enabled': true, + 'key': 'Knt70000000000ByRc', + 'secret': 'NMfLZJ00000000000000000000TLQdDx',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.getPlatform( - '', + const response = await project.updateOAuth2Bitbucket( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -459,12 +565,15 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method deletePlatform()', async () => { - const data = {message: ""}; + test('test method updateOAuth2Bitly()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'd95151000000000000000000000000000067af9b', + 'clientSecret': 'a13e250000000000000000000000000000d73095',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.deletePlatform( - '', + const response = await project.updateOAuth2Bitly( ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -473,7 +582,1771 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateProtocolStatus()', async () => { + test('test method updateOAuth2Box()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'deglcs00000000000000000000x2og6y', + 'clientSecret': 'OKM1f100000000000000000000eshEif',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Box( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Dailymotion()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'apiKey': '07a9000000000000067f', + 'apiSecret': 'a399a90000000000000000000000000000d90639',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Dailymotion( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Discord()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '950722000000343754', + 'clientSecret': 'YmPXnM000000000000000000002zFg5D',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Discord( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Disqus()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'publicKey': 'cgegH70000000000000000000000000000000000000000000000000000Hr1nYX', + 'secretKey': 'W7Bykj00000000000000000000000000000000000000000000000000003o43w9',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Disqus( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Dropbox()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'appKey': 'jl000000000009t', + 'appSecret': 'g200000000000vw',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Dropbox( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Etsy()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'keyString': 'nsgzxh0000000000008j85a2', + 'sharedSecret': 'tp000000ru',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Etsy( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Facebook()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'appId': '260600000007694', + 'appSecret': '2d0b2800000000000000000000d38af4',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Facebook( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Figma()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'byay5H0000000000VtiI40', + 'clientSecret': 'yEpOYn0000000000000000004iIsU5',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Figma( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2FusionAuth()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'b2222c00-0000-0000-0000-000000862097', + 'clientSecret': 'Jx4s0C0000000000000000000000000000000wGqLsc', + 'endpoint': 'example.fusionauth.io',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2FusionAuth( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2GitHub()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'e4d87900000000540733', + 'clientSecret': '5e07c00000000000000000000000000000198bcc',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2GitHub( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Gitlab()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'applicationId': 'd41ffe0000000000000000000000000000000000000000000000000000d5e252', + 'secret': 'gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38', + 'endpoint': 'https://gitlab.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Gitlab( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Google()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'your-google-client-id.apps.googleusercontent.com', + 'clientSecret': 'your-google-client-secret',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Google( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Keycloak()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'appwrite-o0000000st-app', + 'clientSecret': 'jdjrJd00000000000000000000HUsaZO', + 'endpoint': 'keycloak.example.com', + 'realmName': 'appwrite-realm',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Keycloak( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Kick()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '01KQ7C00000000000001MFHS32', + 'clientSecret': '34ac5600000000000000000000000000000000000000000000000000e830c8b',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Kick( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Linkedin()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '770000000000dv', + 'primaryClientSecret': 'your-linkedin-client-secret',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Linkedin( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Microsoft()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', + 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', + 'tenant': 'common',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Microsoft( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Notion()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'oauthClientId': '341d8700-0000-0000-0000-000000446ee3', + 'oauthClientSecret': 'secret_dLUr4b000000000000000000000000000000lFHAa9',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Notion( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Oidc()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'qibI2x0000000000000000000000000006L2YFoG', + 'clientSecret': 'Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV', + 'wellKnownURL': 'https://myoauth.com/.well-known/openid-configuration', + 'authorizationURL': 'https://myoauth.com/oauth2/authorize', + 'tokenURL': 'https://myoauth.com/oauth2/token', + 'userInfoURL': 'https://myoauth.com/oauth2/userinfo',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Oidc( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Okta()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '0oa00000000000000698', + 'clientSecret': 'Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV', + 'domain': 'trial-6400025.okta.com', + 'authorizationServerId': 'aus000000000000000h7z',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Okta( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Paypal()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', + 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Paypal( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2PaypalSandbox()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', + 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2PaypalSandbox( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Podio()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'appwrite-oauth-test-app', + 'clientSecret': 'Rn247T0000000000000000000000000000000000000000000000000000W2zWTN',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Podio( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Salesforce()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'customerKey': '3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq', + 'customerSecret': '3w000000000000e2',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Salesforce( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Slack()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '23000000089.15000000000023', + 'clientSecret': '81656000000000000000000000f3d2fd',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Slack( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Spotify()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '6ec271000000000000000000009beace', + 'clientSecret': 'db068a000000000000000000008b5b9f',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Spotify( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Stripe()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'ca_UKibXX0000000000000000000006byvR', + 'apiSecretKey': 'sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Stripe( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Tradeshift()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', + 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Tradeshift( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2TradeshiftSandbox()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', + 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2TradeshiftSandbox( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Twitch()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'vvi0in000000000000000000ikmt9p', + 'clientSecret': 'pmapue000000000000000000zylw3v',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Twitch( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2WordPress()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '130005', + 'clientSecret': 'PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2WordPress( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2X()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'customerKey': 'slzZV0000000000000NFLaWT', + 'secretKey': 'tkEPkp00000000000000000000000000000000000000FTxbI9',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2X( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Yahoo()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm', + 'clientSecret': 'cf978f0000000000000000000000000000c5e2e9',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Yahoo( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Yandex()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '6a8a6a0000000000000000000091483c', + 'clientSecret': 'bbf98500000000000000000000c75a63',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Yandex( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Zoho()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '1000.83C178000000000000000000RPNX0B', + 'clientSecret': 'fb5cac000000000000000000000000000000a68f6e',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Zoho( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateOAuth2Zoom()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': 'QMAC00000000000000w0AQ', + 'clientSecret': 'GAWsG4000000000000000000007U01ON',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Zoom( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listPlatforms()', async () => { + const data = { + 'total': 5, + 'platforms': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listPlatforms( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getPlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deletePlatform()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deletePlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listPolicies()', async () => { + const data = { + 'total': 9, + 'policies': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listPolicies( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateMembershipPrivacyPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateMembershipPrivacyPolicy( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updatePasswordDictionaryPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updatePasswordDictionaryPolicy( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updatePasswordHistoryPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updatePasswordHistoryPolicy( + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updatePasswordPersonalDataPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updatePasswordPersonalDataPolicy( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateSessionAlertPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateSessionAlertPolicy( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateSessionDurationPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateSessionDurationPolicy( + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateSessionInvalidationPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateSessionInvalidationPolicy( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateSessionLimitPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateSessionLimitPolicy( + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateUserLimitPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateUserLimitPolicy( + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getPolicy()', async () => { + const data = { + '\$id': 'password-dictionary', + 'userId': true, + 'userEmail': true, + 'userPhone': true, + 'userName': true, + 'userMFA': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getPolicy( + 'password-dictionary', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateProtocol()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -503,6 +2376,8 @@ describe('Project', () => { 'authMembershipsUserName': true, 'authMembershipsUserEmail': true, 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, 'authInvalidateSessions': true, 'oAuthProviders': [], 'platforms': [], @@ -512,11 +2387,12 @@ describe('Project', () => { 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', + 'smtpPassword': '', 'smtpSecure': 'tls', 'pingCount': 1, 'pingedAt': '2020-10-15T06:38:00.000+00:00', @@ -555,7 +2431,7 @@ describe('Project', () => { 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateProtocolStatus( + const response = await project.updateProtocol( 'rest', true, ); @@ -566,7 +2442,7 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method updateServiceStatus()', async () => { + test('test method updateService()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -596,6 +2472,8 @@ describe('Project', () => { 'authMembershipsUserName': true, 'authMembershipsUserEmail': true, 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, 'authInvalidateSessions': true, 'oAuthProviders': [], 'platforms': [], @@ -605,11 +2483,12 @@ describe('Project', () => { 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', 'smtpSenderEmail': 'john@appwrite.io', - 'smtpReplyTo': 'support@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': 'securepassword', + 'smtpPassword': '', 'smtpSecure': 'tls', 'pingCount': 1, 'pingedAt': '2020-10-15T06:38:00.000+00:00', @@ -648,7 +2527,7 @@ describe('Project', () => { 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await project.updateServiceStatus( + const response = await project.updateService( 'account', true, ); @@ -659,6 +2538,173 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateSMTP()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authMembershipsUserId': true, + 'authMembershipsUserPhone': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateSMTP( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createSMTPTest()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createSMTPTest( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listEmailTemplates()', async () => { + const data = { + 'total': 5, + 'templates': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listEmailTemplates( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateEmailTemplate()', async () => { + const data = { + 'templateId': 'verification', + 'locale': 'en_us', + 'message': 'Click on the link to verify your account.', + 'senderName': 'My User', + 'senderEmail': 'mail@appwrite.io', + 'replyToEmail': 'emails@appwrite.io', + 'replyToName': 'Support Team', + 'subject': 'Please verify your email address',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateEmailTemplate( + 'verification', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getEmailTemplate()', async () => { + const data = { + 'templateId': 'verification', + 'locale': 'en_us', + 'message': 'Click on the link to verify your account.', + 'senderName': 'My User', + 'senderEmail': 'mail@appwrite.io', + 'replyToEmail': 'emails@appwrite.io', + 'replyToName': 'Support Team', + 'subject': 'Please verify your email address',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getEmailTemplate( + 'verification', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listVariables()', async () => { const data = { 'total': 5, diff --git a/test/services/proxy.test.js b/test/services/proxy.test.js new file mode 100644 index 00000000..05a556ff --- /dev/null +++ b/test/services/proxy.test.js @@ -0,0 +1,215 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Proxy } = require("../../dist/services/proxy"); + +const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); +jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); + +describe('Proxy', () => { + const client = new Client(); + const proxy = new Proxy(client); + + + test('test method listRules()', async () => { + const data = { + 'total': 5, + 'rules': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.listRules( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createAPIRule()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.createAPIRule( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createFunctionRule()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.createFunctionRule( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createRedirectRule()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.createRedirectRule( + '', + 'https://example.com', + '301', + '', + 'site', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createSiteRule()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.createSiteRule( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getRule()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.getRule( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteRule()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.deleteRule( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateRuleStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'domain': 'appwrite.company.com', + 'type': 'deployment', + 'trigger': 'manual', + 'redirectUrl': 'https://appwrite.io/docs', + 'redirectStatusCode': 301, + 'deploymentId': 'n3u9feiwmf', + 'deploymentResourceId': 'n3u9feiwmf', + 'deploymentVcsProviderBranch': 'main', + 'status': 'verified', + 'logs': 'Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.', + 'renewAt': 'datetime',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.updateRuleStatus( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + }) diff --git a/test/services/sites.test.js b/test/services/sites.test.js index f12fb315..11e9f6da 100644 --- a/test/services/sites.test.js +++ b/test/services/sites.test.js @@ -655,6 +655,7 @@ describe('Sites', () => { const response = await sites.createVariable( '', + '', '', '', ); @@ -703,7 +704,6 @@ describe('Sites', () => { const response = await sites.updateVariable( '', '', - '', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 53feaac1..5c89adc6 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -344,6 +344,55 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); + test('test method createBigIntColumn()', async () => { + const data = { + 'key': 'count', + 'type': 'bigint', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.createBigIntColumn( + '', + '', + '', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateBigIntColumn()', async () => { + const data = { + 'key': 'count', + 'type': 'bigint', + 'status': 'available', + 'error': 'string', + 'required': true, + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.updateBigIntColumn( + '', + '', + '', + true, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createBooleanColumn()', async () => { const data = { 'key': 'isEnabled', diff --git a/test/services/teams.test.js b/test/services/teams.test.js index 16a38279..dcb4055b 100644 --- a/test/services/teams.test.js +++ b/test/services/teams.test.js @@ -125,6 +125,7 @@ describe('Teams', () => { 'userId': '5e5ea5c16897e', 'userName': 'John Doe', 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', 'teamId': '5e5ea5c16897e', 'teamName': 'VIP', 'invited': '2020-10-15T06:38:00.000+00:00', @@ -153,6 +154,7 @@ describe('Teams', () => { 'userId': '5e5ea5c16897e', 'userName': 'John Doe', 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', 'teamId': '5e5ea5c16897e', 'teamName': 'VIP', 'invited': '2020-10-15T06:38:00.000+00:00', @@ -181,6 +183,7 @@ describe('Teams', () => { 'userId': '5e5ea5c16897e', 'userName': 'John Doe', 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', 'teamId': '5e5ea5c16897e', 'teamName': 'VIP', 'invited': '2020-10-15T06:38:00.000+00:00', @@ -225,6 +228,7 @@ describe('Teams', () => { 'userId': '5e5ea5c16897e', 'userName': 'John Doe', 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', 'teamId': '5e5ea5c16897e', 'teamName': 'VIP', 'invited': '2020-10-15T06:38:00.000+00:00', From a9d969ca91722f197dc23014176b7d745ee3405e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 11:38:35 +0000 Subject: [PATCH 09/18] feat: Node.js SDK update for version 24.1.0 --- .../examples/project/get-o-auth-2-provider.md | 2 +- docs/examples/project/get-policy.md | 2 +- docs/examples/project/update-auth-method.md | 2 +- src/enums/{method-id.ts => auth-method.ts} | 2 +- src/enums/o-auth-provider.ts | 2 + .../{policy-id.ts => project-policy-id.ts} | 2 +- src/enums/provider-id.ts | 49 ----------------- src/index.ts | 5 +- src/services/project.ts | 54 +++++++++---------- 9 files changed, 36 insertions(+), 84 deletions(-) rename src/enums/{method-id.ts => auth-method.ts} (88%) rename src/enums/{policy-id.ts => project-policy-id.ts} (92%) delete mode 100644 src/enums/provider-id.ts diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index a6df0d67..ce59ec68 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getOAuth2Provider({ - providerId: sdk.ProviderId.Amazon + providerId: sdk.OAuthProvider.Amazon }); ``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index df5abb54..e55cb859 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getPolicy({ - policyId: sdk.PolicyId.PasswordDictionary + policyId: sdk.ProjectPolicyId.PasswordDictionary }); ``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index d6b2c6ca..ca8b2981 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -9,7 +9,7 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.updateAuthMethod({ - methodId: sdk.MethodId.EmailPassword, + methodId: sdk.AuthMethod.EmailPassword, enabled: false }); ``` diff --git a/src/enums/method-id.ts b/src/enums/auth-method.ts similarity index 88% rename from src/enums/method-id.ts rename to src/enums/auth-method.ts index 062d0d0e..d5800ad9 100644 --- a/src/enums/method-id.ts +++ b/src/enums/auth-method.ts @@ -1,4 +1,4 @@ -export enum MethodId { +export enum AuthMethod { Emailpassword = 'email-password', Magicurl = 'magic-url', Emailotp = 'email-otp', diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index cc9e340b..06189633 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -42,4 +42,6 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/policy-id.ts b/src/enums/project-policy-id.ts similarity index 92% rename from src/enums/policy-id.ts rename to src/enums/project-policy-id.ts index ab1c4cd2..2031ce9b 100644 --- a/src/enums/policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -1,4 +1,4 @@ -export enum PolicyId { +export enum ProjectPolicyId { Passworddictionary = 'password-dictionary', Passwordhistory = 'password-history', Passwordpersonaldata = 'password-personal-data', diff --git a/src/enums/provider-id.ts b/src/enums/provider-id.ts deleted file mode 100644 index 943d7334..00000000 --- a/src/enums/provider-id.ts +++ /dev/null @@ -1,49 +0,0 @@ -export enum ProviderId { - Amazon = 'amazon', - Apple = 'apple', - Auth0 = 'auth0', - Authentik = 'authentik', - Autodesk = 'autodesk', - Bitbucket = 'bitbucket', - Bitly = 'bitly', - Box = 'box', - Dailymotion = 'dailymotion', - Discord = 'discord', - Disqus = 'disqus', - Dropbox = 'dropbox', - Etsy = 'etsy', - Facebook = 'facebook', - Figma = 'figma', - Fusionauth = 'fusionauth', - Github = 'github', - Gitlab = 'gitlab', - Google = 'google', - Keycloak = 'keycloak', - Kick = 'kick', - Linkedin = 'linkedin', - Microsoft = 'microsoft', - Notion = 'notion', - Oidc = 'oidc', - Okta = 'okta', - Paypal = 'paypal', - PaypalSandbox = 'paypalSandbox', - Podio = 'podio', - Salesforce = 'salesforce', - Slack = 'slack', - Spotify = 'spotify', - Stripe = 'stripe', - Tradeshift = 'tradeshift', - TradeshiftBox = 'tradeshiftBox', - Twitch = 'twitch', - Wordpress = 'wordpress', - X = 'x', - Yahoo = 'yahoo', - Yammer = 'yammer', - Yandex = 'yandex', - Zoho = 'zoho', - Zoom = 'zoom', - Mock = 'mock', - Mockunverified = 'mock-unverified', - GithubImagine = 'githubImagine', - GoogleImagine = 'googleImagine', -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index be8503ac..c512f736 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,9 +48,8 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; -export { MethodId } from './enums/method-id'; -export { ProviderId } from './enums/provider-id'; -export { PolicyId } from './enums/policy-id'; +export { AuthMethod } from './enums/auth-method'; +export { ProjectPolicyId } from './enums/project-policy-id'; export { ProtocolId } from './enums/protocol-id'; export { ServiceId } from './enums/service-id'; export { Secure } from './enums/secure'; diff --git a/src/services/project.ts b/src/services/project.ts index 187567dc..802ae5c7 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -2,10 +2,10 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; -import { MethodId } from '../enums/method-id'; +import { AuthMethod } from '../enums/auth-method'; import { Scopes } from '../enums/scopes'; -import { ProviderId } from '../enums/provider-id'; -import { PolicyId } from '../enums/policy-id'; +import { OAuthProvider } from '../enums/o-auth-provider'; +import { ProjectPolicyId } from '../enums/project-policy-id'; import { ProtocolId } from '../enums/protocol-id'; import { ServiceId } from '../enums/service-id'; import { Secure } from '../enums/secure'; @@ -46,33 +46,33 @@ export class Project { /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {MethodId} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {AuthMethod} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} params.enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} */ - updateAuthMethod(params: { methodId: MethodId, enabled: boolean }): Promise; + updateAuthMethod(params: { methodId: AuthMethod, enabled: boolean }): Promise; /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {MethodId} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {AuthMethod} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateAuthMethod(methodId: MethodId, enabled: boolean): Promise; + updateAuthMethod(methodId: AuthMethod, enabled: boolean): Promise; updateAuthMethod( - paramsOrFirst: { methodId: MethodId, enabled: boolean } | MethodId, + paramsOrFirst: { methodId: AuthMethod, enabled: boolean } | AuthMethod, ...rest: [(boolean)?] ): Promise { - let params: { methodId: MethodId, enabled: boolean }; + let params: { methodId: AuthMethod, enabled: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('methodId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { methodId: MethodId, enabled: boolean }; + params = (paramsOrFirst || {}) as { methodId: AuthMethod, enabled: boolean }; } else { params = { - methodId: paramsOrFirst as MethodId, + methodId: paramsOrFirst as AuthMethod, enabled: rest[0] as boolean }; } @@ -913,30 +913,30 @@ export class Project { /** * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param {ProviderId} params.providerId - OAuth2 provider key. For example: github, google, apple. + * @param {OAuthProvider} params.providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} * @returns {Promise} */ - getOAuth2Provider(params: { providerId: ProviderId }): Promise; + getOAuth2Provider(params: { providerId: OAuthProvider }): Promise; /** * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param {ProviderId} providerId - OAuth2 provider key. For example: github, google, apple. + * @param {OAuthProvider} providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getOAuth2Provider(providerId: ProviderId): Promise; + getOAuth2Provider(providerId: OAuthProvider): Promise; getOAuth2Provider( - paramsOrFirst: { providerId: ProviderId } | ProviderId + paramsOrFirst: { providerId: OAuthProvider } | OAuthProvider ): Promise { - let params: { providerId: ProviderId }; + let params: { providerId: OAuthProvider }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('providerId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: ProviderId }; + params = (paramsOrFirst || {}) as { providerId: OAuthProvider }; } else { params = { - providerId: paramsOrFirst as ProviderId + providerId: paramsOrFirst as OAuthProvider }; } @@ -5377,30 +5377,30 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {PolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} */ - getPolicy(params: { policyId: PolicyId }): Promise; + getPolicy(params: { policyId: ProjectPolicyId }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {PolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: PolicyId): Promise; + getPolicy(policyId: ProjectPolicyId): Promise; getPolicy( - paramsOrFirst: { policyId: PolicyId } | PolicyId + paramsOrFirst: { policyId: ProjectPolicyId } | ProjectPolicyId ): Promise { - let params: { policyId: PolicyId }; + let params: { policyId: ProjectPolicyId }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: PolicyId }; + params = (paramsOrFirst || {}) as { policyId: ProjectPolicyId }; } else { params = { - policyId: paramsOrFirst as PolicyId + policyId: paramsOrFirst as ProjectPolicyId }; } From 4eb1e49b4b98a37444149526f6030861eafbddc3 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 7 May 2026 18:50:26 +0530 Subject: [PATCH 10/18] chore: refresh sdk for latest spec (sanitized oauth examples) --- CHANGELOG.md | 6 ------ docs/examples/project/update-protocol-status.md | 15 --------------- docs/examples/project/update-service-status.md | 15 --------------- package-lock.json | 4 ++-- package.json | 2 +- src/client.ts | 4 ++-- 6 files changed, 5 insertions(+), 41 deletions(-) delete mode 100644 docs/examples/project/update-protocol-status.md delete mode 100644 docs/examples/project/update-service-status.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 078bc7b0..3f3e163e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,5 @@ # Change Log -## 24.1.0 - -* Added: Introduced `bigint` create/update APIs for legacy Databases attributes -* Added: Introduced `bigint` create/update APIs for `TablesDB` columns -* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` - ## 24.0.0 * [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` diff --git a/docs/examples/project/update-protocol-status.md b/docs/examples/project/update-protocol-status.md deleted file mode 100644 index b3da4bf3..00000000 --- a/docs/examples/project/update-protocol-status.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateProtocolStatus({ - protocolId: sdk.ProtocolId.Rest, - enabled: false -}); -``` diff --git a/docs/examples/project/update-service-status.md b/docs/examples/project/update-service-status.md deleted file mode 100644 index fe9514b4..00000000 --- a/docs/examples/project/update-service-status.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const project = new sdk.Project(client); - -const result = await project.updateServiceStatus({ - serviceId: sdk.ServiceId.Account, - enabled: false -}); -``` diff --git a/package-lock.json b/package-lock.json index 69c1e71e..848f3d9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "24.1.0", + "version": "24.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "24.1.0", + "version": "24.0.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index 24e2e0ca..bcf42393 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "24.1.0", + "version": "24.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 84774c0a..39752983 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/24.1.0'; + let ua = 'AppwriteNodeJSSDK/24.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '24.1.0', + 'x-sdk-version': '24.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.4', }; From bb56aebe1de84d983e8e1af5eccd09a856fe08d9 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 7 May 2026 18:58:04 +0530 Subject: [PATCH 11/18] chore: refresh sdk for latest spec (sanitized oauth examples) --- CHANGELOG.md | 6 ++++++ docs/examples/project/get-policy.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/client.ts | 4 ++-- ...{project-policy-id.ts => project-policy.ts} | 2 +- src/index.ts | 2 +- src/services/project.ts | 18 +++++++++--------- 8 files changed, 23 insertions(+), 17 deletions(-) rename src/enums/{project-policy-id.ts => project-policy.ts} (92%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f3e163e..078bc7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 24.1.0 + +* Added: Introduced `bigint` create/update APIs for legacy Databases attributes +* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` + ## 24.0.0 * [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index e55cb859..5387dfe0 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getPolicy({ - policyId: sdk.ProjectPolicyId.PasswordDictionary + policyId: sdk.ProjectPolicy.PasswordDictionary }); ``` diff --git a/package-lock.json b/package-lock.json index 848f3d9c..69c1e71e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "24.0.0", + "version": "24.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "24.0.0", + "version": "24.1.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index bcf42393..24e2e0ca 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "24.0.0", + "version": "24.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 39752983..84774c0a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/24.0.0'; + let ua = 'AppwriteNodeJSSDK/24.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '24.0.0', + 'x-sdk-version': '24.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.4', }; diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy.ts similarity index 92% rename from src/enums/project-policy-id.ts rename to src/enums/project-policy.ts index 2031ce9b..d52bf99a 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy.ts @@ -1,4 +1,4 @@ -export enum ProjectPolicyId { +export enum ProjectPolicy { Passworddictionary = 'password-dictionary', Passwordhistory = 'password-history', Passwordpersonaldata = 'password-personal-data', diff --git a/src/index.ts b/src/index.ts index c512f736..60e8093b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -49,7 +49,7 @@ export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; export { AuthMethod } from './enums/auth-method'; -export { ProjectPolicyId } from './enums/project-policy-id'; +export { ProjectPolicy } from './enums/project-policy'; export { ProtocolId } from './enums/protocol-id'; export { ServiceId } from './enums/service-id'; export { Secure } from './enums/secure'; diff --git a/src/services/project.ts b/src/services/project.ts index 802ae5c7..db3c5e48 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -5,7 +5,7 @@ import type { Models } from '../models'; import { AuthMethod } from '../enums/auth-method'; import { Scopes } from '../enums/scopes'; import { OAuthProvider } from '../enums/o-auth-provider'; -import { ProjectPolicyId } from '../enums/project-policy-id'; +import { ProjectPolicy } from '../enums/project-policy'; import { ProtocolId } from '../enums/protocol-id'; import { ServiceId } from '../enums/service-id'; import { Secure } from '../enums/secure'; @@ -5377,30 +5377,30 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicy} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} */ - getPolicy(params: { policyId: ProjectPolicyId }): Promise; + getPolicy(params: { policyId: ProjectPolicy }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicy} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: ProjectPolicyId): Promise; + getPolicy(policyId: ProjectPolicy): Promise; getPolicy( - paramsOrFirst: { policyId: ProjectPolicyId } | ProjectPolicyId + paramsOrFirst: { policyId: ProjectPolicy } | ProjectPolicy ): Promise { - let params: { policyId: ProjectPolicyId }; + let params: { policyId: ProjectPolicy }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: ProjectPolicyId }; + params = (paramsOrFirst || {}) as { policyId: ProjectPolicy }; } else { params = { - policyId: paramsOrFirst as ProjectPolicyId + policyId: paramsOrFirst as ProjectPolicy }; } From e48e22a2cc5d9f0b52e2a14baa955c380cf7cca7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 10:42:46 +0000 Subject: [PATCH 12/18] feat: Node.js SDK update for version 24.1.0 --- docs/examples/presences/delete.md | 14 + docs/examples/presences/get.md | 14 + docs/examples/presences/list.md | 16 + docs/examples/presences/update-presence.md | 20 + docs/examples/presences/upsert.md | 19 + .../examples/project/get-o-auth-2-provider.md | 2 +- docs/examples/project/get-policy.md | 2 +- docs/examples/project/update-auth-method.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/client.ts | 4 +- src/enums/{auth-method.ts => method-id.ts} | 2 +- src/enums/o-auth-provider.ts | 2 - src/enums/{project-policy.ts => policy-id.ts} | 2 +- src/enums/provider-id.ts | 49 +++ src/enums/scopes.ts | 2 + src/index.ts | 6 +- src/models.ts | 67 +++- src/services/presences.ts | 373 ++++++++++++++++++ src/services/project.ts | 54 +-- test/services/presences.test.js | 110 ++++++ 21 files changed, 724 insertions(+), 42 deletions(-) create mode 100644 docs/examples/presences/delete.md create mode 100644 docs/examples/presences/get.md create mode 100644 docs/examples/presences/list.md create mode 100644 docs/examples/presences/update-presence.md create mode 100644 docs/examples/presences/upsert.md rename src/enums/{auth-method.ts => method-id.ts} (88%) rename src/enums/{project-policy.ts => policy-id.ts} (93%) create mode 100644 src/enums/provider-id.ts create mode 100644 src/services/presences.ts create mode 100644 test/services/presences.test.js diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md new file mode 100644 index 00000000..4c1cfc24 --- /dev/null +++ b/docs/examples/presences/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.delete({ + presenceId: '' +}); +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md new file mode 100644 index 00000000..1e8a332d --- /dev/null +++ b/docs/examples/presences/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.get({ + presenceId: '' +}); +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md new file mode 100644 index 00000000..fbb18d4d --- /dev/null +++ b/docs/examples/presences/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.list({ + queries: [], // optional + total: false, // optional + ttl: 0 // optional +}); +``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update-presence.md new file mode 100644 index 00000000..ffb1272f --- /dev/null +++ b/docs/examples/presences/update-presence.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.updatePresence({ + presenceId: '', + userId: '', + status: '', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + purge: false // optional +}); +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md new file mode 100644 index 00000000..63b9267f --- /dev/null +++ b/docs/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.upsert({ + presenceId: '', + userId: '', + status: '', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {} // optional +}); +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index ce59ec68..a6df0d67 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getOAuth2Provider({ - providerId: sdk.OAuthProvider.Amazon + providerId: sdk.ProviderId.Amazon }); ``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index 5387dfe0..df5abb54 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getPolicy({ - policyId: sdk.ProjectPolicy.PasswordDictionary + policyId: sdk.PolicyId.PasswordDictionary }); ``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index ca8b2981..d6b2c6ca 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -9,7 +9,7 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.updateAuthMethod({ - methodId: sdk.AuthMethod.EmailPassword, + methodId: sdk.MethodId.EmailPassword, enabled: false }); ``` diff --git a/package-lock.json b/package-lock.json index 69c1e71e..fb2059d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "24.1.0", + "version": "24.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "24.1.0", + "version": "24.2.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index 24e2e0ca..9fe3a846 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "24.1.0", + "version": "24.2.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 84774c0a..d596588b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/24.1.0'; + let ua = 'AppwriteNodeJSSDK/24.2.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '24.1.0', + 'x-sdk-version': '24.2.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.4', }; diff --git a/src/enums/auth-method.ts b/src/enums/method-id.ts similarity index 88% rename from src/enums/auth-method.ts rename to src/enums/method-id.ts index d5800ad9..062d0d0e 100644 --- a/src/enums/auth-method.ts +++ b/src/enums/method-id.ts @@ -1,4 +1,4 @@ -export enum AuthMethod { +export enum MethodId { Emailpassword = 'email-password', Magicurl = 'magic-url', Emailotp = 'email-otp', diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 06189633..cc9e340b 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -42,6 +42,4 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', - GithubImagine = 'githubImagine', - GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/project-policy.ts b/src/enums/policy-id.ts similarity index 93% rename from src/enums/project-policy.ts rename to src/enums/policy-id.ts index d52bf99a..ab1c4cd2 100644 --- a/src/enums/project-policy.ts +++ b/src/enums/policy-id.ts @@ -1,4 +1,4 @@ -export enum ProjectPolicy { +export enum PolicyId { Passworddictionary = 'password-dictionary', Passwordhistory = 'password-history', Passwordpersonaldata = 'password-personal-data', diff --git a/src/enums/provider-id.ts b/src/enums/provider-id.ts new file mode 100644 index 00000000..943d7334 --- /dev/null +++ b/src/enums/provider-id.ts @@ -0,0 +1,49 @@ +export enum ProviderId { + Amazon = 'amazon', + Apple = 'apple', + Auth0 = 'auth0', + Authentik = 'authentik', + Autodesk = 'autodesk', + Bitbucket = 'bitbucket', + Bitly = 'bitly', + Box = 'box', + Dailymotion = 'dailymotion', + Discord = 'discord', + Disqus = 'disqus', + Dropbox = 'dropbox', + Etsy = 'etsy', + Facebook = 'facebook', + Figma = 'figma', + Fusionauth = 'fusionauth', + Github = 'github', + Gitlab = 'gitlab', + Google = 'google', + Keycloak = 'keycloak', + Kick = 'kick', + Linkedin = 'linkedin', + Microsoft = 'microsoft', + Notion = 'notion', + Oidc = 'oidc', + Okta = 'okta', + Paypal = 'paypal', + PaypalSandbox = 'paypalSandbox', + Podio = 'podio', + Salesforce = 'salesforce', + Slack = 'slack', + Spotify = 'spotify', + Stripe = 'stripe', + Tradeshift = 'tradeshift', + TradeshiftBox = 'tradeshiftBox', + Twitch = 'twitch', + Wordpress = 'wordpress', + X = 'x', + Yahoo = 'yahoo', + Yammer = 'yammer', + Yandex = 'yandex', + Zoho = 'zoho', + Zoom = 'zoom', + Mock = 'mock', + Mockunverified = 'mock-unverified', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', +} \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index 5c812100..bab24a98 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -77,6 +77,8 @@ export enum Scopes { SchedulesWrite = 'schedules.write', VcsRead = 'vcs.read', VcsWrite = 'vcs.write', + PresencesRead = 'presences.read', + PresencesWrite = 'presences.write', BackupsPoliciesRead = 'backups.policies.read', BackupsPoliciesWrite = 'backups.policies.write', ArchivesRead = 'archives.read', diff --git a/src/index.ts b/src/index.ts index 60e8093b..d598e963 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,7 @@ export { Graphql } from './services/graphql'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Presences } from './services/presences'; export { Project } from './services/project'; export { Proxy } from './services/proxy'; export { Sites } from './services/sites'; @@ -48,8 +49,9 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; -export { AuthMethod } from './enums/auth-method'; -export { ProjectPolicy } from './enums/project-policy'; +export { MethodId } from './enums/method-id'; +export { ProviderId } from './enums/provider-id'; +export { PolicyId } from './enums/policy-id'; export { ProtocolId } from './enums/protocol-id'; export { ServiceId } from './enums/service-id'; export { Secure } from './enums/secure'; diff --git a/src/models.ts b/src/models.ts index 64911ce6..06951df0 100644 --- a/src/models.ts +++ b/src/models.ts @@ -47,6 +47,20 @@ export namespace Models { documents: Document[]; } + /** + * Presences List + */ + export type PresenceList = { + /** + * Total number of presences that matched your query. + */ + total: number; + /** + * List of presences. + */ + presences: Presence[]; + } + /** * Tables List */ @@ -2669,6 +2683,57 @@ export namespace Models { [__default]: true; }; + /** + * Presence + */ + export type Presence = { + /** + * Presence ID. + */ + $id: string; + /** + * Presence sequence ID. + */ + $sequence: string; + /** + * Presence creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Presence update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Presence permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; + /** + * User internal ID. + */ + userInternalId: string; + /** + * User ID. + */ + userId: string; + /** + * Presence status. + */ + status?: string; + /** + * Presence source. + */ + source: string; + /** + * Presence expiry date in ISO 8601 format. + */ + expiresAt?: string; + } + + export type DefaultPresence = Presence & { + [key: string]: any; + [__default]: true; + }; + /** * Log */ @@ -6681,7 +6746,7 @@ export namespace Models { */ size: number; /** - * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. + * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed, skipped. */ status: string; /** diff --git a/src/services/presences.ts b/src/services/presences.ts new file mode 100644 index 00000000..36a98567 --- /dev/null +++ b/src/services/presences.ts @@ -0,0 +1,373 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + + +export class Presences { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List presence logs. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + */ + list(params?: { queries?: string[], total?: boolean, ttl?: number }): Promise>; + /** + * List presence logs. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + list(queries?: string[], total?: boolean, ttl?: number): Promise>; + list( + paramsOrFirst?: { queries?: string[], total?: boolean, ttl?: number } | string[], + ...rest: [(boolean)?, (number)?] + ): Promise> { + let params: { queries?: string[], total?: boolean, ttl?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean, ttl?: number }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean, + ttl: rest[1] as number + }; + } + + const queries = params.queries; + const total = params.total; + const ttl = params.ttl; + + + const apiPath = '/presences'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a presence log by its unique ID. + * + * @param {string} params.presenceId - Presence unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { presenceId: string }): Promise; + /** + * Get a presence log by its unique ID. + * + * @param {string} presenceId - Presence unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(presenceId: string): Promise; + get( + paramsOrFirst: { presenceId: string } | string + ): Promise { + let params: { presenceId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { presenceId: string }; + } else { + params = { + presenceId: paramsOrFirst as string + }; + } + + const presenceId = params.presenceId; + + if (typeof presenceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "presenceId"'); + } + + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create or update a presence log by its unique ID. + * + * @param {string} params.presenceId - Presence unique ID. + * @param {string} params.userId - User ID. + * @param {string} params.status - Presence status. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.expiresAt - Presence expiry datetime. + * @param {object} params.metadata - Presence metadata object. + * @throws {AppwriteException} + * @returns {Promise} + */ + upsert(params: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }): Promise; + /** + * Create or update a presence log by its unique ID. + * + * @param {string} presenceId - Presence unique ID. + * @param {string} userId - User ID. + * @param {string} status - Presence status. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} expiresAt - Presence expiry datetime. + * @param {object} metadata - Presence metadata object. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsert(presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object): Promise; + upsert( + paramsOrFirst: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object } | string, + ...rest: [(string)?, (string)?, (string[])?, (string)?, (object)?] + ): Promise { + let params: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; + } else { + params = { + presenceId: paramsOrFirst as string, + userId: rest[0] as string, + status: rest[1] as string, + permissions: rest[2] as string[], + expiresAt: rest[3] as string, + metadata: rest[4] as object + }; + } + + const presenceId = params.presenceId; + const userId = params.userId; + const status = params.status; + const permissions = params.permissions; + const expiresAt = params.expiresAt; + const metadata = params.metadata; + + if (typeof presenceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "presenceId"'); + } + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof status === 'undefined') { + throw new AppwriteException('Missing required parameter: "status"'); + } + + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const payload: Payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof status !== 'undefined') { + payload['status'] = status; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof expiresAt !== 'undefined') { + payload['expiresAt'] = expiresAt; + } + if (typeof metadata !== 'undefined') { + payload['metadata'] = metadata; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a presence log by its unique ID. + * + * @param {string} params.presenceId - Presence unique ID. + * @param {string} params.userId - User ID. + * @param {string} params.status - Presence status. + * @param {string} params.expiresAt - Presence expiry datetime. + * @param {object} params.metadata - Presence metadata object. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.purge - When true, purge cached responses used by list presences endpoint. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePresence(params: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }): Promise; + /** + * Update a presence log by its unique ID. + * + * @param {string} presenceId - Presence unique ID. + * @param {string} userId - User ID. + * @param {string} status - Presence status. + * @param {string} expiresAt - Presence expiry datetime. + * @param {object} metadata - Presence metadata object. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} purge - When true, purge cached responses used by list presences endpoint. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePresence(presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean): Promise; + updatePresence( + paramsOrFirst: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (object)?, (string[])?, (boolean)?] + ): Promise { + let params: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; + } else { + params = { + presenceId: paramsOrFirst as string, + userId: rest[0] as string, + status: rest[1] as string, + expiresAt: rest[2] as string, + metadata: rest[3] as object, + permissions: rest[4] as string[], + purge: rest[5] as boolean + }; + } + + const presenceId = params.presenceId; + const userId = params.userId; + const status = params.status; + const expiresAt = params.expiresAt; + const metadata = params.metadata; + const permissions = params.permissions; + const purge = params.purge; + + if (typeof presenceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "presenceId"'); + } + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const payload: Payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof status !== 'undefined') { + payload['status'] = status; + } + if (typeof expiresAt !== 'undefined') { + payload['expiresAt'] = expiresAt; + } + if (typeof metadata !== 'undefined') { + payload['metadata'] = metadata; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof purge !== 'undefined') { + payload['purge'] = purge; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a presence log by its unique ID. + * + * @param {string} params.presenceId - Presence unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { presenceId: string }): Promise<{}>; + /** + * Delete a presence log by its unique ID. + * + * @param {string} presenceId - Presence unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(presenceId: string): Promise<{}>; + delete( + paramsOrFirst: { presenceId: string } | string + ): Promise<{}> { + let params: { presenceId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { presenceId: string }; + } else { + params = { + presenceId: paramsOrFirst as string + }; + } + + const presenceId = params.presenceId; + + if (typeof presenceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "presenceId"'); + } + + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/project.ts b/src/services/project.ts index db3c5e48..187567dc 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -2,10 +2,10 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; -import { AuthMethod } from '../enums/auth-method'; +import { MethodId } from '../enums/method-id'; import { Scopes } from '../enums/scopes'; -import { OAuthProvider } from '../enums/o-auth-provider'; -import { ProjectPolicy } from '../enums/project-policy'; +import { ProviderId } from '../enums/provider-id'; +import { PolicyId } from '../enums/policy-id'; import { ProtocolId } from '../enums/protocol-id'; import { ServiceId } from '../enums/service-id'; import { Secure } from '../enums/secure'; @@ -46,33 +46,33 @@ export class Project { /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {AuthMethod} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {MethodId} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} params.enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} */ - updateAuthMethod(params: { methodId: AuthMethod, enabled: boolean }): Promise; + updateAuthMethod(params: { methodId: MethodId, enabled: boolean }): Promise; /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {AuthMethod} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {MethodId} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateAuthMethod(methodId: AuthMethod, enabled: boolean): Promise; + updateAuthMethod(methodId: MethodId, enabled: boolean): Promise; updateAuthMethod( - paramsOrFirst: { methodId: AuthMethod, enabled: boolean } | AuthMethod, + paramsOrFirst: { methodId: MethodId, enabled: boolean } | MethodId, ...rest: [(boolean)?] ): Promise { - let params: { methodId: AuthMethod, enabled: boolean }; + let params: { methodId: MethodId, enabled: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('methodId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { methodId: AuthMethod, enabled: boolean }; + params = (paramsOrFirst || {}) as { methodId: MethodId, enabled: boolean }; } else { params = { - methodId: paramsOrFirst as AuthMethod, + methodId: paramsOrFirst as MethodId, enabled: rest[0] as boolean }; } @@ -913,30 +913,30 @@ export class Project { /** * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param {OAuthProvider} params.providerId - OAuth2 provider key. For example: github, google, apple. + * @param {ProviderId} params.providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} * @returns {Promise} */ - getOAuth2Provider(params: { providerId: OAuthProvider }): Promise; + getOAuth2Provider(params: { providerId: ProviderId }): Promise; /** * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param {OAuthProvider} providerId - OAuth2 provider key. For example: github, google, apple. + * @param {ProviderId} providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getOAuth2Provider(providerId: OAuthProvider): Promise; + getOAuth2Provider(providerId: ProviderId): Promise; getOAuth2Provider( - paramsOrFirst: { providerId: OAuthProvider } | OAuthProvider + paramsOrFirst: { providerId: ProviderId } | ProviderId ): Promise { - let params: { providerId: OAuthProvider }; + let params: { providerId: ProviderId }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('providerId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: OAuthProvider }; + params = (paramsOrFirst || {}) as { providerId: ProviderId }; } else { params = { - providerId: paramsOrFirst as OAuthProvider + providerId: paramsOrFirst as ProviderId }; } @@ -5377,30 +5377,30 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicy} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {PolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} */ - getPolicy(params: { policyId: ProjectPolicy }): Promise; + getPolicy(params: { policyId: PolicyId }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicy} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {PolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: ProjectPolicy): Promise; + getPolicy(policyId: PolicyId): Promise; getPolicy( - paramsOrFirst: { policyId: ProjectPolicy } | ProjectPolicy + paramsOrFirst: { policyId: PolicyId } | PolicyId ): Promise { - let params: { policyId: ProjectPolicy }; + let params: { policyId: PolicyId }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: ProjectPolicy }; + params = (paramsOrFirst || {}) as { policyId: PolicyId }; } else { params = { - policyId: paramsOrFirst as ProjectPolicy + policyId: paramsOrFirst as PolicyId }; } diff --git a/test/services/presences.test.js b/test/services/presences.test.js new file mode 100644 index 00000000..49e35fc1 --- /dev/null +++ b/test/services/presences.test.js @@ -0,0 +1,110 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Presences } = require("../../dist/services/presences"); + +const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); +jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); + +describe('Presences', () => { + const client = new Client(); + const presences = new Presences(client); + + + test('test method list()', async () => { + const data = { + 'total': 5, + 'presences': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await presences.list( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method get()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': '1', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'userInternalId': '1', + 'userId': '674af8f3e12a5f9ac0be', + 'source': 'HTTP',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await presences.get( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method upsert()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': '1', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'userInternalId': '1', + 'userId': '674af8f3e12a5f9ac0be', + 'source': 'HTTP',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await presences.upsert( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updatePresence()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$sequence': '1', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'userInternalId': '1', + 'userId': '674af8f3e12a5f9ac0be', + 'source': 'HTTP',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await presences.updatePresence( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method delete()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await presences.delete( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + }) From 3f90b214e1785ec26698e4693715f9d48dada8b0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 10:59:36 +0000 Subject: [PATCH 13/18] feat: Node.js SDK update for version 24.1.0 --- package-lock.json | 4 ++-- package.json | 2 +- src/client.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb2059d2..69c1e71e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "24.2.0", + "version": "24.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "24.2.0", + "version": "24.1.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index 9fe3a846..24e2e0ca 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "24.2.0", + "version": "24.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index d596588b..84774c0a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/24.2.0'; + let ua = 'AppwriteNodeJSSDK/24.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '24.2.0', + 'x-sdk-version': '24.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.4', }; From 9af4b8912575aff248f365b41f1d28408e14ff0d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:13:42 +0000 Subject: [PATCH 14/18] chore: remove presences API artifacts --- docs/examples/presences/delete.md | 14 - docs/examples/presences/get.md | 14 - docs/examples/presences/list.md | 16 - docs/examples/presences/update-presence.md | 20 -- docs/examples/presences/upsert.md | 19 -- src/index.ts | 1 - src/models.ts | 65 ---- src/services/presences.ts | 373 --------------------- test/services/presences.test.js | 110 ------ 9 files changed, 632 deletions(-) delete mode 100644 docs/examples/presences/delete.md delete mode 100644 docs/examples/presences/get.md delete mode 100644 docs/examples/presences/list.md delete mode 100644 docs/examples/presences/update-presence.md delete mode 100644 docs/examples/presences/upsert.md delete mode 100644 src/services/presences.ts delete mode 100644 test/services/presences.test.js diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md deleted file mode 100644 index 4c1cfc24..00000000 --- a/docs/examples/presences/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const presences = new sdk.Presences(client); - -const result = await presences.delete({ - presenceId: '' -}); -``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md deleted file mode 100644 index 1e8a332d..00000000 --- a/docs/examples/presences/get.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const presences = new sdk.Presences(client); - -const result = await presences.get({ - presenceId: '' -}); -``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md deleted file mode 100644 index fbb18d4d..00000000 --- a/docs/examples/presences/list.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const presences = new sdk.Presences(client); - -const result = await presences.list({ - queries: [], // optional - total: false, // optional - ttl: 0 // optional -}); -``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update-presence.md deleted file mode 100644 index ffb1272f..00000000 --- a/docs/examples/presences/update-presence.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const presences = new sdk.Presences(client); - -const result = await presences.updatePresence({ - presenceId: '', - userId: '', - status: '', // optional - expiresAt: '2020-10-15T06:38:00.000+00:00', // optional - metadata: {}, // optional - permissions: [sdk.Permission.read(sdk.Role.any())], // optional - purge: false // optional -}); -``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md deleted file mode 100644 index 63b9267f..00000000 --- a/docs/examples/presences/upsert.md +++ /dev/null @@ -1,19 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const presences = new sdk.Presences(client); - -const result = await presences.upsert({ - presenceId: '', - userId: '', - status: '', - permissions: [sdk.Permission.read(sdk.Role.any())], // optional - expiresAt: '2020-10-15T06:38:00.000+00:00', // optional - metadata: {} // optional -}); -``` diff --git a/src/index.ts b/src/index.ts index d598e963..be8503ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,6 @@ export { Graphql } from './services/graphql'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; -export { Presences } from './services/presences'; export { Project } from './services/project'; export { Proxy } from './services/proxy'; export { Sites } from './services/sites'; diff --git a/src/models.ts b/src/models.ts index 06951df0..a16714b3 100644 --- a/src/models.ts +++ b/src/models.ts @@ -47,20 +47,6 @@ export namespace Models { documents: Document[]; } - /** - * Presences List - */ - export type PresenceList = { - /** - * Total number of presences that matched your query. - */ - total: number; - /** - * List of presences. - */ - presences: Presence[]; - } - /** * Tables List */ @@ -2683,57 +2669,6 @@ export namespace Models { [__default]: true; }; - /** - * Presence - */ - export type Presence = { - /** - * Presence ID. - */ - $id: string; - /** - * Presence sequence ID. - */ - $sequence: string; - /** - * Presence creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Presence update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Presence permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ - $permissions: string[]; - /** - * User internal ID. - */ - userInternalId: string; - /** - * User ID. - */ - userId: string; - /** - * Presence status. - */ - status?: string; - /** - * Presence source. - */ - source: string; - /** - * Presence expiry date in ISO 8601 format. - */ - expiresAt?: string; - } - - export type DefaultPresence = Presence & { - [key: string]: any; - [__default]: true; - }; - /** * Log */ diff --git a/src/services/presences.ts b/src/services/presences.ts deleted file mode 100644 index 36a98567..00000000 --- a/src/services/presences.ts +++ /dev/null @@ -1,373 +0,0 @@ -import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; -import type { Models } from '../models'; - - - -export class Presences { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * List presence logs. - * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - */ - list(params?: { queries?: string[], total?: boolean, ttl?: number }): Promise>; - /** - * List presence logs. - * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - list(queries?: string[], total?: boolean, ttl?: number): Promise>; - list( - paramsOrFirst?: { queries?: string[], total?: boolean, ttl?: number } | string[], - ...rest: [(boolean)?, (number)?] - ): Promise> { - let params: { queries?: string[], total?: boolean, ttl?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean, ttl?: number }; - } else { - params = { - queries: paramsOrFirst as string[], - total: rest[0] as boolean, - ttl: rest[1] as number - }; - } - - const queries = params.queries; - const total = params.total; - const ttl = params.ttl; - - - const apiPath = '/presences'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Get a presence log by its unique ID. - * - * @param {string} params.presenceId - Presence unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - get(params: { presenceId: string }): Promise; - /** - * Get a presence log by its unique ID. - * - * @param {string} presenceId - Presence unique ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - get(presenceId: string): Promise; - get( - paramsOrFirst: { presenceId: string } | string - ): Promise { - let params: { presenceId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string }; - } else { - params = { - presenceId: paramsOrFirst as string - }; - } - - const presenceId = params.presenceId; - - if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); - } - - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Create or update a presence log by its unique ID. - * - * @param {string} params.presenceId - Presence unique ID. - * @param {string} params.userId - User ID. - * @param {string} params.status - Presence status. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.expiresAt - Presence expiry datetime. - * @param {object} params.metadata - Presence metadata object. - * @throws {AppwriteException} - * @returns {Promise} - */ - upsert(params: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }): Promise; - /** - * Create or update a presence log by its unique ID. - * - * @param {string} presenceId - Presence unique ID. - * @param {string} userId - User ID. - * @param {string} status - Presence status. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} expiresAt - Presence expiry datetime. - * @param {object} metadata - Presence metadata object. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - upsert(presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object): Promise; - upsert( - paramsOrFirst: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object } | string, - ...rest: [(string)?, (string)?, (string[])?, (string)?, (object)?] - ): Promise { - let params: { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string, userId?: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; - } else { - params = { - presenceId: paramsOrFirst as string, - userId: rest[0] as string, - status: rest[1] as string, - permissions: rest[2] as string[], - expiresAt: rest[3] as string, - metadata: rest[4] as object - }; - } - - const presenceId = params.presenceId; - const userId = params.userId; - const status = params.status; - const permissions = params.permissions; - const expiresAt = params.expiresAt; - const metadata = params.metadata; - - if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); - } - if (typeof userId === 'undefined') { - throw new AppwriteException('Missing required parameter: "userId"'); - } - if (typeof status === 'undefined') { - throw new AppwriteException('Missing required parameter: "status"'); - } - - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); - const payload: Payload = {}; - if (typeof userId !== 'undefined') { - payload['userId'] = userId; - } - if (typeof status !== 'undefined') { - payload['status'] = status; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof expiresAt !== 'undefined') { - payload['expiresAt'] = expiresAt; - } - if (typeof metadata !== 'undefined') { - payload['metadata'] = metadata; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload, - ); - } - - /** - * Update a presence log by its unique ID. - * - * @param {string} params.presenceId - Presence unique ID. - * @param {string} params.userId - User ID. - * @param {string} params.status - Presence status. - * @param {string} params.expiresAt - Presence expiry datetime. - * @param {object} params.metadata - Presence metadata object. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.purge - When true, purge cached responses used by list presences endpoint. - * @throws {AppwriteException} - * @returns {Promise} - */ - updatePresence(params: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }): Promise; - /** - * Update a presence log by its unique ID. - * - * @param {string} presenceId - Presence unique ID. - * @param {string} userId - User ID. - * @param {string} status - Presence status. - * @param {string} expiresAt - Presence expiry datetime. - * @param {object} metadata - Presence metadata object. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} purge - When true, purge cached responses used by list presences endpoint. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updatePresence(presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean): Promise; - updatePresence( - paramsOrFirst: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean } | string, - ...rest: [(string)?, (string)?, (string)?, (object)?, (string[])?, (boolean)?] - ): Promise { - let params: { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string, userId?: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; - } else { - params = { - presenceId: paramsOrFirst as string, - userId: rest[0] as string, - status: rest[1] as string, - expiresAt: rest[2] as string, - metadata: rest[3] as object, - permissions: rest[4] as string[], - purge: rest[5] as boolean - }; - } - - const presenceId = params.presenceId; - const userId = params.userId; - const status = params.status; - const expiresAt = params.expiresAt; - const metadata = params.metadata; - const permissions = params.permissions; - const purge = params.purge; - - if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); - } - if (typeof userId === 'undefined') { - throw new AppwriteException('Missing required parameter: "userId"'); - } - - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); - const payload: Payload = {}; - if (typeof userId !== 'undefined') { - payload['userId'] = userId; - } - if (typeof status !== 'undefined') { - payload['status'] = status; - } - if (typeof expiresAt !== 'undefined') { - payload['expiresAt'] = expiresAt; - } - if (typeof metadata !== 'undefined') { - payload['metadata'] = metadata; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof purge !== 'undefined') { - payload['purge'] = purge; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload, - ); - } - - /** - * Delete a presence log by its unique ID. - * - * @param {string} params.presenceId - Presence unique ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - delete(params: { presenceId: string }): Promise<{}>; - /** - * Delete a presence log by its unique ID. - * - * @param {string} presenceId - Presence unique ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - delete(presenceId: string): Promise<{}>; - delete( - paramsOrFirst: { presenceId: string } | string - ): Promise<{}> { - let params: { presenceId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string }; - } else { - params = { - presenceId: paramsOrFirst as string - }; - } - - const presenceId = params.presenceId; - - if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); - } - - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload, - ); - } -} diff --git a/test/services/presences.test.js b/test/services/presences.test.js deleted file mode 100644 index 49e35fc1..00000000 --- a/test/services/presences.test.js +++ /dev/null @@ -1,110 +0,0 @@ -const { Client } = require("../../dist/client"); -const { InputFile } = require("../../dist/inputFile"); -const { Presences } = require("../../dist/services/presences"); - -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); - -describe('Presences', () => { - const client = new Client(); - const presences = new Presences(client); - - - test('test method list()', async () => { - const data = { - 'total': 5, - 'presences': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await presences.list( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method get()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$sequence': '1', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - '\$permissions': [], - 'userInternalId': '1', - 'userId': '674af8f3e12a5f9ac0be', - 'source': 'HTTP',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await presences.get( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method upsert()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$sequence': '1', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - '\$permissions': [], - 'userInternalId': '1', - 'userId': '674af8f3e12a5f9ac0be', - 'source': 'HTTP',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await presences.upsert( - '', - '', - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method updatePresence()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - '\$sequence': '1', - '\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - '\$permissions': [], - 'userInternalId': '1', - 'userId': '674af8f3e12a5f9ac0be', - 'source': 'HTTP',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await presences.updatePresence( - '', - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method delete()', async () => { - const data = {message: ""}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await presences.delete( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - }) From f684cd3a637084ade4cf23510c6a36c492a36a14 Mon Sep 17 00:00:00 2001 From: Appwrite Date: Fri, 8 May 2026 11:43:07 +0000 Subject: [PATCH 15/18] test --- __test_push.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 __test_push.txt diff --git a/__test_push.txt b/__test_push.txt new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/__test_push.txt @@ -0,0 +1 @@ +test From 1f7ee72e20e28f4543d4560643943518030e7669 Mon Sep 17 00:00:00 2001 From: Appwrite Date: Fri, 8 May 2026 11:43:43 +0000 Subject: [PATCH 16/18] chore: remove accidental test artifact --- __test_push.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 __test_push.txt diff --git a/__test_push.txt b/__test_push.txt deleted file mode 100644 index 9daeafb9..00000000 --- a/__test_push.txt +++ /dev/null @@ -1 +0,0 @@ -test From a11935c6c60b43743c9be49116ce05d8452beee8 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:54:15 +0000 Subject: [PATCH 17/18] chore: update Node.js SDK to 24.1.0 --- .github/workflows/publish.yml | 4 +- README.md | 2 +- .../examples/project/get-o-auth-2-provider.md | 2 +- docs/examples/project/get-policy.md | 2 +- docs/examples/project/update-auth-method.md | 2 +- src/enums/{method-id.ts => auth-method.ts} | 2 +- src/enums/o-auth-provider.ts | 2 + src/enums/{policy-id.ts => project-policy.ts} | 2 +- src/enums/provider-id.ts | 49 --- src/enums/scopes.ts | 2 - src/index.ts | 5 +- src/services/project.ts | 311 +++++++++--------- test/services/project.test.js | 122 +++---- 13 files changed, 227 insertions(+), 280 deletions(-) rename src/enums/{method-id.ts => auth-method.ts} (88%) rename src/enums/{policy-id.ts => project-policy.ts} (93%) delete mode 100644 src/enums/provider-id.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e6ea266e..47ba2484 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Use Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '24.14.1' registry-url: 'https://registry.npmjs.org' diff --git a/README.md b/README.md index 4bed7d85..b3be4795 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index a6df0d67..ce59ec68 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getOAuth2Provider({ - providerId: sdk.ProviderId.Amazon + providerId: sdk.OAuthProvider.Amazon }); ``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index df5abb54..5387dfe0 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.getPolicy({ - policyId: sdk.PolicyId.PasswordDictionary + policyId: sdk.ProjectPolicy.PasswordDictionary }); ``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index d6b2c6ca..ca8b2981 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -9,7 +9,7 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.updateAuthMethod({ - methodId: sdk.MethodId.EmailPassword, + methodId: sdk.AuthMethod.EmailPassword, enabled: false }); ``` diff --git a/src/enums/method-id.ts b/src/enums/auth-method.ts similarity index 88% rename from src/enums/method-id.ts rename to src/enums/auth-method.ts index 062d0d0e..d5800ad9 100644 --- a/src/enums/method-id.ts +++ b/src/enums/auth-method.ts @@ -1,4 +1,4 @@ -export enum MethodId { +export enum AuthMethod { Emailpassword = 'email-password', Magicurl = 'magic-url', Emailotp = 'email-otp', diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index cc9e340b..06189633 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -42,4 +42,6 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/policy-id.ts b/src/enums/project-policy.ts similarity index 93% rename from src/enums/policy-id.ts rename to src/enums/project-policy.ts index ab1c4cd2..d52bf99a 100644 --- a/src/enums/policy-id.ts +++ b/src/enums/project-policy.ts @@ -1,4 +1,4 @@ -export enum PolicyId { +export enum ProjectPolicy { Passworddictionary = 'password-dictionary', Passwordhistory = 'password-history', Passwordpersonaldata = 'password-personal-data', diff --git a/src/enums/provider-id.ts b/src/enums/provider-id.ts deleted file mode 100644 index 943d7334..00000000 --- a/src/enums/provider-id.ts +++ /dev/null @@ -1,49 +0,0 @@ -export enum ProviderId { - Amazon = 'amazon', - Apple = 'apple', - Auth0 = 'auth0', - Authentik = 'authentik', - Autodesk = 'autodesk', - Bitbucket = 'bitbucket', - Bitly = 'bitly', - Box = 'box', - Dailymotion = 'dailymotion', - Discord = 'discord', - Disqus = 'disqus', - Dropbox = 'dropbox', - Etsy = 'etsy', - Facebook = 'facebook', - Figma = 'figma', - Fusionauth = 'fusionauth', - Github = 'github', - Gitlab = 'gitlab', - Google = 'google', - Keycloak = 'keycloak', - Kick = 'kick', - Linkedin = 'linkedin', - Microsoft = 'microsoft', - Notion = 'notion', - Oidc = 'oidc', - Okta = 'okta', - Paypal = 'paypal', - PaypalSandbox = 'paypalSandbox', - Podio = 'podio', - Salesforce = 'salesforce', - Slack = 'slack', - Spotify = 'spotify', - Stripe = 'stripe', - Tradeshift = 'tradeshift', - TradeshiftBox = 'tradeshiftBox', - Twitch = 'twitch', - Wordpress = 'wordpress', - X = 'x', - Yahoo = 'yahoo', - Yammer = 'yammer', - Yandex = 'yandex', - Zoho = 'zoho', - Zoom = 'zoom', - Mock = 'mock', - Mockunverified = 'mock-unverified', - GithubImagine = 'githubImagine', - GoogleImagine = 'googleImagine', -} \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index bab24a98..5c812100 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -77,8 +77,6 @@ export enum Scopes { SchedulesWrite = 'schedules.write', VcsRead = 'vcs.read', VcsWrite = 'vcs.write', - PresencesRead = 'presences.read', - PresencesWrite = 'presences.write', BackupsPoliciesRead = 'backups.policies.read', BackupsPoliciesWrite = 'backups.policies.write', ArchivesRead = 'archives.read', diff --git a/src/index.ts b/src/index.ts index be8503ac..60e8093b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,9 +48,8 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; -export { MethodId } from './enums/method-id'; -export { ProviderId } from './enums/provider-id'; -export { PolicyId } from './enums/policy-id'; +export { AuthMethod } from './enums/auth-method'; +export { ProjectPolicy } from './enums/project-policy'; export { ProtocolId } from './enums/protocol-id'; export { ServiceId } from './enums/service-id'; export { Secure } from './enums/secure'; diff --git a/src/services/project.ts b/src/services/project.ts index 187567dc..b818870b 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -2,10 +2,10 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; -import { MethodId } from '../enums/method-id'; +import { AuthMethod } from '../enums/auth-method'; import { Scopes } from '../enums/scopes'; -import { ProviderId } from '../enums/provider-id'; -import { PolicyId } from '../enums/policy-id'; +import { OAuthProvider } from '../enums/o-auth-provider'; +import { ProjectPolicy } from '../enums/project-policy'; import { ProtocolId } from '../enums/protocol-id'; import { ServiceId } from '../enums/service-id'; import { Secure } from '../enums/secure'; @@ -46,33 +46,33 @@ export class Project { /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {MethodId} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {AuthMethod} params.methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} params.enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} */ - updateAuthMethod(params: { methodId: MethodId, enabled: boolean }): Promise; + updateAuthMethod(params: { methodId: AuthMethod, enabled: boolean }): Promise; /** * Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. * - * @param {MethodId} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + * @param {AuthMethod} methodId - Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone * @param {boolean} enabled - Auth method status. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateAuthMethod(methodId: MethodId, enabled: boolean): Promise; + updateAuthMethod(methodId: AuthMethod, enabled: boolean): Promise; updateAuthMethod( - paramsOrFirst: { methodId: MethodId, enabled: boolean } | MethodId, + paramsOrFirst: { methodId: AuthMethod, enabled: boolean } | AuthMethod, ...rest: [(boolean)?] ): Promise { - let params: { methodId: MethodId, enabled: boolean }; + let params: { methodId: AuthMethod, enabled: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('methodId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { methodId: MethodId, enabled: boolean }; + params = (paramsOrFirst || {}) as { methodId: AuthMethod, enabled: boolean }; } else { params = { - methodId: paramsOrFirst as MethodId, + methodId: paramsOrFirst as AuthMethod, enabled: rest[0] as boolean }; } @@ -910,65 +910,11 @@ export class Project { ); } - /** - * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. - * - * @param {ProviderId} params.providerId - OAuth2 provider key. For example: github, google, apple. - * @throws {AppwriteException} - * @returns {Promise} - */ - getOAuth2Provider(params: { providerId: ProviderId }): Promise; - /** - * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. - * - * @param {ProviderId} providerId - OAuth2 provider key. For example: github, google, apple. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getOAuth2Provider(providerId: ProviderId): Promise; - getOAuth2Provider( - paramsOrFirst: { providerId: ProviderId } | ProviderId - ): Promise { - let params: { providerId: ProviderId }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('providerId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: ProviderId }; - } else { - params = { - providerId: paramsOrFirst as ProviderId - }; - } - - const providerId = params.providerId; - - if (typeof providerId === 'undefined') { - throw new AppwriteException('Missing required parameter: "providerId"'); - } - - const apiPath = '/project/oauth2/:provider'; - const payload: Payload = {}; - if (typeof providerId !== 'undefined') { - payload['providerId'] = providerId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Update the project OAuth2 Amazon configuration. * * @param {string} params.clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -978,7 +924,7 @@ export class Project { * Update the project OAuth2 Amazon configuration. * * @param {string} clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1116,7 +1062,7 @@ export class Project { * Update the project OAuth2 Auth0 configuration. * * @param {string} params.clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: * @param {string} params.endpoint - Domain of Auth0 instance. For example: example.us.auth0.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1127,7 +1073,7 @@ export class Project { * Update the project OAuth2 Auth0 configuration. * * @param {string} clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: * @param {string} endpoint - Domain of Auth0 instance. For example: example.us.auth0.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1190,7 +1136,7 @@ export class Project { * Update the project OAuth2 Authentik configuration. * * @param {string} params.clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: * @param {string} params.endpoint - Domain of Authentik instance. For example: example.authentik.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1201,7 +1147,7 @@ export class Project { * Update the project OAuth2 Authentik configuration. * * @param {string} clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: * @param {string} endpoint - Domain of Authentik instance. For example: example.authentik.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1264,7 +1210,7 @@ export class Project { * Update the project OAuth2 Autodesk configuration. * * @param {string} params.clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1274,7 +1220,7 @@ export class Project { * Update the project OAuth2 Autodesk configuration. * * @param {string} clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1331,7 +1277,7 @@ export class Project { * Update the project OAuth2 Bitbucket configuration. * * @param {string} params.key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1341,7 +1287,7 @@ export class Project { * Update the project OAuth2 Bitbucket configuration. * * @param {string} key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1398,7 +1344,7 @@ export class Project { * Update the project OAuth2 Bitly configuration. * * @param {string} params.clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1408,7 +1354,7 @@ export class Project { * Update the project OAuth2 Bitly configuration. * * @param {string} clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1465,7 +1411,7 @@ export class Project { * Update the project OAuth2 Box configuration. * * @param {string} params.clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1475,7 +1421,7 @@ export class Project { * Update the project OAuth2 Box configuration. * * @param {string} clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1532,7 +1478,7 @@ export class Project { * Update the project OAuth2 Dailymotion configuration. * * @param {string} params.apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1542,7 +1488,7 @@ export class Project { * Update the project OAuth2 Dailymotion configuration. * * @param {string} apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1599,7 +1545,7 @@ export class Project { * Update the project OAuth2 Discord configuration. * * @param {string} params.clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1609,7 +1555,7 @@ export class Project { * Update the project OAuth2 Discord configuration. * * @param {string} clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1666,7 +1612,7 @@ export class Project { * Update the project OAuth2 Disqus configuration. * * @param {string} params.publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1676,7 +1622,7 @@ export class Project { * Update the project OAuth2 Disqus configuration. * * @param {string} publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1733,7 +1679,7 @@ export class Project { * Update the project OAuth2 Dropbox configuration. * * @param {string} params.appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1743,7 +1689,7 @@ export class Project { * Update the project OAuth2 Dropbox configuration. * * @param {string} appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1800,7 +1746,7 @@ export class Project { * Update the project OAuth2 Etsy configuration. * * @param {string} params.keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1810,7 +1756,7 @@ export class Project { * Update the project OAuth2 Etsy configuration. * * @param {string} keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1867,7 +1813,7 @@ export class Project { * Update the project OAuth2 Facebook configuration. * * @param {string} params.appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1877,7 +1823,7 @@ export class Project { * Update the project OAuth2 Facebook configuration. * * @param {string} appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1934,7 +1880,7 @@ export class Project { * Update the project OAuth2 Figma configuration. * * @param {string} params.clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1944,7 +1890,7 @@ export class Project { * Update the project OAuth2 Figma configuration. * * @param {string} clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2001,7 +1947,7 @@ export class Project { * Update the project OAuth2 FusionAuth configuration. * * @param {string} params.clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: * @param {string} params.endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2012,7 +1958,7 @@ export class Project { * Update the project OAuth2 FusionAuth configuration. * * @param {string} clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: * @param {string} endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2075,7 +2021,7 @@ export class Project { * Update the project OAuth2 GitHub configuration. * * @param {string} params.clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2085,7 +2031,7 @@ export class Project { * Update the project OAuth2 GitHub configuration. * * @param {string} clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2142,7 +2088,7 @@ export class Project { * Update the project OAuth2 Gitlab configuration. * * @param {string} params.applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: * @param {string} params.endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2153,7 +2099,7 @@ export class Project { * Update the project OAuth2 Gitlab configuration. * * @param {string} applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: * @param {string} endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2215,8 +2161,8 @@ export class Project { /** * Update the project OAuth2 Google configuration. * - * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com - * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret + * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com + * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2225,8 +2171,8 @@ export class Project { /** * Update the project OAuth2 Google configuration. * - * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com - * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret + * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com + * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2283,7 +2229,7 @@ export class Project { * Update the project OAuth2 Keycloak configuration. * * @param {string} params.clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: * @param {string} params.endpoint - Domain of Keycloak instance. For example: keycloak.example.com * @param {string} params.realmName - Keycloak realm name. For example: appwrite-realm * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2295,7 +2241,7 @@ export class Project { * Update the project OAuth2 Keycloak configuration. * * @param {string} clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: * @param {string} endpoint - Domain of Keycloak instance. For example: keycloak.example.com * @param {string} realmName - Keycloak realm name. For example: appwrite-realm * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2364,7 +2310,7 @@ export class Project { * Update the project OAuth2 Kick configuration. * * @param {string} params.clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2374,7 +2320,7 @@ export class Project { * Update the project OAuth2 Kick configuration. * * @param {string} clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2431,7 +2377,7 @@ export class Project { * Update the project OAuth2 Linkedin configuration. * * @param {string} params.clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret + * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2441,7 +2387,7 @@ export class Project { * Update the project OAuth2 Linkedin configuration. * * @param {string} clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret + * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2498,7 +2444,7 @@ export class Project { * Update the project OAuth2 Microsoft configuration. * * @param {string} params.applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: * @param {string} params.tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2509,7 +2455,7 @@ export class Project { * Update the project OAuth2 Microsoft configuration. * * @param {string} applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: * @param {string} tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2572,7 +2518,7 @@ export class Project { * Update the project OAuth2 Notion configuration. * * @param {string} params.oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2582,7 +2528,7 @@ export class Project { * Update the project OAuth2 Notion configuration. * * @param {string} oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2639,7 +2585,7 @@ export class Project { * Update the project OAuth2 Oidc configuration. * * @param {string} params.clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: * @param {string} params.wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration * @param {string} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token @@ -2653,7 +2599,7 @@ export class Project { * Update the project OAuth2 Oidc configuration. * * @param {string} clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: * @param {string} wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration * @param {string} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token @@ -2734,7 +2680,7 @@ export class Project { * Update the project OAuth2 Okta configuration. * * @param {string} params.clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: * @param {string} params.domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ * @param {string} params.authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2746,7 +2692,7 @@ export class Project { * Update the project OAuth2 Okta configuration. * * @param {string} clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: * @param {string} domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ * @param {string} authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2815,7 +2761,7 @@ export class Project { * Update the project OAuth2 Paypal configuration. * * @param {string} params.clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2825,7 +2771,7 @@ export class Project { * Update the project OAuth2 Paypal configuration. * * @param {string} clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2882,7 +2828,7 @@ export class Project { * Update the project OAuth2 PaypalSandbox configuration. * * @param {string} params.clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2892,7 +2838,7 @@ export class Project { * Update the project OAuth2 PaypalSandbox configuration. * * @param {string} clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2949,7 +2895,7 @@ export class Project { * Update the project OAuth2 Podio configuration. * * @param {string} params.clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2959,7 +2905,7 @@ export class Project { * Update the project OAuth2 Podio configuration. * * @param {string} clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3016,7 +2962,7 @@ export class Project { * Update the project OAuth2 Salesforce configuration. * * @param {string} params.customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3026,7 +2972,7 @@ export class Project { * Update the project OAuth2 Salesforce configuration. * * @param {string} customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3083,7 +3029,7 @@ export class Project { * Update the project OAuth2 Slack configuration. * * @param {string} params.clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3093,7 +3039,7 @@ export class Project { * Update the project OAuth2 Slack configuration. * * @param {string} clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3150,7 +3096,7 @@ export class Project { * Update the project OAuth2 Spotify configuration. * * @param {string} params.clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3160,7 +3106,7 @@ export class Project { * Update the project OAuth2 Spotify configuration. * * @param {string} clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3217,7 +3163,7 @@ export class Project { * Update the project OAuth2 Stripe configuration. * * @param {string} params.clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3227,7 +3173,7 @@ export class Project { * Update the project OAuth2 Stripe configuration. * * @param {string} clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3284,7 +3230,7 @@ export class Project { * Update the project OAuth2 Tradeshift configuration. * * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3294,7 +3240,7 @@ export class Project { * Update the project OAuth2 Tradeshift configuration. * * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3351,7 +3297,7 @@ export class Project { * Update the project OAuth2 Tradeshift Sandbox configuration. * * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3361,7 +3307,7 @@ export class Project { * Update the project OAuth2 Tradeshift Sandbox configuration. * * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3418,7 +3364,7 @@ export class Project { * Update the project OAuth2 Twitch configuration. * * @param {string} params.clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3428,7 +3374,7 @@ export class Project { * Update the project OAuth2 Twitch configuration. * * @param {string} clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3485,7 +3431,7 @@ export class Project { * Update the project OAuth2 WordPress configuration. * * @param {string} params.clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3495,7 +3441,7 @@ export class Project { * Update the project OAuth2 WordPress configuration. * * @param {string} clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3552,7 +3498,7 @@ export class Project { * Update the project OAuth2 X configuration. * * @param {string} params.customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3562,7 +3508,7 @@ export class Project { * Update the project OAuth2 X configuration. * * @param {string} customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3619,7 +3565,7 @@ export class Project { * Update the project OAuth2 Yahoo configuration. * * @param {string} params.clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3629,7 +3575,7 @@ export class Project { * Update the project OAuth2 Yahoo configuration. * * @param {string} clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3686,7 +3632,7 @@ export class Project { * Update the project OAuth2 Yandex configuration. * * @param {string} params.clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3696,7 +3642,7 @@ export class Project { * Update the project OAuth2 Yandex configuration. * * @param {string} clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3753,7 +3699,7 @@ export class Project { * Update the project OAuth2 Zoho configuration. * * @param {string} params.clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3763,7 +3709,7 @@ export class Project { * Update the project OAuth2 Zoho configuration. * * @param {string} clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3820,7 +3766,7 @@ export class Project { * Update the project OAuth2 Zoom configuration. * * @param {string} params.clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3830,7 +3776,7 @@ export class Project { * Update the project OAuth2 Zoom configuration. * * @param {string} clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3883,6 +3829,57 @@ export class Project { ); } + /** + * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. + * + * @param {OAuthProvider} params.providerId - OAuth2 provider key. For example: github, google, apple. + * @throws {AppwriteException} + * @returns {Promise} + */ + getOAuth2Provider(params: { providerId: OAuthProvider }): Promise; + /** + * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. + * + * @param {OAuthProvider} providerId - OAuth2 provider key. For example: github, google, apple. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getOAuth2Provider(providerId: OAuthProvider): Promise; + getOAuth2Provider( + paramsOrFirst: { providerId: OAuthProvider } | OAuthProvider + ): Promise { + let params: { providerId: OAuthProvider }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('providerId' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { providerId: OAuthProvider }; + } else { + params = { + providerId: paramsOrFirst as OAuthProvider + }; + } + + const providerId = params.providerId; + + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/project/oauth2/{providerId}'.replace('{providerId}', providerId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. * @@ -5377,30 +5374,30 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {PolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicy} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} */ - getPolicy(params: { policyId: PolicyId }): Promise; + getPolicy(params: { policyId: ProjectPolicy }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {PolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. + * @param {ProjectPolicy} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: PolicyId): Promise; + getPolicy(policyId: ProjectPolicy): Promise; getPolicy( - paramsOrFirst: { policyId: PolicyId } | PolicyId + paramsOrFirst: { policyId: ProjectPolicy } | ProjectPolicy ): Promise { - let params: { policyId: PolicyId }; + let params: { policyId: ProjectPolicy }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: PolicyId }; + params = (paramsOrFirst || {}) as { policyId: ProjectPolicy }; } else { params = { - policyId: paramsOrFirst as PolicyId + policyId: paramsOrFirst as ProjectPolicy }; } diff --git a/test/services/project.test.js b/test/services/project.test.js index 06fe2715..51cedbd9 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -440,31 +440,12 @@ describe('Project', () => { expect(response).toEqual(data); }); - test('test method getOAuth2Provider()', async () => { - const data = { - '\$id': 'github', - 'enabled': true, - 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', - 'tenant': 'common',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await project.getOAuth2Provider( - 'amazon', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method updateOAuth2Amazon()', async () => { const data = { '\$id': 'github', 'enabled': true, 'clientId': 'amzn1.application-oa2-client.87400c00000000000000000000063d5b2', - 'clientSecret': '79ffe4000000000000000000000000000000000000000000000000000002de55',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Amazon( @@ -500,7 +481,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'OaOkIA000000000000000000005KLSYq', - 'clientSecret': 'zXz0000-00000000000000000000000000000-00000000000000000000PJafnF', + 'clientSecret': '', 'endpoint': 'example.us.auth0.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -518,7 +499,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dTKOPa0000000000000000000000000000e7G8hv', - 'clientSecret': 'ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK', + 'clientSecret': '', 'endpoint': 'example.authentik.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -536,7 +517,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '5zw90v00000000000000000000kVYXN7', - 'clientSecret': '7I000000000000MW',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Autodesk( @@ -553,7 +534,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'key': 'Knt70000000000ByRc', - 'secret': 'NMfLZJ00000000000000000000TLQdDx',}; + 'secret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitbucket( @@ -570,7 +551,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'd95151000000000000000000000000000067af9b', - 'clientSecret': 'a13e250000000000000000000000000000d73095',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitly( @@ -587,7 +568,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'deglcs00000000000000000000x2og6y', - 'clientSecret': 'OKM1f100000000000000000000eshEif',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Box( @@ -604,7 +585,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'apiKey': '07a9000000000000067f', - 'apiSecret': 'a399a90000000000000000000000000000d90639',}; + 'apiSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dailymotion( @@ -621,7 +602,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '950722000000343754', - 'clientSecret': 'YmPXnM000000000000000000002zFg5D',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Discord( @@ -638,7 +619,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'publicKey': 'cgegH70000000000000000000000000000000000000000000000000000Hr1nYX', - 'secretKey': 'W7Bykj00000000000000000000000000000000000000000000000000003o43w9',}; + 'secretKey': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Disqus( @@ -655,7 +636,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appKey': 'jl000000000009t', - 'appSecret': 'g200000000000vw',}; + 'appSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dropbox( @@ -672,7 +653,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'keyString': 'nsgzxh0000000000008j85a2', - 'sharedSecret': 'tp000000ru',}; + 'sharedSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Etsy( @@ -689,7 +670,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appId': '260600000007694', - 'appSecret': '2d0b2800000000000000000000d38af4',}; + 'appSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Facebook( @@ -706,7 +687,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'byay5H0000000000VtiI40', - 'clientSecret': 'yEpOYn0000000000000000004iIsU5',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Figma( @@ -723,7 +704,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'b2222c00-0000-0000-0000-000000862097', - 'clientSecret': 'Jx4s0C0000000000000000000000000000000wGqLsc', + 'clientSecret': '', 'endpoint': 'example.fusionauth.io',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -741,7 +722,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'e4d87900000000540733', - 'clientSecret': '5e07c00000000000000000000000000000198bcc',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2GitHub( @@ -758,7 +739,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': 'd41ffe0000000000000000000000000000000000000000000000000000d5e252', - 'secret': 'gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38', + 'secret': '', 'endpoint': 'https://gitlab.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -775,8 +756,8 @@ describe('Project', () => { const data = { '\$id': 'github', 'enabled': true, - 'clientId': 'your-google-client-id.apps.googleusercontent.com', - 'clientSecret': 'your-google-client-secret',}; + 'clientId': '120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com', + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Google( @@ -793,7 +774,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-o0000000st-app', - 'clientSecret': 'jdjrJd00000000000000000000HUsaZO', + 'clientSecret': '', 'endpoint': 'keycloak.example.com', 'realmName': 'appwrite-realm',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -812,7 +793,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '01KQ7C00000000000001MFHS32', - 'clientSecret': '34ac5600000000000000000000000000000000000000000000000000e830c8b',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Kick( @@ -829,7 +810,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '770000000000dv', - 'primaryClientSecret': 'your-linkedin-client-secret',}; + 'primaryClientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Linkedin( @@ -846,7 +827,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', + 'applicationSecret': '', 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -864,7 +845,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauthClientId': '341d8700-0000-0000-0000-000000446ee3', - 'oauthClientSecret': 'secret_dLUr4b000000000000000000000000000000lFHAa9',}; + 'oauthClientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Notion( @@ -881,7 +862,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'qibI2x0000000000000000000000000006L2YFoG', - 'clientSecret': 'Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV', + 'clientSecret': '', 'wellKnownURL': 'https://myoauth.com/.well-known/openid-configuration', 'authorizationURL': 'https://myoauth.com/oauth2/authorize', 'tokenURL': 'https://myoauth.com/oauth2/token', @@ -902,7 +883,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '0oa00000000000000698', - 'clientSecret': 'Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV', + 'clientSecret': '', 'domain': 'trial-6400025.okta.com', 'authorizationServerId': 'aus000000000000000h7z',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -921,7 +902,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + 'secretKey': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Paypal( @@ -938,7 +919,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + 'secretKey': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2PaypalSandbox( @@ -955,7 +936,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-oauth-test-app', - 'clientSecret': 'Rn247T0000000000000000000000000000000000000000000000000000W2zWTN',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Podio( @@ -972,7 +953,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': '3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq', - 'customerSecret': '3w000000000000e2',}; + 'customerSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Salesforce( @@ -989,7 +970,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '23000000089.15000000000023', - 'clientSecret': '81656000000000000000000000f3d2fd',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Slack( @@ -1006,7 +987,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6ec271000000000000000000009beace', - 'clientSecret': 'db068a000000000000000000008b5b9f',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Spotify( @@ -1023,7 +1004,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'ca_UKibXX0000000000000000000006byvR', - 'apiSecretKey': 'sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp',}; + 'apiSecretKey': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Stripe( @@ -1040,7 +1021,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + 'oauth2ClientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Tradeshift( @@ -1057,7 +1038,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + 'oauth2ClientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2TradeshiftSandbox( @@ -1074,7 +1055,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'vvi0in000000000000000000ikmt9p', - 'clientSecret': 'pmapue000000000000000000zylw3v',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Twitch( @@ -1091,7 +1072,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '130005', - 'clientSecret': 'PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2WordPress( @@ -1108,7 +1089,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': 'slzZV0000000000000NFLaWT', - 'secretKey': 'tkEPkp00000000000000000000000000000000000000FTxbI9',}; + 'secretKey': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2X( @@ -1125,7 +1106,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm', - 'clientSecret': 'cf978f0000000000000000000000000000c5e2e9',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yahoo( @@ -1142,7 +1123,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6a8a6a0000000000000000000091483c', - 'clientSecret': 'bbf98500000000000000000000c75a63',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yandex( @@ -1159,7 +1140,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '1000.83C178000000000000000000RPNX0B', - 'clientSecret': 'fb5cac000000000000000000000000000000a68f6e',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoho( @@ -1176,7 +1157,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'QMAC00000000000000w0AQ', - 'clientSecret': 'GAWsG4000000000000000000007U01ON',}; + 'clientSecret': '',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoom( @@ -1188,6 +1169,25 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method getOAuth2Provider()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', + 'applicationSecret': '', + 'tenant': 'common',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getOAuth2Provider( + 'amazon', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listPlatforms()', async () => { const data = { 'total': 5, From e0bb47600054e9c7d696515ce8e2f87cc1d65973 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 12:31:18 +0000 Subject: [PATCH 18/18] chore: update Node.js SDK to 24.1.0 --- .github/workflows/publish.yml | 4 ++-- docs/examples/databases/create-big-int-attribute.md | 2 +- docs/examples/databases/create-boolean-attribute.md | 2 +- docs/examples/databases/create-datetime-attribute.md | 2 +- docs/examples/databases/create-email-attribute.md | 2 +- docs/examples/databases/create-enum-attribute.md | 2 +- docs/examples/databases/create-float-attribute.md | 2 +- docs/examples/databases/create-integer-attribute.md | 2 +- docs/examples/databases/create-ip-attribute.md | 2 +- docs/examples/databases/create-line-attribute.md | 2 +- docs/examples/databases/create-longtext-attribute.md | 2 +- docs/examples/databases/create-mediumtext-attribute.md | 2 +- docs/examples/databases/create-point-attribute.md | 2 +- docs/examples/databases/create-polygon-attribute.md | 2 +- docs/examples/databases/create-string-attribute.md | 2 +- docs/examples/databases/create-text-attribute.md | 2 +- docs/examples/databases/create-url-attribute.md | 2 +- docs/examples/databases/create-varchar-attribute.md | 2 +- docs/examples/databases/update-big-int-attribute.md | 2 +- docs/examples/databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-email-attribute.md | 2 +- docs/examples/databases/update-enum-attribute.md | 2 +- docs/examples/databases/update-float-attribute.md | 2 +- docs/examples/databases/update-integer-attribute.md | 2 +- docs/examples/databases/update-ip-attribute.md | 2 +- docs/examples/databases/update-line-attribute.md | 2 +- docs/examples/databases/update-longtext-attribute.md | 2 +- docs/examples/databases/update-mediumtext-attribute.md | 2 +- docs/examples/databases/update-point-attribute.md | 2 +- docs/examples/databases/update-polygon-attribute.md | 2 +- docs/examples/databases/update-string-attribute.md | 2 +- docs/examples/databases/update-text-attribute.md | 2 +- docs/examples/databases/update-url-attribute.md | 2 +- docs/examples/databases/update-varchar-attribute.md | 2 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/tablesdb/create-big-int-column.md | 2 +- docs/examples/tablesdb/create-boolean-column.md | 2 +- docs/examples/tablesdb/create-datetime-column.md | 2 +- docs/examples/tablesdb/create-email-column.md | 2 +- docs/examples/tablesdb/create-enum-column.md | 2 +- docs/examples/tablesdb/create-float-column.md | 2 +- docs/examples/tablesdb/create-integer-column.md | 2 +- docs/examples/tablesdb/create-ip-column.md | 2 +- docs/examples/tablesdb/create-line-column.md | 2 +- docs/examples/tablesdb/create-longtext-column.md | 2 +- docs/examples/tablesdb/create-mediumtext-column.md | 2 +- docs/examples/tablesdb/create-point-column.md | 2 +- docs/examples/tablesdb/create-polygon-column.md | 2 +- docs/examples/tablesdb/create-string-column.md | 2 +- docs/examples/tablesdb/create-text-column.md | 2 +- docs/examples/tablesdb/create-url-column.md | 2 +- docs/examples/tablesdb/create-varchar-column.md | 2 +- docs/examples/tablesdb/update-big-int-column.md | 2 +- docs/examples/tablesdb/update-boolean-column.md | 2 +- docs/examples/tablesdb/update-datetime-column.md | 2 +- docs/examples/tablesdb/update-email-column.md | 2 +- docs/examples/tablesdb/update-enum-column.md | 2 +- docs/examples/tablesdb/update-float-column.md | 2 +- docs/examples/tablesdb/update-integer-column.md | 2 +- docs/examples/tablesdb/update-ip-column.md | 2 +- docs/examples/tablesdb/update-line-column.md | 2 +- docs/examples/tablesdb/update-longtext-column.md | 2 +- docs/examples/tablesdb/update-mediumtext-column.md | 2 +- docs/examples/tablesdb/update-point-column.md | 2 +- docs/examples/tablesdb/update-polygon-column.md | 2 +- docs/examples/tablesdb/update-string-column.md | 2 +- docs/examples/tablesdb/update-text-column.md | 2 +- docs/examples/tablesdb/update-url-column.md | 2 +- docs/examples/tablesdb/update-varchar-column.md | 2 +- 70 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 47ba2484..e6ea266e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v4 with: node-version: '24.14.1' registry-url: 'https://registry.npmjs.org' diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index 4aa7ddff..3d40ce75 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -15,7 +15,7 @@ const result = await databases.createBigIntAttribute({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 8202b7a0..606ca49c 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createBooleanAttribute({ collectionId: '', key: '', required: false, - default: false, // optional + xdefault: false, // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 1bd69d11..361ee95e 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '2020-10-15T06:38:00.000+00:00', // optional + xdefault: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index c4c674fa..13382c3d 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createEmailAttribute({ collectionId: '', key: '', required: false, - default: 'email@example.com', // optional + xdefault: 'email@example.com', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index b6f982a7..fe7abce4 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -14,7 +14,7 @@ const result = await databases.createEnumAttribute({ key: '', elements: [], required: false, - default: '', // optional + xdefault: '', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 583750c8..f179528f 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -15,7 +15,7 @@ const result = await databases.createFloatAttribute({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index ea7e766c..d0dbed90 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -15,7 +15,7 @@ const result = await databases.createIntegerAttribute({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 147b00a1..c21ad541 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createIpAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 518a2529..8d615095 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -13,6 +13,6 @@ const result = await databases.createLineAttribute({ collectionId: '', key: '', required: false, - default: [[1, 2], [3, 4], [5, 6]] // optional + xdefault: [[1, 2], [3, 4], [5, 6]] // optional }); ``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index cc83d250..b49077ee 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createLongtextAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 6bab1b49..44d9199f 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createMediumtextAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index d9581503..57058752 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -13,6 +13,6 @@ const result = await databases.createPointAttribute({ collectionId: '', key: '', required: false, - default: [1, 2] // optional + xdefault: [1, 2] // optional }); ``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 51f239da..f3562ab4 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -13,6 +13,6 @@ const result = await databases.createPolygonAttribute({ collectionId: '', key: '', required: false, - default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional }); ``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 18aeaf53..e0c2cdb4 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -14,7 +14,7 @@ const result = await databases.createStringAttribute({ key: '', size: 1, required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 3d56639a..48fd6ded 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createTextAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 43225e40..f0d1a29a 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createUrlAttribute({ collectionId: '', key: '', required: false, - default: 'https://example.com', // optional + xdefault: 'https://example.com', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 75ae5c34..64582747 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -14,7 +14,7 @@ const result = await databases.createVarcharAttribute({ key: '', size: 1, required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 75bbe092..1ff012a5 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateBigIntAttribute({ collectionId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 00952c3a..c9b165e9 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateBooleanAttribute({ collectionId: '', key: '', required: false, - default: false, + xdefault: false, newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index dfbb6005..6c65696b 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '2020-10-15T06:38:00.000+00:00', + xdefault: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index e7da572a..fa6c4319 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateEmailAttribute({ collectionId: '', key: '', required: false, - default: 'email@example.com', + xdefault: 'email@example.com', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 937af7a6..0fc74cdf 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -14,7 +14,7 @@ const result = await databases.updateEnumAttribute({ key: '', elements: [], required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 5af5be0c..894ab665 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateFloatAttribute({ collectionId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 14e7da96..10ddb38f 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateIntegerAttribute({ collectionId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 0f4d2a3a..5e53e5d7 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateIpAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 3b8acece..c106a035 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateLineAttribute({ collectionId: '', key: '', required: false, - default: [[1, 2], [3, 4], [5, 6]], // optional + xdefault: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index ca39b69a..d21f3988 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateLongtextAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index d08373e3..25857d5d 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateMediumtextAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 410ce3c5..96a4ae85 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updatePointAttribute({ collectionId: '', key: '', required: false, - default: [1, 2], // optional + xdefault: [1, 2], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index fa4ebe1f..72828a8a 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updatePolygonAttribute({ collectionId: '', key: '', required: false, - default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 0c75201b..1c509d28 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateStringAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', size: 1, // optional newKey: '' // optional }); diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 766c7f0a..3154f5a9 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateTextAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 64177d53..1cebc2f4 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateUrlAttribute({ collectionId: '', key: '', required: false, - default: 'https://example.com', + xdefault: 'https://example.com', newKey: '' // optional }); ``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 27f3b23b..43a1cf03 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateVarcharAttribute({ collectionId: '', key: '', required: false, - default: '', + xdefault: '', size: 1, // optional newKey: '' // optional }); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 63f7d6f4..f93d87e4 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -12,7 +12,7 @@ const result = await functions.createExecution({ functionId: '', body: '', // optional async: false, // optional - path: '', // optional + xpath: '', // optional method: sdk.ExecutionMethod.GET, // optional headers: {}, // optional scheduledAt: '' // optional diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 9c1c01f4..21ca0bfd 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -15,7 +15,7 @@ const result = await tablesDB.createBigIntColumn({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 2bbb32ad..b9df8ba8 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createBooleanColumn({ tableId: '', key: '', required: false, - default: false, // optional + xdefault: false, // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 6836b15e..602c2a1a 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createDatetimeColumn({ tableId: '', key: '', required: false, - default: '2020-10-15T06:38:00.000+00:00', // optional + xdefault: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 873d86f2..bdd59341 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createEmailColumn({ tableId: '', key: '', required: false, - default: 'email@example.com', // optional + xdefault: 'email@example.com', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 3aedee72..4016ce71 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -14,7 +14,7 @@ const result = await tablesDB.createEnumColumn({ key: '', elements: [], required: false, - default: '', // optional + xdefault: '', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 84649b79..b533f38a 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -15,7 +15,7 @@ const result = await tablesDB.createFloatColumn({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index e7dd69db..6e99e93e 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -15,7 +15,7 @@ const result = await tablesDB.createIntegerColumn({ required: false, min: null, // optional max: null, // optional - default: null, // optional + xdefault: null, // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index eacbd4b8..7d176b6a 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createIpColumn({ tableId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 195bf1f1..f99194c6 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -13,6 +13,6 @@ const result = await tablesDB.createLineColumn({ tableId: '', key: '', required: false, - default: [[1, 2], [3, 4], [5, 6]] // optional + xdefault: [[1, 2], [3, 4], [5, 6]] // optional }); ``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 0e43b442..89d37c47 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createLongtextColumn({ tableId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 42557dbe..daa59589 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createMediumtextColumn({ tableId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index a7d97ede..a68d1e43 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -13,6 +13,6 @@ const result = await tablesDB.createPointColumn({ tableId: '', key: '', required: false, - default: [1, 2] // optional + xdefault: [1, 2] // optional }); ``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 5dc84d79..0f4631bc 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -13,6 +13,6 @@ const result = await tablesDB.createPolygonColumn({ tableId: '', key: '', required: false, - default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional }); ``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index cd795740..255701ce 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -14,7 +14,7 @@ const result = await tablesDB.createStringColumn({ key: '', size: 1, required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 8f9960ac..e7b9a479 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createTextColumn({ tableId: '', key: '', required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index d511362a..01e27e7d 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createUrlColumn({ tableId: '', key: '', required: false, - default: 'https://example.com', // optional + xdefault: 'https://example.com', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 4f1b5de4..9cfc6fa6 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -14,7 +14,7 @@ const result = await tablesDB.createVarcharColumn({ key: '', size: 1, required: false, - default: '', // optional + xdefault: '', // optional array: false, // optional encrypt: false // optional }); diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 87c20e4b..4defcb4c 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateBigIntColumn({ tableId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 6b61889b..6ad62691 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateBooleanColumn({ tableId: '', key: '', required: false, - default: false, + xdefault: false, newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 24628932..ff93b140 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateDatetimeColumn({ tableId: '', key: '', required: false, - default: '2020-10-15T06:38:00.000+00:00', + xdefault: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 9d380636..fc6c764b 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateEmailColumn({ tableId: '', key: '', required: false, - default: 'email@example.com', + xdefault: 'email@example.com', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index b35e3c8a..b97a4c58 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -14,7 +14,7 @@ const result = await tablesDB.updateEnumColumn({ key: '', elements: [], required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 0fca144e..d332d81f 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateFloatColumn({ tableId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 54f874f8..4a49705d 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateIntegerColumn({ tableId: '', key: '', required: false, - default: null, + xdefault: null, min: null, // optional max: null, // optional newKey: '' // optional diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 56b1962a..00dfce17 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateIpColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 98bc6ad5..0a6bd255 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateLineColumn({ tableId: '', key: '', required: false, - default: [[1, 2], [3, 4], [5, 6]], // optional + xdefault: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 90bf4679..cdb20747 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateLongtextColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 8dc2cdd5..7c84b920 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateMediumtextColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 05cbc3df..c2e10506 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updatePointColumn({ tableId: '', key: '', required: false, - default: [1, 2], // optional + xdefault: [1, 2], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 80f97f1b..0a38cd0a 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updatePolygonColumn({ tableId: '', key: '', required: false, - default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index 590dc84f..757aa6cf 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateStringColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', size: 1, // optional newKey: '' // optional }); diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 1a6a1513..69970d63 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateTextColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index e5797619..08392f5d 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateUrlColumn({ tableId: '', key: '', required: false, - default: 'https://example.com', + xdefault: 'https://example.com', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 1e118dcd..58f94220 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateVarcharColumn({ tableId: '', key: '', required: false, - default: '', + xdefault: '', size: 1, // optional newKey: '' // optional });