diff --git a/demos/client-bundle-example/package.json b/demos/client-bundle-example/package.json index 833e879d20..a211ed348a 100644 --- a/demos/client-bundle-example/package.json +++ b/demos/client-bundle-example/package.json @@ -13,9 +13,9 @@ "start": "vite serve ./src --port 9232 --config vite.config.ts", "clean": "echo 'nothing to clean'" }, - "version": "2.2.0", + "version": "2.2.1", "devDependencies": { - "@prosopo/dotenv": "2.2.0", + "@prosopo/dotenv": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/demos/client-example-server/package.json b/demos/client-example-server/package.json index 82884e01d0..b4100d98d3 100644 --- a/demos/client-example-server/package.json +++ b/demos/client-example-server/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/client-example-server", - "version": "2.2.0", + "version": "2.2.1", "description": "Backend for client-example", "main": "dist/app.js", "type": "module", @@ -32,12 +32,12 @@ "@noble/hashes": "1.5.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/server": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/server": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "@typegoose/auto-increment": "4.6.0", "cors": "2.8.5", "express": "4.21.1", @@ -47,7 +47,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/jsonwebtoken": "9.0.6", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/demos/client-example/package.json b/demos/client-example/package.json index c8c6c2a93f..771754d81a 100644 --- a/demos/client-example/package.json +++ b/demos/client-example/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/client-example", - "version": "2.2.0", + "version": "2.2.1", "private": true, "type": "module", "engines": { @@ -13,14 +13,14 @@ "@mui/material": "5.9.1", "@polkadot/extension-dapp": "0.46.9", "@polkadot/extension-inject": "0.46.9", - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha-frictionless": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/server": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/vite-plugin-watch-workspace": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha-frictionless": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/server": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/vite-plugin-watch-workspace": "2.2.1", "@types/react-dom": "18.3.0", "@vitejs/plugin-react": "4.3.1", "express": "4.21.1", @@ -41,8 +41,8 @@ } }, "devDependencies": { - "@prosopo/config": "2.2.0", - "@prosopo/dotenv": "2.2.0", + "@prosopo/config": "2.2.1", + "@prosopo/dotenv": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/demos/cypress-shared/package.json b/demos/cypress-shared/package.json index 0434bd2a99..00925b7b5c 100644 --- a/demos/cypress-shared/package.json +++ b/demos/cypress-shared/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/cypress-shared", - "version": "2.2.0", + "version": "2.2.1", "private": true, "type": "module", "engines": { @@ -8,15 +8,15 @@ "npm": ">=9" }, "dependencies": { - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { "@cypress/xpath": "2.0.3", - "@prosopo/common": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/types-database": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/demos/provider-mock/package.json b/demos/provider-mock/package.json index 7006f812b2..19d3f3476b 100644 --- a/demos/provider-mock/package.json +++ b/demos/provider-mock/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/provider-mock", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -16,9 +16,9 @@ "build:cjs": "echo 'no cjs build'" }, "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", "cors": "2.8.5", "express": "4.21.1" }, diff --git a/dev/config/package.json b/dev/config/package.json index 1225cbc7b5..1cbcda11d2 100644 --- a/dev/config/package.json +++ b/dev/config/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/config", - "version": "2.2.0", + "version": "2.2.1", "description": "Prosopo config library", "main": "./dist/index.js", "type": "module", @@ -36,9 +36,9 @@ "@babel/plugin-transform-react-jsx": "7.25.2", "@babel/plugin-transform-runtime": "7.25.4", "@babel/preset-env": "7.25.4", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-babel": "6.0.4", "@rollup/plugin-commonjs": "26.0.1", diff --git a/dev/flux/package.json b/dev/flux/package.json index dfeb3789f7..57b0c67d16 100644 --- a/dev/flux/package.json +++ b/dev/flux/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/flux", - "version": "2.2.0", + "version": "2.2.1", "description": "Tools for managing Flux deployment", "main": "dist/index.js", "bin": { @@ -24,10 +24,10 @@ "@noble/curves": "1.6.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "openpgp": "5.11.2", "qs": "6.13.0", diff --git a/dev/gh-actions/package.json b/dev/gh-actions/package.json index bf4bb0c37a..19d01e457e 100644 --- a/dev/gh-actions/package.json +++ b/dev/gh-actions/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/gh-actions", - "version": "2.2.0", + "version": "2.2.1", "description": "", "private": true, "scripts": { diff --git a/dev/lint/package.json b/dev/lint/package.json index 750860ad9b..2b851ed9d7 100644 --- a/dev/lint/package.json +++ b/dev/lint/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/lint", - "version": "2.2.0", + "version": "2.2.1", "description": "", "private": true, "scripts": { @@ -37,7 +37,7 @@ "npm": ">=9" }, "dependencies": { - "@prosopo/util": "2.2.0", + "@prosopo/util": "2.2.1", "express": "4.21.1", "fast-glob": "3.3.2", "zod": "3.23.8" diff --git a/dev/prosoponator-bot/package.json b/dev/prosoponator-bot/package.json index 8bb3b4d072..90674d3fe2 100644 --- a/dev/prosoponator-bot/package.json +++ b/dev/prosoponator-bot/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/prosoponator-bot", - "version": "2.2.0", + "version": "2.2.1", "description": "", "private": true, "scripts": { diff --git a/dev/scripts/env.development b/dev/scripts/env.development index 0e25e302dd..8053678c5f 100644 --- a/dev/scripts/env.development +++ b/dev/scripts/env.development @@ -18,7 +18,7 @@ PROSOPO_DEFAULT_ENVIRONMENT=development PROSOPO_LOG_LEVEL=debug PROSOPO_MONGO_CAPTCHA_URI= PROSOPO_MONGO_EVENTS_URI=mongodb+srv:///frictionless_events -PROSOPO_PACKAGE_VERSION=2.2.0 +PROSOPO_PACKAGE_VERSION=2.2.1 PROSOPO_PROVIDER_ACCOUNT_PASSWORD= PROSOPO_PROVIDER_ADDRESS=5EjTA28bKSbFPPyMbUjNtArxyqjwq38r1BapVmLZShaqEedV PROSOPO_PROVIDER_JSON= diff --git a/dev/scripts/env.production b/dev/scripts/env.production index 695debc5a4..0e945ce5e7 100644 --- a/dev/scripts/env.production +++ b/dev/scripts/env.production @@ -16,7 +16,7 @@ PROSOPO_DEFAULT_ENVIRONMENT=production PROSOPO_LOG_LEVEL=info PROSOPO_MONGO_CAPTCHA_URI= PROSOPO_MONGO_EVENTS_URI=mongodb+srv:///frictionless_events -PROSOPO_PACKAGE_VERSION=2.2.0 +PROSOPO_PACKAGE_VERSION=2.2.1 PROSOPO_PROVIDER_ACCOUNT_PASSWORD= PROSOPO_PROVIDER_ADDRESS= PROSOPO_PROVIDER_JSON= diff --git a/dev/scripts/env.staging b/dev/scripts/env.staging index 7874bdfcf9..b5c37a4fe2 100644 --- a/dev/scripts/env.staging +++ b/dev/scripts/env.staging @@ -21,7 +21,7 @@ PROSOPO_DEFAULT_ENVIRONMENT=staging PROSOPO_LOG_LEVEL=info PROSOPO_MONGO_CAPTCHA_URI= PROSOPO_MONGO_EVENTS_URI=mongodb+srv:///frictionless_events -PROSOPO_PACKAGE_VERSION=2.2.0 +PROSOPO_PACKAGE_VERSION=2.2.1 PROSOPO_PROVIDER_ACCOUNT_PASSWORD= PROSOPO_PROVIDER_ADDRESS= PROSOPO_PROVIDER_JSON= diff --git a/dev/scripts/env.test b/dev/scripts/env.test index f035c75668..426c51e656 100644 --- a/dev/scripts/env.test +++ b/dev/scripts/env.test @@ -21,7 +21,7 @@ PROSOPO_DEFAULT_ENVIRONMENT=development PROSOPO_LOG_LEVEL=info PROSOPO_MONGO_CAPTCHA_URI=mongodb://root:root@localhost:27017/captchastorage?authSource=admin PROSOPO_MONGO_EVENTS_URI=mongodb+srv:///frictionless_events -PROSOPO_PACKAGE_VERSION=2.2.0 +PROSOPO_PACKAGE_VERSION=2.2.1 PROSOPO_PROVIDER_ACCOUNT_PASSWORD= PROSOPO_PROVIDER_ADDRESS=5EjTA28bKSbFPPyMbUjNtArxyqjwq38r1BapVmLZShaqEedV PROSOPO_PROVIDER_JSON= diff --git a/dev/scripts/package.json b/dev/scripts/package.json index 662362b67f..3aa98b3a4b 100644 --- a/dev/scripts/package.json +++ b/dev/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/scripts", - "version": "2.2.0", + "version": "2.2.1", "description": "Dev scripts for working with prosopo packages", "main": "dist/index.js", "type": "module", @@ -26,18 +26,18 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/cli": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/cli": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "fast-glob": "3.3.2", diff --git a/dev/ts-brand/package.json b/dev/ts-brand/package.json index 4585773881..96016fff3a 100644 --- a/dev/ts-brand/package.json +++ b/dev/ts-brand/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/ts-brand", - "version": "2.2.0", + "version": "2.2.1", "description": "Brand your TypeScript types", "main": "./dist/index.js", "type": "module", @@ -24,7 +24,7 @@ "author": "Prosopo Limited", "license": "Apache-2.0", "dependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1" }, diff --git a/dev/vite-plugin-watch-workspace/package.json b/dev/vite-plugin-watch-workspace/package.json index 3f05492b2e..a0cc162109 100644 --- a/dev/vite-plugin-watch-workspace/package.json +++ b/dev/vite-plugin-watch-workspace/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/vite-plugin-watch-workspace", - "version": "2.2.0", + "version": "2.2.1", "description": "Vite plugin for watching and rebuilding external files", "main": "./dist/index.js", "type": "module", @@ -23,7 +23,7 @@ "author": "Prosopo Limited", "license": "Apache-2.0", "dependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "debug": "4.3.7", "esbuild": "0.23.1", "express": "4.21.1", diff --git a/docker/images/provider/package.json b/docker/images/provider/package.json index 50b004281b..9677562692 100644 --- a/docker/images/provider/package.json +++ b/docker/images/provider/package.json @@ -5,5 +5,5 @@ "node": "20", "npm": ">=9" }, - "version": "2.2.0" + "version": "2.2.1" } diff --git a/package-lock.json b/package-lock.json index 2a078d5887..31ad07a465 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@prosopo/captcha", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@prosopo/captcha", - "version": "2.2.0", + "version": "2.2.1", "hasInstallScript": true, "license": "Apache-2.0", "workspaces": [ @@ -43,12 +43,12 @@ }, "demos/client-bundle-example": { "name": "@prosopo/client-bundle-example", - "version": "2.2.0", + "version": "2.2.1", "dependencies": { "express": "4.21.1" }, "devDependencies": { - "@prosopo/dotenv": "2.2.0", + "@prosopo/dotenv": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -67,21 +67,21 @@ }, "demos/client-example": { "name": "@prosopo/client-example", - "version": "2.2.0", + "version": "2.2.1", "dependencies": { "@emotion/react": "11.13.3", "@emotion/styled": "11.13.0", "@mui/material": "5.9.1", "@polkadot/extension-dapp": "0.46.9", "@polkadot/extension-inject": "0.46.9", - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha-frictionless": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/server": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/vite-plugin-watch-workspace": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha-frictionless": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/server": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/vite-plugin-watch-workspace": "2.2.1", "@types/react-dom": "18.3.0", "@vitejs/plugin-react": "4.3.1", "express": "4.21.1", @@ -90,8 +90,8 @@ "react-router-dom": "6.26.2" }, "devDependencies": { - "@prosopo/config": "2.2.0", - "@prosopo/dotenv": "2.2.0", + "@prosopo/config": "2.2.1", + "@prosopo/dotenv": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -110,18 +110,18 @@ }, "demos/client-example-server": { "name": "@prosopo/client-example-server", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "1.5.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/server": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/server": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "@typegoose/auto-increment": "4.6.0", "cors": "2.8.5", "express": "4.21.1", @@ -131,7 +131,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/jsonwebtoken": "9.0.6", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -150,17 +150,17 @@ }, "demos/cypress-shared": { "name": "@prosopo/cypress-shared", - "version": "2.2.0", + "version": "2.2.1", "dependencies": { - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { "@cypress/xpath": "2.0.3", - "@prosopo/common": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/types-database": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -182,12 +182,12 @@ }, "demos/provider-mock": { "name": "@prosopo/provider-mock", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", "cors": "2.8.5", "express": "4.21.1" }, @@ -209,7 +209,7 @@ }, "dev/config": { "name": "@prosopo/config", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@babel/core": "7.25.2", @@ -217,9 +217,9 @@ "@babel/plugin-transform-react-jsx": "7.25.2", "@babel/plugin-transform-runtime": "7.25.4", "@babel/preset-env": "7.25.4", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-babel": "6.0.4", "@rollup/plugin-commonjs": "26.0.1", @@ -276,16 +276,16 @@ }, "dev/flux": { "name": "@prosopo/flux", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@noble/curves": "1.6.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "openpgp": "5.11.2", "qs": "6.13.0", @@ -330,7 +330,7 @@ }, "dev/gh-actions": { "name": "@prosopo/gh-actions", - "version": "2.2.0", + "version": "2.2.1", "license": "ISC", "dependencies": { "@octokit/graphql": "8.1.1", @@ -355,10 +355,10 @@ }, "dev/lint": { "name": "@prosopo/lint", - "version": "2.2.0", + "version": "2.2.1", "license": "ISC", "dependencies": { - "@prosopo/util": "2.2.0", + "@prosopo/util": "2.2.1", "express": "4.21.1", "fast-glob": "3.3.2", "zod": "3.23.8" @@ -382,7 +382,7 @@ }, "dev/prosoponator-bot": { "name": "@prosopo/prosoponator-bot", - "version": "2.2.0", + "version": "2.2.1", "license": "ISC", "dependencies": { "@actions/core": "1.10.1", @@ -407,7 +407,7 @@ }, "dev/scripts": { "name": "@prosopo/scripts", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@iarna/toml": "2.2.5", @@ -416,18 +416,18 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/cli": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/cli": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "fast-glob": "3.3.2", @@ -482,10 +482,10 @@ }, "dev/ts-brand": { "name": "@prosopo/ts-brand", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1" }, @@ -507,10 +507,10 @@ }, "dev/vite-plugin-watch-workspace": { "name": "@prosopo/vite-plugin-watch-workspace", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "debug": "4.3.7", "esbuild": "0.23.1", "express": "4.21.1", @@ -21321,7 +21321,7 @@ }, "packages/account": { "name": "@prosopo/account", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/extension-base": "0.46.9", @@ -21330,15 +21330,15 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/fingerprint": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/fingerprint": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21356,14 +21356,14 @@ }, "packages/api": { "name": "@prosopo/api", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/types": "2.2.0", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21381,22 +21381,22 @@ }, "packages/cli": { "name": "@prosopo/cli", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/keyring": "12.6.2", "@polkadot/types-codec": "10.13.1", "@polkadot/util-crypto": "12.6.2", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/locale": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/locale": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "cors": "2.8.5", "cron-parser": "4.9.0", "dotenv": "16.4.5", @@ -21405,7 +21405,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/cors": "2.8.17", "@types/yargs": "17.0.33", "@vitest/coverage-v8": "2.1.1", @@ -21426,17 +21426,17 @@ }, "packages/common": { "name": "@prosopo/common", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/util-crypto": "12.6.2", - "@prosopo/locale": "2.2.0", + "@prosopo/locale": "2.2.1", "consola": "3.2.3", "express": "4.21.1", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21455,7 +21455,7 @@ }, "packages/contract": { "name": "@prosopo/contract", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "10.13.1", @@ -21465,16 +21465,16 @@ "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/tx": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/tx": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "rxjs": "7.8.1" }, "devDependencies": { "@polkadot/api-augment": "10.13.1", - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21520,13 +21520,13 @@ }, "packages/database": { "name": "@prosopo/database", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", "express": "4.21.1", "mongodb": "6.9.0", "mongodb-memory-server": "10.0.0", @@ -21550,17 +21550,17 @@ }, "packages/datasets": { "name": "@prosopo/datasets", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21579,15 +21579,15 @@ }, "packages/datasets-fs": { "name": "@prosopo/datasets-fs", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "1.5.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "bcrypt": "5.1.1", "cli-progress": "3.12.0", "express": "4.21.1", @@ -21596,7 +21596,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/bcrypt": "5.0.2", "@types/cli-progress": "3.11.6", "@vitest/coverage-v8": "2.1.1", @@ -21617,7 +21617,7 @@ }, "packages/detector": { "name": "@prosopo/detector", - "version": "2.2.0", + "version": "2.2.1", "dependencies": { "express": "4.21.1" }, @@ -21639,11 +21639,11 @@ }, "packages/dotenv": { "name": "@prosopo/dotenv", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1" }, @@ -21665,22 +21665,22 @@ }, "packages/env": { "name": "@prosopo/env", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/database": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/database": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21698,17 +21698,17 @@ }, "packages/file-server": { "name": "@prosopo/file-server", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/util": "2.2.0", + "@prosopo/util": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "node-fetch": "3.3.2", "sharp": "0.33.5" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/express": "4.17.21", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", @@ -21746,7 +21746,7 @@ }, "packages/fingerprint": { "name": "@prosopo/fingerprint", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@fingerprintjs/fingerprintjs": "3.4.2", @@ -21770,12 +21770,12 @@ }, "packages/load-balancer": { "name": "@prosopo/load-balancer", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { @@ -21796,7 +21796,7 @@ }, "packages/locale": { "name": "@prosopo/locale", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "express": "4.21.1", @@ -21806,7 +21806,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "del-cli": "6.0.0", "dotenv": "16.4.5", @@ -21824,17 +21824,17 @@ }, "packages/locale-browser": { "name": "@prosopo/locale-browser", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/locale": "2.2.0", + "@prosopo/locale": "2.2.1", "express": "4.21.1", "i18next-browser-languagedetector": "7.2.1", "react-i18next": "11.18.6", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "del-cli": "6.0.0", "dotenv": "16.4.5", @@ -21852,26 +21852,26 @@ }, "packages/procaptcha": { "name": "@prosopo/procaptcha", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "10.13.1", "@polkadot/api-contract": "10.13.1", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/account": "2.2.0", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/load-balancer": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/account": "2.2.1", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/load-balancer": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "jsdom": "25.0.0" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21890,22 +21890,22 @@ }, "packages/procaptcha-bundle": { "name": "@prosopo/procaptcha-bundle", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/dotenv": "2.2.0", - "@prosopo/locale": "2.2.0", - "@prosopo/procaptcha-frictionless": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/dotenv": "2.2.1", + "@prosopo/locale": "2.2.1", + "@prosopo/procaptcha-frictionless": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "react": "18.3.1", "react-dom": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/jsdom": "21.1.7", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -21924,17 +21924,17 @@ }, "packages/procaptcha-common": { "name": "@prosopo/procaptcha-common", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/load-balancer": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/load-balancer": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21952,20 +21952,20 @@ }, "packages/procaptcha-frictionless": { "name": "@prosopo/procaptcha-frictionless", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/detector": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/detector": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/web-components": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -21983,24 +21983,24 @@ }, "packages/procaptcha-pow": { "name": "@prosopo/procaptcha-pow", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/util": "12.6.2", - "@prosopo/account": "2.2.0", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/account": "2.2.1", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", + "@prosopo/web-components": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22018,22 +22018,22 @@ }, "packages/procaptcha-react": { "name": "@prosopo/procaptcha-react", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", + "@prosopo/web-components": "2.2.1", "csstype": "3.1.3", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22079,23 +22079,23 @@ }, "packages/provider": { "name": "@prosopo/provider", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "1.5.0", "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/database": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/database": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "cron": "3.1.7", "express": "4.21.1", "ip-address": "10.0.1", @@ -22142,19 +22142,19 @@ }, "packages/server": { "name": "@prosopo/server", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22172,7 +22172,7 @@ }, "packages/tx": { "name": "@prosopo/tx", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "10.13.1", @@ -22182,12 +22182,12 @@ "@polkadot/types": "10.13.1", "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22233,7 +22233,7 @@ }, "packages/types": { "name": "@prosopo/types", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "10.13.1", @@ -22243,15 +22243,15 @@ "@polkadot/types": "10.13.1", "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/locale": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale": "2.2.1", "express": "4.21.1", "ip-address": "10.0.1", "scale-ts": "1.6.0", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", @@ -22270,18 +22270,18 @@ }, "packages/types-database": { "name": "@prosopo/types-database", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1", "mongodb": "6.9.0", "mongoose": "8.6.2", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22299,17 +22299,17 @@ }, "packages/types-env": { "name": "@prosopo/types-env", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@polkadot/keyring": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", @@ -22355,11 +22355,11 @@ }, "packages/util": { "name": "@prosopo/util", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "1.5.0", - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "lodash": "4.17.21", @@ -22385,7 +22385,7 @@ }, "packages/web-components": { "name": "@prosopo/web-components", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "dependencies": { "@emotion/react": "11.13.3", @@ -22394,7 +22394,7 @@ "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/package.json b/package.json index a61ef89040..eada37464a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/captcha", - "version": "2.2.0", + "version": "2.2.1", "author": "Prosopo", "type": "module", "repository": { diff --git a/packages/account/package.json b/packages/account/package.json index 97292cbd0e..cbd7772d39 100644 --- a/packages/account/package.json +++ b/packages/account/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/account", - "version": "2.2.0", + "version": "2.2.1", "description": "Services and Utils for Prosopo account gen and management", "main": "dist/index.js", "type": "module", @@ -37,15 +37,15 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/fingerprint": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/fingerprint": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/api/package.json b/packages/api/package.json index 204dc4b1f9..8aeba232bd 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/api", - "version": "2.2.0", + "version": "2.2.1", "description": "Wrapper for the provider API", "main": "dist/index.js", "type": "module", @@ -31,11 +31,11 @@ }, "homepage": "https://github.com/prosopo/captcha#readme", "dependencies": { - "@prosopo/types": "2.2.0", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index 2ab79f5af5..25373410a9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/cli", - "version": "2.2.0", + "version": "2.2.1", "description": "CLI for Prosopo Provider", "main": "dist/index.js", "type": "module", @@ -29,16 +29,16 @@ "@polkadot/keyring": "12.6.2", "@polkadot/types-codec": "10.13.1", "@polkadot/util-crypto": "12.6.2", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/dotenv": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/locale": "2.2.0", - "@prosopo/provider": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/dotenv": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/locale": "2.2.1", + "@prosopo/provider": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "cors": "2.8.5", "cron-parser": "4.9.0", "dotenv": "16.4.5", @@ -47,7 +47,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/cors": "2.8.17", "@types/yargs": "17.0.33", "@vitest/coverage-v8": "2.1.1", diff --git a/packages/cli/src/commands/addBlockRules.ts b/packages/cli/src/commands/addBlockRules.ts index 88d1ad78a3..560eda9a3b 100644 --- a/packages/cli/src/commands/addBlockRules.ts +++ b/packages/cli/src/commands/addBlockRules.ts @@ -16,7 +16,7 @@ import type { KeyringPair } from "@polkadot/keyring/types"; import { LogLevel, type Logger, getLogger } from "@prosopo/common"; import { ProviderEnvironment } from "@prosopo/env"; import { Tasks } from "@prosopo/provider"; -import type { ProsopoConfigOutput } from "@prosopo/types"; +import type { CaptchaConfig, ProsopoConfigOutput } from "@prosopo/types"; import type { ArgumentsCamelCase, Argv } from "yargs"; import * as z from "zod"; import { loadJSONFile } from "../files.js"; @@ -61,18 +61,42 @@ export default ( demandOption: true, default: false, desc: "Hardblock stops requests, softblock informs frictionless", + } as const) + .option("solved", { + type: "number" as const, + demandOption: false, + desc: "The number of solved captchas", + } as const) + .option("unsolved", { + type: "number" as const, + demandOption: false, + desc: "The number of unsolved captchas", } as const), + handler: async (argv: ArgumentsCamelCase) => { try { const env = new ProviderEnvironment(config, pair); await env.isReady(); const tasks = new Tasks(env); + let captchaConfig: CaptchaConfig | undefined; + if (argv.solved && argv.unsolved) { + captchaConfig = { + solved: { + count: argv.solved as unknown as number, + }, + unsolved: { + count: argv.unsolved as unknown as number, + }, + }; + } + if (argv.ips) { await tasks.clientTaskManager.addIPBlockRules( argv.ips as unknown as string[], argv.global as boolean, argv.hardBlock as boolean, argv.dapp as unknown as string, + captchaConfig, ); } if (argv.users) { @@ -81,6 +105,7 @@ export default ( argv.hardBlock as boolean, argv.global as boolean, argv.dapp as unknown as string, + captchaConfig, ); } logger.info("IP Block rules added"); diff --git a/packages/common/package.json b/packages/common/package.json index a0712f923e..a6035f539c 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/common", - "version": "2.2.0", + "version": "2.2.1", "description": "Prosopo common library", "main": "./dist/index.js", "type": "module", @@ -25,13 +25,13 @@ "license": "Apache-2.0", "dependencies": { "@polkadot/util-crypto": "12.6.2", - "@prosopo/locale": "2.2.0", + "@prosopo/locale": "2.2.1", "consola": "3.2.3", "express": "4.21.1", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/contract/package.json b/packages/contract/package.json index ed7209ab84..9f016539da 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/contract", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "scripts": { @@ -43,16 +43,16 @@ "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/tx": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/tx": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "rxjs": "7.8.1" }, "devDependencies": { "@polkadot/api-augment": "10.13.1", - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/database/package.json b/packages/database/package.json index b2e6efab80..a47bcda84f 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/database", - "version": "2.2.0", + "version": "2.2.1", "description": "Prosopo database plugins for provider", "main": "dist/index.js", "type": "module", @@ -31,10 +31,10 @@ }, "homepage": "https://github.com/prosopo/captcha#readme", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", "express": "4.21.1", "mongodb": "6.9.0", "mongodb-memory-server": "10.0.0", diff --git a/packages/database/src/databases/provider.ts b/packages/database/src/databases/provider.ts index 60c6246778..1fc4bb4965 100644 --- a/packages/database/src/databases/provider.ts +++ b/packages/database/src/databases/provider.ts @@ -736,8 +736,10 @@ export class ProviderDatabase const docs = await this.tables?.commitment .find({ $or: [ - { storedStatus: { $ne: StoredStatusNames.stored } }, - { storedStatus: { $exists: false } }, + { $storedAtTimestamp: { $exists: false } }, + { + $expr: { $lt: ["$storedAtTimestamp", "$lastUpdatedTimestamp"] }, + }, ], }) .sort({ _id: 1 }) // Consistent ordering is important for pagination @@ -791,8 +793,10 @@ export class ProviderDatabase const docs = await this.tables?.powcaptcha .find({ $or: [ - { storedStatus: { $ne: StoredStatusNames.stored } }, - { storedStatus: { $exists: false } }, + { $storedAtTimestamp: { $exists: false } }, + { + $expr: { $lt: ["$storedAtTimestamp", "$lastUpdatedTimestamp"] }, + }, ], }) .sort({ _id: 1 }) // Consistent ordering is important for pagination diff --git a/packages/datasets-fs/package.json b/packages/datasets-fs/package.json index 0637400f63..ab624647de 100644 --- a/packages/datasets-fs/package.json +++ b/packages/datasets-fs/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/datasets-fs", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "private": false, @@ -28,9 +28,9 @@ "@noble/hashes": "1.5.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "bcrypt": "5.1.1", "cli-progress": "3.12.0", "express": "4.21.1", @@ -39,7 +39,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/bcrypt": "5.0.2", "@types/cli-progress": "3.11.6", "@vitest/coverage-v8": "2.1.1", diff --git a/packages/datasets/package.json b/packages/datasets/package.json index af199b3c85..f414ffe156 100644 --- a/packages/datasets/package.json +++ b/packages/datasets/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/datasets", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "private": false, @@ -38,13 +38,13 @@ }, "dependencies": { "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/detector/package.json b/packages/detector/package.json index 0dc21d8f2d..0865f2b509 100644 --- a/packages/detector/package.json +++ b/packages/detector/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/detector", - "version": "2.2.0", + "version": "2.2.1", "main": "src/index.js", "engines": { "node": "20", diff --git a/packages/dotenv/package.json b/packages/dotenv/package.json index 9d42590ab5..7e919af28d 100644 --- a/packages/dotenv/package.json +++ b/packages/dotenv/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/dotenv", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "private": false, @@ -25,8 +25,8 @@ }, "types": "./dist/index.d.ts", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1" }, diff --git a/packages/env/package.json b/packages/env/package.json index c7119d1064..8be7f9fbea 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/env", - "version": "2.2.0", + "version": "2.2.1", "description": "Path env prosopo environment", "main": "dist/index.js", "type": "module", @@ -24,19 +24,19 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/database": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/database": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "overrides": { "@polkadot/keyring": "12.6.2" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/file-server/package.json b/packages/file-server/package.json index b89f60916b..57e4a04d90 100644 --- a/packages/file-server/package.json +++ b/packages/file-server/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/file-server", - "version": "2.2.0", + "version": "2.2.1", "description": "Simple static file server", "main": "dist/index.js", "type": "module", @@ -22,14 +22,14 @@ "start": "node ./dist/index.js" }, "dependencies": { - "@prosopo/util": "2.2.0", + "@prosopo/util": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "node-fetch": "3.3.2", "sharp": "0.33.5" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/express": "4.17.21", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", diff --git a/packages/fingerprint/package.json b/packages/fingerprint/package.json index acb5e0b818..e5d2e47871 100644 --- a/packages/fingerprint/package.json +++ b/packages/fingerprint/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/fingerprint", - "version": "2.2.0", + "version": "2.2.1", "description": "Provider fingerprint", "main": "dist/index.js", "type": "module", diff --git a/packages/load-balancer/package.json b/packages/load-balancer/package.json index a45e0e7c57..f09c11b53e 100644 --- a/packages/load-balancer/package.json +++ b/packages/load-balancer/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/load-balancer", - "version": "2.2.0", + "version": "2.2.1", "description": "Provider load balancer", "main": "dist/index.js", "type": "module", @@ -31,9 +31,9 @@ }, "homepage": "https://github.com/prosopo/captcha#readme", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { diff --git a/packages/locale-browser/package.json b/packages/locale-browser/package.json index 86aa468f2b..6414b3cbac 100644 --- a/packages/locale-browser/package.json +++ b/packages/locale-browser/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/locale-browser", - "version": "2.2.0", + "version": "2.2.1", "description": "Prosopo browser locale", "main": "./dist/index.js", "type": "module", @@ -24,14 +24,14 @@ "author": "Prosopo Limited", "license": "Apache-2.0", "dependencies": { - "@prosopo/locale": "2.2.0", + "@prosopo/locale": "2.2.1", "express": "4.21.1", "i18next-browser-languagedetector": "7.2.1", "react-i18next": "11.18.6", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "del-cli": "6.0.0", "dotenv": "16.4.5", diff --git a/packages/locale/package.json b/packages/locale/package.json index c882f26a40..15876189a6 100644 --- a/packages/locale/package.json +++ b/packages/locale/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/locale", - "version": "2.2.0", + "version": "2.2.1", "description": "Prosopo locale library", "main": "./dist/index.js", "type": "module", @@ -31,7 +31,7 @@ "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "del-cli": "6.0.0", "dotenv": "16.4.5", diff --git a/packages/procaptcha-bundle/package.json b/packages/procaptcha-bundle/package.json index 52d61fc710..8ad4130da2 100644 --- a/packages/procaptcha-bundle/package.json +++ b/packages/procaptcha-bundle/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha-bundle", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -29,13 +29,13 @@ }, "browserslist": ["> 0.5%, last 2 versions, not dead"], "dependencies": { - "@prosopo/dotenv": "2.2.0", - "@prosopo/locale": "2.2.0", - "@prosopo/procaptcha-frictionless": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/dotenv": "2.2.1", + "@prosopo/locale": "2.2.1", + "@prosopo/procaptcha-frictionless": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "react": "18.3.1", "react-dom": "18.3.1" @@ -53,7 +53,7 @@ "registry": "https://registry.npmjs.org" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/jsdom": "21.1.7", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/packages/procaptcha-common/package.json b/packages/procaptcha-common/package.json index 601829c648..c9f71e217c 100644 --- a/packages/procaptcha-common/package.json +++ b/packages/procaptcha-common/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha-common", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -26,14 +26,14 @@ }, "browserslist": ["> 0.5%, last 2 versions, not dead"], "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/load-balancer": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/load-balancer": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/procaptcha-frictionless/package.json b/packages/procaptcha-frictionless/package.json index 6b7297d147..5c9f33add9 100644 --- a/packages/procaptcha-frictionless/package.json +++ b/packages/procaptcha-frictionless/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha-frictionless", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -26,17 +26,17 @@ }, "browserslist": ["> 0.5%, last 2 versions, not dead"], "dependencies": { - "@prosopo/detector": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha-pow": "2.2.0", - "@prosopo/procaptcha-react": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/detector": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha-pow": "2.2.1", + "@prosopo/procaptcha-react": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/web-components": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/procaptcha-pow/package.json b/packages/procaptcha-pow/package.json index fc27ddfebb..8f6981aa68 100644 --- a/packages/procaptcha-pow/package.json +++ b/packages/procaptcha-pow/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha-pow", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -27,15 +27,15 @@ "browserslist": ["> 0.5%, last 2 versions, not dead"], "dependencies": { "@polkadot/util": "12.6.2", - "@prosopo/account": "2.2.0", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/account": "2.2.1", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", + "@prosopo/web-components": "2.2.1", "express": "4.21.1", "react": "18.3.1" }, @@ -47,7 +47,7 @@ } }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/procaptcha-react/package.json b/packages/procaptcha-react/package.json index 94bf273384..14cd8e698e 100644 --- a/packages/procaptcha-react/package.json +++ b/packages/procaptcha-react/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha-react", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -26,13 +26,13 @@ }, "browserslist": ["> 0.5%, last 2 versions, not dead"], "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/locale-browser": "2.2.0", - "@prosopo/procaptcha": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", - "@prosopo/web-components": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale-browser": "2.2.1", + "@prosopo/procaptcha": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", + "@prosopo/web-components": "2.2.1", "csstype": "3.1.3", "express": "4.21.1", "react": "18.3.1" @@ -50,7 +50,7 @@ } }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/procaptcha/package.json b/packages/procaptcha/package.json index afdda64da7..4cf9871674 100644 --- a/packages/procaptcha/package.json +++ b/packages/procaptcha/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/procaptcha", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -33,14 +33,14 @@ "@polkadot/api-contract": "10.13.1", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/account": "2.2.0", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/load-balancer": "2.2.0", - "@prosopo/procaptcha-common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/account": "2.2.1", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/load-balancer": "2.2.1", + "@prosopo/procaptcha-common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/util": "2.2.1", "express": "4.21.1", "jsdom": "25.0.0" }, @@ -57,7 +57,7 @@ } }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/provider/package.json b/packages/provider/package.json index 94bb17bee4..e10f95c202 100644 --- a/packages/provider/package.json +++ b/packages/provider/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/provider", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "main": "./dist/index.js", @@ -27,16 +27,16 @@ "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/config": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/database": "2.2.0", - "@prosopo/datasets": "2.2.0", - "@prosopo/env": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", - "@prosopo/types-env": "2.2.0", - "@prosopo/util": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/config": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/database": "2.2.1", + "@prosopo/datasets": "2.2.1", + "@prosopo/env": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", + "@prosopo/types-env": "2.2.1", + "@prosopo/util": "2.2.1", "cron": "3.1.7", "express": "4.21.1", "ip-address": "10.0.1", diff --git a/packages/provider/src/api/block.ts b/packages/provider/src/api/block.ts index b586e6b252..118330a128 100644 --- a/packages/provider/src/api/block.ts +++ b/packages/provider/src/api/block.ts @@ -11,16 +11,17 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type { KeyringPair } from "@polkadot/keyring/types"; -import { hexToU8a, isHex } from "@polkadot/util"; -import { validateAddress } from "@polkadot/util-crypto/address"; -import { ProsopoApiError, ProsopoEnvError } from "@prosopo/common"; + +import { getLoggerDefault } from "@prosopo/common"; import { ApiPrefix } from "@prosopo/types"; import type { ProviderEnvironment } from "@prosopo/types-env"; import type { NextFunction, Request, Response } from "express"; -import { Address6 } from "ip-address"; +import { checkIpRules } from "../rules/ip.js"; +import { checkUserRules } from "../rules/user.js"; import { getIPAddress } from "../util.js"; +const logger = getLoggerDefault(); + export const blockMiddleware = (env: ProviderEnvironment) => { return async (req: Request, res: Response, next: NextFunction) => { try { @@ -32,7 +33,7 @@ export const blockMiddleware = (env: ProviderEnvironment) => { // if no IP block if (!req.ip) { - console.log("No IP", req.ip); + logger.info("No IP", req.ip); return res.status(401).json({ error: "Unauthorized" }); } @@ -41,47 +42,32 @@ export const blockMiddleware = (env: ProviderEnvironment) => { const ipAddress = getIPAddress(req.ip || ""); const userAccount = req.headers["Prosopo-User"] || req.body.user; const dappAccount = req.headers["Prosopo-Site-Key"] || req.body.dapp; - const rule = await env.getDb().getIPBlockRuleRecord(ipAddress.bigInt()); - if (rule && BigInt(rule.ip) === ipAddress.bigInt()) { - // block by IP address globally - if (rule.global && rule.hardBlock) { - return res.status(401).json({ error: "Unauthorized" }); - } - if (dappAccount) { - const dappRule = await env - .getDb() - .getIPBlockRuleRecord(ipAddress.bigInt(), dappAccount); - if ( - dappRule?.hardBlock && - dappRule.dappAccount === dappAccount && - BigInt(dappRule.ip) === ipAddress.bigInt() - ) { - return res.status(401).json({ error: "Unauthorized" }); - } - } + // get matching IP rules + const rule = await checkIpRules(env.getDb(), ipAddress, dappAccount); + + // block if hard block + if (rule?.hardBlock) { + return res.status(401).json({ error: "Unauthorized" }); } - if (userAccount && dappAccount) { - const rule = await env - .getDb() - .getUserBlockRuleRecord(userAccount, dappAccount); + // get matching user rules + const userRule = await checkUserRules( + env.getDb(), + userAccount, + dappAccount, + ); - if ( - rule && - rule.userAccount === userAccount && - rule.dappAccount === dappAccount && - rule.hardBlock - ) { - return res.status(401).json({ error: "Unauthorized" }); - } + // block if hard block + if (userRule?.hardBlock) { + return res.status(401).json({ error: "Unauthorized" }); } next(); return; } catch (err) { - console.error("Block Middleware Error:", err); - res.status(401).json({ error: "Unauthorized", message: err }); + logger.error("Block Middleware Error:", err); + res.status(401).json({ error: "Unauthorized" }); return; } }; diff --git a/packages/provider/src/api/captcha.ts b/packages/provider/src/api/captcha.ts index c7002ac58f..d1cc58f5e0 100644 --- a/packages/provider/src/api/captcha.ts +++ b/packages/provider/src/api/captcha.ts @@ -42,6 +42,7 @@ import { getIPAddress } from "../util.js"; import { handleErrors } from "./errorHandler.js"; const DEFAULT_FRICTIONLESS_THRESHOLD = 0.5; +const TEN_MINUTES = 60 * 10; /** * Returns a router connected to the database which can interact with the Proposo protocol @@ -61,6 +62,17 @@ export function prosopoRouter(env: ProviderEnvironment): Router { */ router.post(ApiPaths.GetImageCaptchaChallenge, async (req, res, next) => { let parsed: CaptchaRequestBodyTypeOutput; + + if (!req.ip) { + return next( + new ProsopoApiError("API.BAD_REQUEST", { + context: { code: 400, error: "IP address not found" }, + }), + ); + } + + const ipAddress = getIPAddress(req.ip || ""); + try { parsed = CaptchaRequestBody.parse(req.body); } catch (err) { @@ -96,12 +108,19 @@ export function prosopoRouter(env: ProviderEnvironment): Router { ); } + const captchaConfig = await tasks.imgCaptchaManager.getCaptchaConfig( + ipAddress, + user, + dapp, + ); + const taskData = await tasks.imgCaptchaManager.getRandomCaptchasAndRequestHash( datasetId, user, - getIPAddress(req.ip || ""), + ipAddress, flatten(req.headers), + captchaConfig, ); const captchaResponse: CaptchaResponseBody = { [ApiParams.status]: "ok", @@ -441,7 +460,14 @@ export function prosopoRouter(env: ProviderEnvironment): Router { req.headers["accept-language"] || "", ); - const botScore = (await getBotScore(token)) + lScore; + const { baseBotScore, timestamp } = await getBotScore(token); + + // If the timestamp is older than 10 minutes, send an image captcha + if (timestamp < Date.now() - TEN_MINUTES) { + return res.json(tasks.frictionlessManager.sendImageCaptcha()); + } + + const botScore = baseBotScore + lScore; const clientConfig = await tasks.db.getClientRecord(dapp); const botThreshold = clientConfig?.settings?.frictionlessThreshold || diff --git a/packages/provider/src/rules/ip.ts b/packages/provider/src/rules/ip.ts new file mode 100644 index 0000000000..986a2d0b5a --- /dev/null +++ b/packages/provider/src/rules/ip.ts @@ -0,0 +1,45 @@ +// Copyright 2021-2024 Prosopo (UK) Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import type { BlockRule, IProviderDatabase } from "@prosopo/types-database"; +import type { Address4, Address6 } from "ip-address"; + +export const checkIpRules = async ( + db: IProviderDatabase, + ipAddress: Address4 | Address6, + dapp: string, +): Promise => { + const rule = await db.getIPBlockRuleRecord(ipAddress.bigInt()); + + if (rule && BigInt(rule.ip) === ipAddress.bigInt()) { + // block by IP address globally + if (rule.global) { + return rule; + } + + if (rule.dappAccount === dapp) { + return rule; + } + } + + const dappRule = await db.getIPBlockRuleRecord(ipAddress.bigInt(), dapp); + if ( + dappRule && + dappRule.dappAccount === dapp && + BigInt(dappRule.ip) === ipAddress.bigInt() + ) { + return rule; + } + + return undefined; +}; diff --git a/packages/provider/src/rules/lang.ts b/packages/provider/src/rules/lang.ts new file mode 100644 index 0000000000..a57762ec68 --- /dev/null +++ b/packages/provider/src/rules/lang.ts @@ -0,0 +1,34 @@ +// Copyright 2021-2024 Prosopo (UK) Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import type { ProsopoConfigOutput } from "@prosopo/types"; + +export const checkLangRules = ( + config: ProsopoConfigOutput, + acceptLanguage: string, +): number => { + const lConfig = config.lRules; + let lScore = 0; + if (lConfig) { + const languages = acceptLanguage + .split(",") + .map((lang) => lang.trim().split(";")[0]); + + for (const lang of languages) { + if (lang && lConfig[lang]) { + lScore += lConfig[lang]; + } + } + } + return lScore; +}; diff --git a/packages/provider/src/rules/user.ts b/packages/provider/src/rules/user.ts new file mode 100644 index 0000000000..790b5c3699 --- /dev/null +++ b/packages/provider/src/rules/user.ts @@ -0,0 +1,31 @@ +// Copyright 2021-2024 Prosopo (UK) Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import type { BlockRule, IProviderDatabase } from "@prosopo/types-database"; + +export const checkUserRules = async ( + db: IProviderDatabase, + user: string, + dapp: string, +): Promise => { + const userRule = await db.getUserBlockRuleRecord(user, dapp); + + if ( + userRule && + userRule.userAccount === user && + userRule.dappAccount === dapp + ) { + return userRule; + } + return undefined; +}; diff --git a/packages/provider/src/tasks/client/clientTasks.ts b/packages/provider/src/tasks/client/clientTasks.ts index 497e17f805..3b3e878ac8 100644 --- a/packages/provider/src/tasks/client/clientTasks.ts +++ b/packages/provider/src/tasks/client/clientTasks.ts @@ -16,6 +16,7 @@ import { validateAddress } from "@polkadot/util-crypto/address"; import { type Logger, ProsopoApiError } from "@prosopo/common"; import { CaptchaDatabase, ClientDatabase } from "@prosopo/database"; import { + type CaptchaConfig, type IUserSettings, type ProsopoConfigOutput, ScheduledTaskNames, @@ -221,6 +222,7 @@ export class ClientTaskManager { global: boolean, hardBlock: boolean, dappAccount?: string, + captchaConfig?: CaptchaConfig, ): Promise { const rules: IPAddressBlockRule[] = ips.map((ip) => { return { @@ -229,6 +231,7 @@ export class ClientTaskManager { type: BlockRuleType.ipAddress, dappAccount, hardBlock, + ...(captchaConfig && { captchaConfig }), }; }); await this.providerDB.storeIPBlockRuleRecords(rules); @@ -239,6 +242,7 @@ export class ClientTaskManager { hardBlock: boolean, global: boolean, dappAccount?: string, + captchaConfig?: CaptchaConfig, ): Promise { validateAddress(dappAccount, false, 42); const rules: UserAccountBlockRule[] = userAccounts.map((userAccount) => { @@ -249,6 +253,7 @@ export class ClientTaskManager { type: BlockRuleType.userAccount, global, hardBlock, + ...(captchaConfig && { captchaConfig }), }; }); await this.providerDB.storeUserBlockRuleRecords(rules); diff --git a/packages/provider/src/tasks/detection/decodePayload.js b/packages/provider/src/tasks/detection/decodePayload.js index f505b3f269..93bb82a06e 100644 --- a/packages/provider/src/tasks/detection/decodePayload.js +++ b/packages/provider/src/tasks/detection/decodePayload.js @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. // @ts-nocheck -import{RSA_PKCS1_OAEP_PADDING as ke1NVnn}from'node:constants';import{privateDecrypt as lREV7Ai}from'node:crypto';function pWdLXSY(){}var piAjYa=Object['defineProperty'],jxE9qx,EXOE3Lv,OPYeIJ,k7isoSm,_dgpZr,CoGbBQv,kanelE,Ub9_QD_,pPcCSP,m9CMj7w,pJrm5XI,Edo1s7,m6EgV0,VX1TUD,NiTDZI,xytyla,RoadQk,RArX5u,WLP1A1o,HNsqsKe,i3n_Vl,xhUEef,H6u626,XJAaP6,ExGxfh7,Wt7a_qb,Ja_HYmM,c82qg2;function EuVmu2S(ke1NVnn){return c82qg2[ke1NVnn>0x49?ke1NVnn<0x6d?ke1NVnn-0x4a:ke1NVnn-0x33:ke1NVnn+0x5]}c82qg2=Ln0ibq();var imUtytB=[],SgQEcG=['N%*Gn:)L','uiKI$s>,','f"qUc','m#b;0*B:','X@",,%9','BxhO_({D+h,q:e+','LLr6eW!T0J]Qs;*o|d','B/=/m','5geM{%Vd','B/_6S8$',EuVmu2S(0x4a),'ZOe&~chd',EuVmu2S(0x4a),'H5x,','?lDjP','~JPMH5urF','sgpW(P%T0J]Qs;*o|d','Lp|b@zoT','ZOe&~chd','5ghDI>dV^/cA>pa&9v;)NRDyRy&@L.[#_!A}WP3hH','zQH|j@[Hv^qyR=CcWIMNs[4BxOCYd','n!/6z?YdEO?Uw53E/J}MwR[O@+y)"4Gjgp%}I4$aWy5fXGy','^/om")RQA~_Vgl6{|S_Z','I3UH7G$','|&G).G`Sr"N>+)D=uS{7nIn#eC|6R=Qz,O/H05w,(O1','9v2j{@Ydba=DwzD#;E?[<>dVt!OW7Z','(3X8H5ooDbLzg(gC.~.}','UvJM<3bhs!VCQgl=PjjW`>zBvLXA/.vEvOa3xRw|r,','0QoD4aI:}blNFx.!','3IHD}OD,)V4Wd','!~ofZ*<:P}','Cpsj?IQD/V$B"Z};:pD}PehVI".a/V8=u6k[FEZ|9V','T^{}b(tr5,0)l.dUAzW[%NkYD','F}3M|>w8mC>,0F];0;%733S,I.','BR%}!e^:pJ_AaaH=3[AZ7G$','?.o}u/4:4,Vaymt_%D3W#2uT',':z]MsB&X[aBNBgQ|AK4bl8,rae6@SLD%ngPMk5nEJp%6Ug','A3B@b~}=Tp{aRV9Ezz$1~"|,+L[L*51U~Ro|IW7o5LE','j[W[=ol#oJ?8LgIm&{;3)8~k/a:HJ#c,j/7Hn/eVCwG7=Z}','N`13*?RDKa+wWU={TSs@(U*rx}pfB(A;bOlb?@K@UX6!Kg','tN{f;e!*vSi:Ix3jCMu8Rac~;!','/O9&WOMT;Jh>N5PE9vsD=O1HfOPiW=lzv$','_QB@dU,UKVQK5)FEg','!rM/I(qd','a[=|}kjy.,=','W.2j)8FVn]c:*5J62J+f1:5h@V~=JpIc[!A@U>6:FV','{[cDXka>Z','PJ30IYt*;R!aTz%%>K9"H5N3BL@NlfFz%S+}L%`S6~,)Aly','slJDh/+SdL6AfVD,/[#1!','UO;MOltrAyl,^p!mAz.@;%8,;efN[mq_U33"+aVXFV','`<9WjB~V)aS!Z[O:HO{2UY@T','1on3wRZ#:SO','8KlZPG{52,<@Cv?o@E#/K)>*A~b66(iCHOwy','*Il[084V(X4','Lp8Mi"$','ORH1}OQ*wpBNjmm&GE0),5[VlXMmMg.oTwG",','3SQFMBqh;Jl_d)mC;zYMR95dPp8y~lwzv;d3RA$',')!h/ZAJ3MLQ,XTFXN.l7tB8|J}','h3H|0*3:0JG.*f&U','`<<&*I%Tw~|6n=~&{L!&SUH=Z+KfrVm&`OzjV','?I^Z,%y+%a:H.FnxtRk762[V1,*l@gCm;J<8X','zgA}{2NV$}q=@m{:%pG);?|#lX8l}v{hhC~fm[@T',';/TYF5XdoCjma4%,d~ofM/Kr}!E#RVq{l`XM8%fYD','m/P"+)OB|wH!mT1U1p}|.','@I)/a"Cd','i3,W$b:VC~5MVp%#f[r6DE0@dS/7:Tgzp6#D!','gOnW]PBh`JV{wVy,5vQ"_?$','%vtfY%h?uyG>>>:=','CR|b:oK@{!','Uz5/?P0+^X0/!LE6gLJD','Q/QWDpMUL^(].z9jAKeyBfb?Y]6#{GNX/J"j`l_>xwwWd','8603}R/T','LLkHx@L"H+xQ*T','J/L1b(Qa>L[f04ECsC)}I:.#v^^)"vE#NeT','zvuH+bnSM};!xBCo/oX&^?`Tn]',';J7WZvj@Yyk>Kg','uOeMfYL"GLMgSBt:Cz`Mj2hVr,}3j[e&c&L@sIUT','[3Pyy*8*Mw=#9Bx!WJB@x7j>HV','R/wM0G$aW"aW0(.','&Qp8Y83HIy"6n=N%jpn3m[Vh:X)i$','z<&bbzM@ES/w~(gz;;g','d~C#g','+DJ/9Ip>vSF4kZ,oA]_H^@(>A~gYom|&3$','uO$m]%FHRyeW@vZ|$~*H`f@|4"zAX[S','aRzZ@~$','][aMpAQ#(OheH;(Ei3`WrWnE1Ss=slS','}S.@sBmK:];x|[E$','x~cNY%~d3Sy4b(dzYz(3J)la0R|b6.l%*EEM]b$','*EK}M[%T','>=H}j:j,We5,6.c=YQ>fS','2J13|[/T@=.!7emN%tvwM""D|2Lg)PLbh|pe0#[@*?X','aQ{}t@Ra5Sg(d','2Ja3lb}=5O@~Op"jI!lj_O{kl+Jwc%nhbJM3YG78<](pTF','RQyYI~6Hi/QWtvdU7eT','%ST)`Yj#JSCAE%s:hvubqO>o&RO.L(?j;[U8:>$','V;kH1Ne&LSI^Oxa`[gOD@WnQY]6kMxd|i`B}','?3d2vY,l]C@N^U]crS,Ypc$#%Xf7m%OhnK/N1/$*!+tWmPy','=p7"zNZa!+G7_(_jIJ)Dx7^XM^VQIZGm,~_Z)R7DM}y3=x+`','`Cj0cQC=4Rk={T];WjcjDp$','7R}2cYDr3pZ)HP}','~jy2#Bek<]dJoPYc>$','^;E3If8*+Smm~(${uSq/FvaaL~4=7gsEJCEY"z%UY.mRPT','(=%@*2i{{!cC)[TCsgaM>5D|/+nU_5+|CL:M>81H7"28&F','W]V6xPl#$p)]SLLc','h&fmv(o,4yEAu[Q%y[kb3KE|p]','#8&0qB7,].:0,4j`qv^jrl"d','kQ{ZwpXBPS8=i%}c{Og);2LhtVKf#mdC"[Y"rQ3~NC8"d','E3lf4"{d','/.OD4a),SC$(B([z~eD@HA?d','BJU&oBa|`C+@B%R`','"/~jCU2#q.gxxgx;Xo?H0vi&,L1!e(U6','8v])z>b&@XX);Gp|2!b}I>^B)V"^yL0X#JAf`(8SJpe','{L,MG9L5hCKefxD','56hD"(F"C,r6+PjUe!{NE/_*5L(l8l1{"$','9=+}|[V"S^S0oBy','zpu6je$','2QymP%UUpN=85j`bI?;s@R8=C','a5c=w``3C7Xd','r;#1jBl@ORv.V9U6eQxmx[$','5e:&alAhReTY/V);"SCmAUpT7"L!fpy','mp$/L7>*1OK]:(M{`3G3nIA3RyU0{(Ez/$','"[&7oBIXuCUE|fy;?3e0wp^"F+yVvBM,Dh:u,$Sg)TFM{b/{fBz{"dwCk+pwCzz#}M:,rJ~k:d','rRvN@~J{W"VY`a&:N!{}ypcB`]&v|z}=&QvNV7/T','$r38Qp.T','Gv#225Pd',')!WGx@YATS^E%V|UO.K}$A$','s.DHOA7EW]','{ot/`KDyYJ4ZX.gR5V0bQlA[!ErQ;mRvu|s!5fyLbE5j)f*70#sa7>^F','OEM|=BnEJSZ){B[%8Kcfi"Q|?V3','kQR@?I.+M,','{LWHkU!*dL,#B(pU}{var EXOE3Lv=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn>-0x2c?ke1NVnn<-0x2c?ke1NVnn+0xd:ke1NVnn>-0x2c?ke1NVnn<-0x2c?ke1NVnn-0x4a:ke1NVnn+0x2b:ke1NVnn-0x21:ke1NVnn-0x51]},0x1);if(typeof piAjYa===EuVmu2S(0x4e)){piAjYa=ytyugP}if(typeof jxE9qx==='undefined'){jxE9qx=imUtytB}if(ke1NVnn!==lREV7Ai){return jxE9qx[ke1NVnn]||(jxE9qx[ke1NVnn]=piAjYa(SgQEcG[ke1NVnn]))}if(piAjYa===EXOE3Lv(-0x26)){Ja_HYmM=jxE9qx}};function KDYXtG3(){return globalThis}function eu_hhQc(){return global}function SZjML2(){return window}function FEBgiH(){return new Function('return this')()}function VBFYsXg(ke1NVnn=[KDYXtG3,eu_hhQc,SZjML2,FEBgiH],lREV7Ai,piAjYa=[],jxE9qx,EXOE3Lv){lREV7Ai=lREV7Ai;try{pWdLXSY(lREV7Ai=Object,piAjYa.push(''.__proto__.constructor.name))}catch(e){}cU_Tf9g:for(jxE9qx=EuVmu2S(0x4b);jxE9qx{return c82qg2[ke1NVnn<0x1f?ke1NVnn-0x50:ke1NVnn<0x43?ke1NVnn-0x20:ke1NVnn+0x28]},0x1);lREV7Ai=ke1NVnn[jxE9qx]();for(EXOE3Lv=OPYeIJ(0x21);EXOE3Lv{var ke1NVnn=new i3n_Vl(0x80),lREV7Ai,piAjYa;pWdLXSY(lREV7Ai=xhUEef[EuVmu2S(0x4c)]||xhUEef.fromCharCode,piAjYa=[]);return JeoILhp(jxE9qx=>{var EXOE3Lv,OPYeIJ,k7isoSm,_dgpZr;pWdLXSY(k7isoSm=jxE9qx.length,piAjYa.length=0x0);for(_dgpZr=0x0;_dgpZr{return c82qg2[jxE9qx>0x48?jxE9qx-0x22:jxE9qx<0x48?jxE9qx<0x24?jxE9qx-0x52:jxE9qx>0x48?jxE9qx-0xd:jxE9qx-0x25:jxE9qx-0x5c]},0x1);OPYeIJ=jxE9qx[_dgpZr++];if(OPYeIJ<=0x7f){EXOE3Lv=OPYeIJ}else{if(OPYeIJ<=0xdf){var kanelE=JeoILhp(jxE9qx=>{return c82qg2[jxE9qx>0x3a?jxE9qx-0x5:jxE9qx-0x17]},0x1);EXOE3Lv=(OPYeIJ&0x1f)<<0x6|jxE9qx[_dgpZr++]&kanelE(0x1a)}else{if(OPYeIJ<=0xef){EXOE3Lv=(OPYeIJ&0xf)<<0xc|(jxE9qx[_dgpZr++]&0x3f)<<0x6|jxE9qx[_dgpZr++]&0x3f}else{if(xhUEef[CoGbBQv(0x27)]){EXOE3Lv=(OPYeIJ&0x7)<<0x12|(jxE9qx[_dgpZr++]&0x3f)<<0xc|(jxE9qx[_dgpZr++]&0x3f)<<0x6|jxE9qx[_dgpZr++]&0x3f}else{var Ub9_QD_=JeoILhp(jxE9qx=>{return c82qg2[jxE9qx>-0x49?jxE9qx<-0x49?jxE9qx+0x2a:jxE9qx+0x48:jxE9qx-0x8]},0x1);pWdLXSY(EXOE3Lv=Ub9_QD_(-0x45),_dgpZr+=0x3)}}}}piAjYa.push(ke1NVnn[EXOE3Lv]||(ke1NVnn[EXOE3Lv]=lREV7Ai(EXOE3Lv)))}return piAjYa.join('')},0x1)})());function BdPikHr(ke1NVnn){var lREV7Ai=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn>0x17?ke1NVnn-0x18:ke1NVnn+0x53]},0x1);return typeof ExGxfh7!=='undefined'&&ExGxfh7?new ExGxfh7().decode(new XJAaP6(ke1NVnn)):typeof H6u626!==lREV7Ai(0x1c)&&H6u626?H6u626.from(ke1NVnn).toString('utf-8'):HNsqsKe(ke1NVnn)}pWdLXSY(WLP1A1o=Ja_HYmM(0x9a),RArX5u=Ja_HYmM(0x96),RoadQk=Ja_HYmM(0x87),xytyla=Ja_HYmM(0x7c),NiTDZI=Ja_HYmM(0x66),VX1TUD=Ja_HYmM[EuVmu2S(0x50)](EuVmu2S(0x4f),[0x5b]),m6EgV0=Ja_HYmM(0x48),Edo1s7=Ja_HYmM(0x31),pJrm5XI=Ja_HYmM.apply(void 0x0,[EuVmu2S(0x57)]),m9CMj7w=Ja_HYmM(0x22),pPcCSP=Ja_HYmM(0x1e),Ub9_QD_=Ja_HYmM(0x1c),kanelE=[Ja_HYmM(0x1a),Ja_HYmM(0x1f),Ja_HYmM(0x2d),Ja_HYmM(0x2e),Ja_HYmM(0x2f),Ja_HYmM(0x32),Ja_HYmM.call(EuVmu2S(0x4f),0x3a),Ja_HYmM[EuVmu2S(0x51)](EuVmu2S(0x4f),0x3f),Ja_HYmM(0x5a),Ja_HYmM(0x62),Ja_HYmM[EuVmu2S(0x50)](void 0x0,[0x6a])],CoGbBQv={EElpaZ:Ja_HYmM(0x6),Mjqoxxo:Ja_HYmM(0x24),zFS57I:Ja_HYmM(0x2c),cx6Y9lJ:Ja_HYmM[EuVmu2S(0x51)](EuVmu2S(0x4f),0x38),hXL0xg:Ja_HYmM.apply(EuVmu2S(0x4f),[0x4c]),jiYLOv:Ja_HYmM(0x50),ppzf9R:Ja_HYmM(0x8d),nY3PoPc:Ja_HYmM(0x92),YI4ZyIn:Ja_HYmM(0xa4),UxOXKWm:Ja_HYmM(0xaf)},_dgpZr=JeoILhp((ke1NVnn,piAjYa)=>{var jxE9qx=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn<-0x32?ke1NVnn<-0x32?ke1NVnn>-0x56?ke1NVnn>-0x32?ke1NVnn-0x1a:ke1NVnn+0x55:ke1NVnn-0x54:ke1NVnn-0x3:ke1NVnn-0x56]},0x1);pWdLXSY(ke1NVnn=(piAjYa,jxE9qx,lREV7Ai,pWdLXSY,OPYeIJ)=>{var k7isoSm=JeoILhp(piAjYa=>{return c82qg2[piAjYa>-0x27?piAjYa+0x38:piAjYa>-0x4b?piAjYa>-0x27?piAjYa-0x53:piAjYa+0x4a:piAjYa-0xc]},0x1);if(typeof pWdLXSY===EuVmu2S(0x4e)){pWdLXSY=EXOE3Lv}if(typeof OPYeIJ===k7isoSm(-0x46)){OPYeIJ=imUtytB}if(lREV7Ai==piAjYa){return jxE9qx[imUtytB[lREV7Ai]]=ke1NVnn(piAjYa,jxE9qx)}if(jxE9qx){[OPYeIJ,jxE9qx]=[pWdLXSY(OPYeIJ),piAjYa||lREV7Ai];return ke1NVnn(piAjYa,OPYeIJ,lREV7Ai)}if(piAjYa!==jxE9qx){return OPYeIJ[piAjYa]||(OPYeIJ[piAjYa]=pWdLXSY(SgQEcG[piAjYa]))}if(lREV7Ai&&pWdLXSY!==EXOE3Lv){ke1NVnn=EXOE3Lv;return ke1NVnn(piAjYa,-0x1,lREV7Ai,pWdLXSY,OPYeIJ)}if(lREV7Ai==pWdLXSY){return jxE9qx?piAjYa[OPYeIJ[jxE9qx]]:imUtytB[piAjYa]||(lREV7Ai=OPYeIJ[piAjYa]||pWdLXSY,imUtytB[piAjYa]=lREV7Ai(SgQEcG[piAjYa]))}},piAjYa={dgn9NX:[],Tfz2R8:JeoILhp((piAjYa=ke1NVnn[jxE9qx(-0x4f)](void 0x0,[jxE9qx(-0x54)]))=>{if(!_dgpZr.dgn9NX[EuVmu2S(0x4b)]){_dgpZr.dgn9NX.push(0x12)}return _dgpZr.dgn9NX[piAjYa]})});return piAjYa;function EXOE3Lv(ke1NVnn,piAjYa='A$LFPJUqRY/B;<1%({X`*tCNMa)s.~E"I=>yw}V+lK_8xurmfipe]52oc?d#j|v0WT4h7bz^ZSHgDGn3,:6kO@!9[Q&',EXOE3Lv,OPYeIJ,k7isoSm=[],_dgpZr=0x0,CoGbBQv,kanelE,Ub9_QD_,pPcCSP){pWdLXSY(EXOE3Lv=''+(ke1NVnn||''),OPYeIJ=EXOE3Lv.length,CoGbBQv=EuVmu2S(0x4b),kanelE=-0x1);for(Ub9_QD_=EuVmu2S(0x4b);Ub9_QD_{return c82qg2[ke1NVnn>-0x4c?ke1NVnn+0x4b:ke1NVnn-0x51]},0x1);pWdLXSY(kanelE+=pPcCSP*0x5b,_dgpZr|=kanelE<0x58?EuVmu2S(0x54):m9CMj7w(-0x40));do{pWdLXSY(k7isoSm.push(_dgpZr&0xff),_dgpZr>>=jxE9qx(-0x4d),CoGbBQv-=jxE9qx(-0x4d))}while(CoGbBQv>m9CMj7w(-0x3c));kanelE=-jxE9qx(-0x4c)}}if(kanelE>-0x1){var pJrm5XI=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn>0x55?ke1NVnn<0x55?ke1NVnn+0x13:ke1NVnn>0x55?ke1NVnn<0x79?ke1NVnn-0x56:ke1NVnn+0x54:ke1NVnn-0x38:ke1NVnn+0xf]},0x1);k7isoSm.push((_dgpZr|kanelE<{if(typeof EXOE3Lv==='undefined'){EXOE3Lv=jxE9qx}if(typeof OPYeIJ==='undefined'){OPYeIJ=imUtytB}if(pWdLXSY==ke1NVnn){return lREV7Ai[imUtytB[pWdLXSY]]=piAjYa(ke1NVnn,lREV7Ai)}if(lREV7Ai){[OPYeIJ,lREV7Ai]=[EXOE3Lv(OPYeIJ),ke1NVnn||pWdLXSY];return piAjYa(ke1NVnn,OPYeIJ,pWdLXSY)}if(EXOE3Lv===piAjYa){jxE9qx=lREV7Ai;return jxE9qx(pWdLXSY)}if(EXOE3Lv===void 0x0){piAjYa=OPYeIJ}if(pWdLXSY==EXOE3Lv){return lREV7Ai?ke1NVnn[OPYeIJ[lREV7Ai]]:imUtytB[ke1NVnn]||(pWdLXSY=OPYeIJ[ke1NVnn]||EXOE3Lv,imUtytB[ke1NVnn]=pWdLXSY(SgQEcG[ke1NVnn]))}if(ke1NVnn!==lREV7Ai){return OPYeIJ[ke1NVnn]||(OPYeIJ[ke1NVnn]=EXOE3Lv(SgQEcG[ke1NVnn]))}};return ke1NVnn[ke1NVnn[piAjYa(EuVmu2S(0x53))]-0x1];function jxE9qx(ke1NVnn,piAjYa=':1,CWeBEADYh)Owi+Xj6K%du;|>{LGm&4^F[7"0H?(ZV]PbcTp89~kxSgrt}ovzQU.!2f3yJR#=NqI$`Ms<5l@*/_an',jxE9qx,EXOE3Lv,OPYeIJ=[],k7isoSm=0x0,_dgpZr,CoGbBQv,kanelE=0x0,Ub9_QD_){var pPcCSP=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn<-0x59?ke1NVnn+0x39:ke1NVnn>-0x35?ke1NVnn-0x48:ke1NVnn>-0x35?ke1NVnn-0x55:ke1NVnn<-0x59?ke1NVnn-0x5:ke1NVnn+0x58]},0x1);pWdLXSY(jxE9qx=''+(ke1NVnn||''),EXOE3Lv=jxE9qx.length,_dgpZr=pPcCSP(-0x57),CoGbBQv=-EuVmu2S(0x53));for(kanelE=kanelE;kanelE{return c82qg2[ke1NVnn<0x62?ke1NVnn-0x59:ke1NVnn<0x62?ke1NVnn-0xa:ke1NVnn-0x63]},0x1);Ub9_QD_=piAjYa.indexOf(jxE9qx[kanelE]);if(Ub9_QD_===-m9CMj7w(0x6c)){continue}if(CoGbBQv{return c82qg2[ke1NVnn>-0x37?ke1NVnn+0x1c:ke1NVnn>-0x5b?ke1NVnn+0x5a:ke1NVnn+0x1a]},0x1);pWdLXSY(CoGbBQv+=Ub9_QD_*pJrm5XI(-0x4c),k7isoSm|=CoGbBQv<<_dgpZr,_dgpZr+=(CoGbBQv&0x1fff)>0x58?EuVmu2S(0x54):pJrm5XI(-0x4f));do{var Edo1s7=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn>0xa?ke1NVnn+0x1:ke1NVnn<0xa?ke1NVnn>-0x1a?ke1NVnn+0x19:ke1NVnn+0x55:ke1NVnn+0x40]},0x1);pWdLXSY(OPYeIJ.push(k7isoSm&EuVmu2S(0x56)),k7isoSm>>=Edo1s7(-0x11),_dgpZr-=0x8)}while(_dgpZr>0x7);CoGbBQv=-0x1}}if(CoGbBQv>-0x1){OPYeIJ.push((k7isoSm|CoGbBQv<<_dgpZr)&pPcCSP(-0x4c))}return BdPikHr(OPYeIJ)}}function OnOUYEb(ke1NVnn,lREV7Ai){var pWdLXSY=JeoILhp(ke1NVnn=>{return c82qg2[ke1NVnn>0x19?ke1NVnn-0x1a:ke1NVnn-0x0]},0x1);switch(k7isoSm){case EuVmu2S(0x57):return-ke1NVnn;case pWdLXSY(0x1b):return ke1NVnn/lREV7Ai;case 0x14:return ke1NVnn-lREV7Ai}}function kXmbxKq(ke1NVnn){return nwV8psu(ke1NVnn=k7isoSm+(k7isoSm=ke1NVnn,EuVmu2S(0x4b)),ke1NVnn)}k7isoSm=k7isoSm;function yeg3Qb(ke1NVnn,piAjYa){var jxE9qx,EXOE3Lv;function k7isoSm(ke1NVnn){return c82qg2[ke1NVnn<0x49?ke1NVnn-0x26:ke1NVnn-0x12]}pWdLXSY(jxE9qx=(ke1NVnn,piAjYa,EXOE3Lv,k7isoSm,lREV7Ai)=>{if(typeof k7isoSm==='undefined'){k7isoSm=_dgpZr}if(typeof lREV7Ai==='undefined'){lREV7Ai=imUtytB}if(k7isoSm===void 0x0){jxE9qx=lREV7Ai}if(k7isoSm===jxE9qx){_dgpZr=piAjYa;return _dgpZr(EXOE3Lv)}if(EXOE3Lv&&k7isoSm!==_dgpZr){jxE9qx=_dgpZr;return jxE9qx(ke1NVnn,-0x1,EXOE3Lv,k7isoSm,lREV7Ai)}if(piAjYa){[lREV7Ai,piAjYa]=[k7isoSm(lREV7Ai),ke1NVnn||EXOE3Lv];return jxE9qx(ke1NVnn,lREV7Ai,EXOE3Lv)}if(EXOE3Lv==ke1NVnn){return piAjYa[imUtytB[EXOE3Lv]]=jxE9qx(ke1NVnn,piAjYa)}if(ke1NVnn!==piAjYa){return lREV7Ai[ke1NVnn]||(lREV7Ai[ke1NVnn]=k7isoSm(SgQEcG[ke1NVnn]))}},EXOE3Lv=[jxE9qx(0x5)]);return OPYeIJ[jxE9qx.call(void 0x0,0x2)](null,ke1NVnn,jxE9qx(0x3),{[jxE9qx.call(k7isoSm(0x2b),0x4)]:piAjYa,[EXOE3Lv[0x0]]:!0x0});function _dgpZr(ke1NVnn,piAjYa='9A:"@MG?lUX_+IZ#1YJKb|wmv&Bci.D),Vz>{8`5Tk!xNpSoq7L}C6OHgas/[enydh$~PQE%Ft({return c82qg2[ke1NVnn<0x11?ke1NVnn<0x11?ke1NVnn>-0x13?ke1NVnn+0x12:ke1NVnn+0x14:ke1NVnn+0x59:ke1NVnn-0x5f]},0x1);pWdLXSY(jxE9qx=''+(ke1NVnn||''),EXOE3Lv=jxE9qx.length,CoGbBQv=m9CMj7w(-0x11),kanelE=-m9CMj7w(-0x9));for(Ub9_QD_=Ub9_QD_;Ub9_QD_{return c82qg2[ke1NVnn<0x45?ke1NVnn>0x45?ke1NVnn+0x8:ke1NVnn>0x21?ke1NVnn-0x22:ke1NVnn+0x18:ke1NVnn-0x3a]},0x1);pWdLXSY(kanelE+=pPcCSP*k7isoSm(0x34),OPYeIJ|=kanelE<EuVmu2S(0x5c)?m9CMj7w(-0x8):k7isoSm(0x31));do{pWdLXSY(_dgpZr.push(OPYeIJ&0xff),OPYeIJ>>=0x8,CoGbBQv-=k7isoSm(0x2e))}while(CoGbBQv>pJrm5XI(0x31));kanelE=-0x1}}if(kanelE>-0x1){_dgpZr.push((OPYeIJ|kanelE<{var lREV7Ai;function pWdLXSY(ke1NVnn){return c82qg2[ke1NVnn>-0x37?ke1NVnn>-0x37?ke1NVnn<-0x37?ke1NVnn-0x17:ke1NVnn+0x36:ke1NVnn-0x25:ke1NVnn-0xa]}lREV7Ai=[Ja_HYmM(0x7)];const [piAjYa,jxE9qx]=ke1NVnn,EXOE3Lv=Number((''+piAjYa).slice(OnOUYEb(0x3,kXmbxKq(0x26)))),OPYeIJ=OnOUYEb(jxE9qx,0x3e8,k7isoSm=0x0);return OnOUYEb((Math[lREV7Ai[pWdLXSY(-0x35)]](OPYeIJ)+Math.PI/0x2)*0x3e7/Math.PI,EXOE3Lv,k7isoSm=0x14)},Z4ecsKo=async ke1NVnn=>{var lREV7Ai,piAjYa;function EXOE3Lv(ke1NVnn){return c82qg2[ke1NVnn<0x33?ke1NVnn>0xf?ke1NVnn>0xf?ke1NVnn<0x33?ke1NVnn-0x10:ke1NVnn-0x55:ke1NVnn-0x15:ke1NVnn+0x44:ke1NVnn-0x26]}pWdLXSY(lREV7Ai={DqXTPrc:Ja_HYmM(0x9)},piAjYa=[Ja_HYmM(EuVmu2S(0x52))]);const OPYeIJ=Buffer.from(process.env.BOT_DECRYPTION_KEY||'',piAjYa[0x0]).toString(lREV7Ai.DqXTPrc),_dgpZr=(jxE9qx=[ke1NVnn,OPYeIJ],new v7qoQJy(Ja_HYmM(0xa),EuVmu2S(0x4f),Ja_HYmM(0xb)).DQzcQg4),CoGbBQv=ljkucFZ(JSON.parse(_dgpZr));return OnOUYEb(Math.round(CoGbBQv*EuVmu2S(0x5a)),EXOE3Lv(0x20),k7isoSm=0x0)};export{Z4ecsKo as default};function v7qoQJy(piAjYa,OPYeIJ,k7isoSm,CoGbBQv,kanelE,Ub9_QD_,pPcCSP,m9CMj7w,pJrm5XI){var Edo1s7=JeoILhp(piAjYa=>{return c82qg2[piAjYa>-0x2a?piAjYa<-0x2a?piAjYa-0x3e:piAjYa+0x29:piAjYa+0x11]},0x1);pWdLXSY(CoGbBQv=[Ja_HYmM(0x18)],kanelE={[Edo1s7(-0x7)]:Ja_HYmM.apply(void 0x0,[0x17])},Ub9_QD_=Ja_HYmM(0x15),pPcCSP={[Ja_HYmM(0xc)]:JeoILhp((piAjYa,OPYeIJ,k7isoSm)=>{var CoGbBQv=JeoILhp(piAjYa=>{return c82qg2[piAjYa<0x60?piAjYa-0x26:piAjYa<0x84?piAjYa-0x61:piAjYa+0x23]},0x1);pWdLXSY(piAjYa=(OPYeIJ,k7isoSm,CoGbBQv,kanelE,Ub9_QD_)=>{if(typeof kanelE===EuVmu2S(0x4e)){kanelE=m9CMj7w}if(typeof Ub9_QD_==='undefined'){Ub9_QD_=imUtytB}if(CoGbBQv==kanelE){return k7isoSm?OPYeIJ[Ub9_QD_[k7isoSm]]:imUtytB[OPYeIJ]||(CoGbBQv=Ub9_QD_[OPYeIJ]||kanelE,imUtytB[OPYeIJ]=CoGbBQv(SgQEcG[OPYeIJ]))}if(kanelE===piAjYa){m9CMj7w=k7isoSm;return m9CMj7w(CoGbBQv)}if(CoGbBQv==OPYeIJ){return k7isoSm[imUtytB[CoGbBQv]]=piAjYa(OPYeIJ,k7isoSm)}if(OPYeIJ!==k7isoSm){return Ub9_QD_[OPYeIJ]||(Ub9_QD_[OPYeIJ]=kanelE(SgQEcG[OPYeIJ]))}if(kanelE===void 0x0){piAjYa=Ub9_QD_}},OPYeIJ=[piAjYa.apply(void 0x0,[0xf])],k7isoSm=piAjYa(0xe));var [kanelE,Ub9_QD_]=jxE9qx;const pPcCSP=Buffer[piAjYa(EuVmu2S(0x54))](kanelE,k7isoSm);return lREV7Ai({[OPYeIJ[CoGbBQv(0x62)]]:Ub9_QD_,[Ja_HYmM(0x10)]:ke1NVnn,[Ja_HYmM(0x11)]:Ja_HYmM(0x12)},pPcCSP)[Ja_HYmM(0x13)](piAjYa(0x14));function m9CMj7w(piAjYa,OPYeIJ='DxarNpWofjARInPtHJuv${YT~k#Bq1S*7XEFwQ"OC0Z!2m+y.4?V69iKzls_%/53^M>U`<,dL])@h[8&:G(eb|gc}=;',k7isoSm,kanelE,Ub9_QD_=[],pPcCSP=0x0,m9CMj7w=0x0,pJrm5XI,Edo1s7,m6EgV0){var ke1NVnn=JeoILhp(piAjYa=>{return c82qg2[piAjYa<0x19?piAjYa+0xa:piAjYa<0x19?piAjYa-0x4d:piAjYa<0x19?piAjYa-0x5d:piAjYa-0x1a]},0x1);pWdLXSY(k7isoSm=''+(piAjYa||''),kanelE=k7isoSm.length,pJrm5XI=-0x1);for(Edo1s7=EuVmu2S(0x4b);Edo1s7{return c82qg2[piAjYa<0x2a?piAjYa>0x6?piAjYa<0x2a?piAjYa-0x7:piAjYa-0x46:piAjYa-0x4:piAjYa+0x9]},0x1);pWdLXSY(pJrm5XI+=m6EgV0*0x5b,pPcCSP|=pJrm5XI<EuVmu2S(0x5c)?CoGbBQv(0x6b):0xe);do{pWdLXSY(Ub9_QD_.push(pPcCSP&0xff),pPcCSP>>=EuVmu2S(0x52),m9CMj7w-=EuVmu2S(0x52))}while(m9CMj7w>0x7);pJrm5XI=-jxE9qx(0x10)}}if(pJrm5XI>-ke1NVnn(0x23)){Ub9_QD_.push((pPcCSP|pJrm5XI<{return c82qg2[OPYeIJ>-0x46?OPYeIJ>-0x22?OPYeIJ-0x40:OPYeIJ<-0x46?OPYeIJ-0x9:OPYeIJ>-0x46?OPYeIJ+0x45:OPYeIJ-0x30:OPYeIJ-0x61]},0x1);pWdLXSY(OPYeIJ=-0x2,k7isoSm=-0xb1,CoGbBQv=-0x63,Ub9_QD_={z:0x177,[EuVmu2S(0x5f)]:()=>{var OPYeIJ=JeoILhp(k7isoSm=>{return c82qg2[k7isoSm<-0x1d?k7isoSm>-0x41?k7isoSm<-0x1d?k7isoSm>-0x1d?k7isoSm-0xb:k7isoSm+0x40:k7isoSm-0x62:k7isoSm-0x2c:k7isoSm+0x10]},0x1);return kanelE+=Ub9_QD_[OPYeIJ(-0x2c)]==EuVmu2S(0x5d)?-EuVmu2S(0x6b):Ub9_QD_.X},af:0xd,aj:()=>{pWdLXSY(kanelE=-0x20,OPYeIJ-=0xe,Ub9_QD_.ae(),CoGbBQv+=Ub9_QD_.af,kanelE+=Ub9_QD_.ag,Ub9_QD_[EuVmu2S(0x61)]=!0x1);return'ah'},[Edo1s7(-0x27)]:JeoILhp(()=>{return k7isoSm+=OPYeIJ-0x151}),q:()=>(OPYeIJ+=k7isoSm==-0x86?0xa9:'l',k7isoSm+=Ub9_QD_.n,CoGbBQv+=EuVmu2S(0x5d),kanelE+=k7isoSm==-0xc?Ub9_QD_.p:-0x1ff),[Edo1s7(-0x2d)]:()=>{pWdLXSY(k7isoSm+=0x140,CoGbBQv+=Ub9_QD_[EuVmu2S(0x5e)],Ub9_QD_[EuVmu2S(0x5f)]());return'Z'},n:0xd2,ac:()=>k7isoSm+=0xbb,[Edo1s7(-0x2b)]:0xa9,P:-EuVmu2S(0x69),ad:0x92,ag:0x1f7,i:(CoGbBQv=OPYeIJ==0x62)=>{if(CoGbBQv){return Ub9_QD_.k()}pWdLXSY(k7isoSm=-(Ub9_QD_[EuVmu2S(0x67)]==-0x39?'e':0x72),k7isoSm*=0x2,k7isoSm+=0x4a,kanelE-=0x28);return'g'},[EuVmu2S(0x66)]:-0x42,[Edo1s7(-0x31)]:Edo1s7(-0x32),ae:JeoILhp(()=>{return k7isoSm-=0x1db}),[Edo1s7(-0x2c)]:()=>{var OPYeIJ=JeoILhp(k7isoSm=>{return c82qg2[k7isoSm<0x5b?k7isoSm-0x31:k7isoSm<0x7f?k7isoSm<0x7f?k7isoSm>0x5b?k7isoSm-0x5c:k7isoSm+0x7:k7isoSm-0x18:k7isoSm-0x11]},0x1);return Ub9_QD_[OPYeIJ(0x72)]=lREV7Ai},H:(k7isoSm=OPYeIJ==(Ub9_QD_.B==-0xc2?0x22:0x13))=>{var CoGbBQv=JeoILhp(k7isoSm=>{return c82qg2[k7isoSm<-0x1c?k7isoSm<-0x40?k7isoSm+0x56:k7isoSm>-0x1c?k7isoSm-0x1e:k7isoSm>-0x1c?k7isoSm-0x1b:k7isoSm+0x3f:k7isoSm-0x22]},0x1);if(k7isoSm){return arguments}return Ub9_QD_[CoGbBQv(-0x29)]=lREV7Ai},c:-0x108,[EuVmu2S(0x65)]:-0xaa,G:-0x11,S:JeoILhp(()=>{return yeg3Qb(Ub9_QD_.R=ke1NVnn,lREV7Ai)}),T:()=>k7isoSm-=0x32,an:JeoILhp(OPYeIJ=>{return OPYeIJ[EuVmu2S(0x61)]?-0x18f:0xb1},0x1),ao:JeoILhp(OPYeIJ=>{return OPYeIJ+0x7c},0x1)});while(OPYeIJ+k7isoSm+CoGbBQv+kanelE!=0x76){var m6EgV0=JeoILhp(OPYeIJ=>{return c82qg2[OPYeIJ>0x84?OPYeIJ+0x4c:OPYeIJ>0x84?OPYeIJ+0x64:OPYeIJ<0x60?OPYeIJ-0x62:OPYeIJ-0x61]},0x1);m9CMj7w=Ja_HYmM(0x16);switch(OPYeIJ+k7isoSm+CoGbBQv+kanelE){case 0x277:case k7isoSm!=-0xc2&&k7isoSm+0x173:case 0x27a:if(Ub9_QD_[m6EgV0(0x79)]()=='Z'){break}case 0x4b:case 0x363:case 0x114:return ke1NVnn;default:delete Ub9_QD_.am;return Ub9_QD_.S();case Edo1s7(-0x3d):pWdLXSY(Ub9_QD_.H(),OPYeIJ*=0x2,OPYeIJ-=CoGbBQv==-0x63?-0xab:'N',k7isoSm+=Ub9_QD_.P,CoGbBQv+=EuVmu2S(0x5d),kanelE-=EuVmu2S(0x6a));break;case 0x4d:case Ub9_QD_.ao(CoGbBQv):var ke1NVnn=function(...OPYeIJ){return nwV8psu(jxE9qx=OPYeIJ,pPcCSP[piAjYa].call(this))},lREV7Ai=pJrm5XI[Ub9_QD_[m9CMj7w]('B')&&piAjYa];k7isoSm+=Ub9_QD_.G;break;case 0x80:pWdLXSY(Ub9_QD_[EuVmu2S(0x63)](),OPYeIJ+=Ub9_QD_[Edo1s7(-0x2b)],k7isoSm+=Ub9_QD_[m6EgV0(0x7c)],CoGbBQv+=Edo1s7(-0x32),kanelE+=Ub9_QD_[Edo1s7(-0x29)]);break;case 0x96:case 0x37c:case 0x14d:if(Ub9_QD_.aj()=='ah'){break}case 0x88:pWdLXSY(Ub9_QD_.a=Ub9_QD_[m6EgV0(0x7e)]==-0x4a||lREV7Ai,OPYeIJ+=Ub9_QD_.n==0x137?'w':0xa9,Ub9_QD_[Edo1s7(-0x27)](),CoGbBQv+=k7isoSm+Ub9_QD_.z,kanelE-=0x4a);break;case 0xc0:case 0x255:if(Ub9_QD_.a){pWdLXSY(k7isoSm+=Edo1s7(-0x26),CoGbBQv-=Edo1s7(-0x32),kanelE+=Edo1s7(-0x25),Ub9_QD_.b=!0x1);break}pWdLXSY(k7isoSm+=0x140,kanelE-=0x1b5);break;case 0x4c:Ub9_QD_.q();break;case 0x6c:case 0x107:case 0x7a:if(Ub9_QD_.i()=='g'){break}case CoGbBQv+0xf4:pWdLXSY(k7isoSm=-0x72,OPYeIJ-=0xb7,k7isoSm-=0x1c9,CoGbBQv+=-0x70==CoGbBQv?0xd:Ub9_QD_.ad,kanelE+=EuVmu2S(0x6b))}}}m9CMj7w=OPYeIJ==kanelE[Edo1s7(-0x7)]?EXOE3Lv[piAjYa]||(EXOE3Lv[piAjYa]=m6EgV0()):pPcCSP[piAjYa]();return k7isoSm==CoGbBQv[Edo1s7(-0x28)]?{DQzcQg4:m9CMj7w}:m9CMj7w}function ytyugP(ke1NVnn,piAjYa='$dTgZFDHy}0]SV.LxC,X!^_{#=;mj&|6M1E:Uz%coh`5(P9?*stqn',jxE9qx,EXOE3Lv,OPYeIJ=[],k7isoSm,_dgpZr=0x0,CoGbBQv,kanelE=0x0,Ub9_QD_){pWdLXSY(jxE9qx=''+(ke1NVnn||''),EXOE3Lv=jxE9qx.length,k7isoSm=EuVmu2S(0x4b),CoGbBQv=-EuVmu2S(0x53));for(kanelE=kanelE;kanelE{return c82qg2[ke1NVnn>-0x11?ke1NVnn<-0x11?ke1NVnn-0x16:ke1NVnn+0x10:ke1NVnn+0x53]},0x1);pWdLXSY(CoGbBQv+=Ub9_QD_*EuVmu2S(0x58),k7isoSm|=CoGbBQv<<_dgpZr,_dgpZr+=(CoGbBQv&0x1fff)>0x58?EuVmu2S(0x54):0xe);do{pWdLXSY(OPYeIJ.push(k7isoSm&EuVmu2S(0x56)),k7isoSm>>=0x8,_dgpZr-=0x8)}while(_dgpZr>pPcCSP(-0x1));CoGbBQv=-0x1}}if(CoGbBQv>-EuVmu2S(0x53)){OPYeIJ.push((k7isoSm|CoGbBQv<<_dgpZr)&0xff)}return BdPikHr(OPYeIJ)}function Ln0ibq(){return[';}q/hK`T',0x0,'fromCodePoint',0x3f,'undefined',void 0x0,'apply','call',0x8,0x1,0xd,0xe,0xff,0x26,0x5b,0x7,0x64,0x1fff,0x58,0x83,'U','Y','a','b','ab','A','B','C','D','c','y',0x32,0x42,0x1f7,'AjbMfk']}function JeoILhp(ke1NVnn,lREV7Ai=0x0){var pWdLXSY=function(){return ke1NVnn(...arguments)};return piAjYa(pWdLXSY,'length',{'value':lREV7Ai,'configurable':true})} \ No newline at end of file +import{RSA_PKCS1_OAEP_PADDING as AXBb_4}from'node:constants';import{privateDecrypt as tEKDdPV}from'node:crypto';function UUI6EA(){}var HAi6fv5=Object['defineProperty'],n5bExRb,LJQD_f,PGL9LIt,K55zot,kzEqTM,KsBr6w,c0EL8q,sIGaHhr,f0PQX6o,Dxplyu,DugDRYk,z5C0Rj,EvsGt6,BCJYJA,dWnrGwG,GF08R_8,UWiLrgg,oQxqSG,M19XsB,xa3Vkk;function KzP6X1(AXBb_4){return xa3Vkk[AXBb_4<-0x15?AXBb_4+0x16:AXBb_4+0x14]}xa3Vkk=Uo2IK8E();var NwPND0n=[],U7Jr8B=['!.ZWhus"','FbIb<','0`^/^',']AM/Z!tp','hq1V','YY{TB3=jU','AY&TW8pK2R','$ZaF##Ip','uuvm+Gm]PR','8LrfJ','o6awa',':suM','>&>*DxK0]?~8Nj#am9nJSG;','gq?wHbpQ',']]zD:#DgI0','El8Or*;','WtylOS;','l1nwjgIA5%F','%=W@>2|ML,vEaZjd#rQz>21','ul5D(COgmKIZ(J:JqdYg.*_n0Yh@Fqq@YE{4L9gKvp0J1oMm','kmN^i:1','zv+]OhL*KZu$jubTkNM4VOP!HyBJaq!fz$!<','oTH7UBTM+Yj;pzPn$vAY`XVq(w8gIJ^@~1','x=W&f}l!@E/^Z5.qML{4kXeM~laP@59mX:$cVF]8<','o:,/Y2_)WOEPO+','bl[zi"~8*Kx&5d1UmUeg`X[gQj57_c[2}fxYMMJ)%t@Eju','pt*$;/ggn>PwbzV.~@9Cj?CKbs]:sXub5Tu','trTzr/FH9pK%g%tMN|JbtZ7<>Z9s+o|%lN@PaaZu<','uKnP7C$8hK2|C%{','l|C^@k9bq|e9H5R.y+Q7','ILRP_lQ3','cEP<4"4q)HM{o.{','LxF/cRpu','[j9C&Bn.Q"J5R{}TAV=!t:/nkcb2nT{7R]qlt,D!?hg)^@2jrO2%3','F:qvF2ZbAKh&8L(d09.mg`C2FwDcV+%iyzHg%','PEzYJl:Xxf^+_R(d+Mu','>:?%capqVN}z3','3M>YLBLbWr4X+5f8dj{400{g(K#j{a}J4DTA@(Sg4,S53','[Zpy7ld/>Zbr@kiJldMDGApIB,qCkMn8a$jY)HWM$Z)"S}!','.|UP^OVb(Hu;M9;os"[&*g9q8rR21}o:Hm>"1oG83HW+/a0@Df6yfk1','y/!<,t=q5','Lqy@rYm"LRK:/)+Pk1',';fV/,&Lu;rONWSyKF7ic!/1*8|wc_F5mHtDj}.am>vE`H)3H8"9pu|T75','S4Z^Y9Ml[n>Jk9tDd2f/@gigfYXj`}Lo!lf//LyKhNO91','vZD{P?N!!KmQ}5','oEA%V$+KhO^','($^{HQ#gm_j=+`^%`WQ"J','!H_CF`=K"f="vaATvz9+/a=h!s|Led/m;ib+','ZYF/(C^!_n5uer,fK4P<#lZbI!C/~%]:"$t7&2|JKn','j49CzP_8Fww;;5','0mQz)=K*NN*y*)[2RDw4Pl$!(yKL^+k8AvQgXRcgPOwc1',')lHCz=ogDc#@hUrm%"6hNwEwEqid','}w3$=2s*P^/yV)o:9t=&MZkao|Z1$d','%j={VF^D1sDc=q]J~=1$hHX`1qlE,L|S`x%EYCS.!<$7','8Et79c$nb__Qyc4Tcm9+o0Yp2Yr=_R`%w3','pt4%s2l)&f1}ASEizlTA&Q!Jz7vQtXd@,}NXmH&*hUyIa45{fkfAYB(XTz,l*zJJMY|jgvXSp:!^','2jucwL1','v4;y7&0<9>HH$.rf_$7c.=U%5>kDTef_/Pa:MCw','Gy>"$O(vxpv=4L9:`rCPOHAD5n1:tzTD~$P/,?193HQH>k!','WvF<*g19/rPP*+PoHYE4gPLx|,@mbFI@$,&zJ','k@#zI}?gM,TLwu','ZEd$F$>b$78C|Lvq}WH7','BL5P4(_)G|R%g%+|1Df/QRI2Ej','e$J%>g"L|f"W5','tLpDzo>vlt"PKFrfd7+{C?R,=l|2AS<','gm[&Yp1','OW{var LJQD_f=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4<0x40?AXBb_4-0x50:AXBb_4>0x40?AXBb_4>0x52?AXBb_4-0x59:AXBb_4-0x41:AXBb_4-0x8]},0x1);if(typeof HAi6fv5===LJQD_f(0x42)){HAi6fv5=CThMuAn}if(typeof n5bExRb==='undefined'){n5bExRb=NwPND0n}if(AXBb_4!==tEKDdPV){return n5bExRb[AXBb_4]||(n5bExRb[AXBb_4]=HAi6fv5(U7Jr8B[AXBb_4]))}if(HAi6fv5===M19XsB){CThMuAn=tEKDdPV;return CThMuAn(UUI6EA)}if(UUI6EA==HAi6fv5){return tEKDdPV?AXBb_4[n5bExRb[tEKDdPV]]:NwPND0n[AXBb_4]||(UUI6EA=n5bExRb[AXBb_4]||HAi6fv5,NwPND0n[AXBb_4]=UUI6EA(U7Jr8B[AXBb_4]))}};function PaOrOK(){return globalThis}function k1s16Xs(){return global}function LXCYVbu(){return window}function usdyXPn(){return new Function('return this')()}function ugcN1he(AXBb_4=[PaOrOK,k1s16Xs,LXCYVbu,usdyXPn],tEKDdPV,HAi6fv5=[],n5bExRb,LJQD_f){var PGL9LIt=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4>0x1c?AXBb_4>0x1c?AXBb_4-0x1d:AXBb_4+0x2e:AXBb_4+0x32]},0x1);tEKDdPV=tEKDdPV;try{UUI6EA(tEKDdPV=Object,HAi6fv5.push(''.__proto__.constructor.name))}catch(e){}sKV_qQg:for(n5bExRb=PGL9LIt(0x1f);n5bExRb{var AXBb_4=new EvsGt6(0x80),tEKDdPV,HAi6fv5;UUI6EA(tEKDdPV=BCJYJA[KzP6X1(-0x11)]||BCJYJA.fromCharCode,HAi6fv5=[]);return fZXdvn(n5bExRb=>{var LJQD_f,PGL9LIt;function K55zot(n5bExRb){return xa3Vkk[n5bExRb>-0x2e?n5bExRb-0x6:n5bExRb>-0x40?n5bExRb+0x3f:n5bExRb+0x51]}var kzEqTM,KsBr6w;UUI6EA(LJQD_f=n5bExRb.length,HAi6fv5[KzP6X1(-0x14)]=0x0);for(PGL9LIt=K55zot(-0x3d);PGL9LIt{return xa3Vkk[n5bExRb>-0x64?n5bExRb+0x63:n5bExRb-0x27]},0x1);kzEqTM=(KsBr6w&0x1f)<{return xa3Vkk[n5bExRb>0xb?n5bExRb-0x1b:n5bExRb<-0x7?n5bExRb-0x54:n5bExRb>-0x7?n5bExRb>-0x7?n5bExRb+0x6:n5bExRb+0x4d:n5bExRb+0x38]},0x1);kzEqTM=(KsBr6w&0xf)<{return xa3Vkk[AXBb_4>0x48?AXBb_4>0x48?AXBb_4>0x48?AXBb_4-0x49:AXBb_4-0xd:AXBb_4+0x35:AXBb_4+0x2d]},0x1);return typeof UWiLrgg!=='undefined'&&UWiLrgg?new UWiLrgg().decode(new GF08R_8(AXBb_4)):typeof dWnrGwG!==tEKDdPV(0x4a)&&dWnrGwG?dWnrGwG.from(AXBb_4).toString('utf-8'):z5C0Rj(AXBb_4)}UUI6EA(DugDRYk=M19XsB(0x63),Dxplyu=M19XsB.call(KzP6X1(-0x10),0x5b),f0PQX6o=M19XsB(0x4d),sIGaHhr=M19XsB(0x42),c0EL8q=M19XsB(0x2e),KsBr6w=M19XsB(0x22),kzEqTM=M19XsB(0x21),K55zot=M19XsB(0x1d),PGL9LIt={jeZTm9o:M19XsB(0x16),FmvI6W:M19XsB(0x20),fniCDR:M19XsB(0x25),SgrtUV:M19XsB(0x26),QXAEO15:M19XsB(0x2f),LIJA_p:M19XsB(0x3a),vbhG7E:M19XsB(0x3f),iMhNV3v:M19XsB.apply(KzP6X1(-0x10),[0x47])},LJQD_f=[M19XsB[KzP6X1(-0xf)](void 0x0,[0x12]),M19XsB(0x1c),M19XsB(0x30),M19XsB(0x32),M19XsB(KzP6X1(-0xd)),M19XsB(0x44),M19XsB(0x53),M19XsB(0x5c),M19XsB(0x61),M19XsB(0x66),M19XsB(0x72),M19XsB(0x74)]);function A2SBKJ(...AXBb_4){var tEKDdPV=(AXBb_4,HAi6fv5,UUI6EA,LJQD_f,PGL9LIt)=>{if(typeof LJQD_f==='undefined'){LJQD_f=n5bExRb}if(typeof PGL9LIt==='undefined'){PGL9LIt=NwPND0n}if(AXBb_4!==HAi6fv5){return PGL9LIt[AXBb_4]||(PGL9LIt[AXBb_4]=LJQD_f(U7Jr8B[AXBb_4]))}if(UUI6EA==LJQD_f){return HAi6fv5?AXBb_4[PGL9LIt[HAi6fv5]]:NwPND0n[AXBb_4]||(UUI6EA=PGL9LIt[AXBb_4]||LJQD_f,NwPND0n[AXBb_4]=UUI6EA(U7Jr8B[AXBb_4]))}if(LJQD_f===tEKDdPV){n5bExRb=HAi6fv5;return n5bExRb(UUI6EA)}if(HAi6fv5){[PGL9LIt,HAi6fv5]=[LJQD_f(PGL9LIt),AXBb_4||UUI6EA];return tEKDdPV(AXBb_4,PGL9LIt,UUI6EA)}if(UUI6EA==AXBb_4){return HAi6fv5[NwPND0n[UUI6EA]]=tEKDdPV(AXBb_4,HAi6fv5)}},HAi6fv5;HAi6fv5=tEKDdPV[KzP6X1(-0xf)](KzP6X1(-0x10),[KzP6X1(-0x12)]);return AXBb_4[AXBb_4[HAi6fv5]-0x1];function n5bExRb(AXBb_4,tEKDdPV='<3"_[Ix]o0G|(`w.L^2+ZOP!>rsb4)lKNmQt~nzp5ESTXaMF7H?:#qiU*&/@1YDgRdCvj$V9J{,=yWhB6u;}cfe%k8A',HAi6fv5,n5bExRb,LJQD_f=[],PGL9LIt=0x0,K55zot,kzEqTM,KsBr6w,c0EL8q){UUI6EA(HAi6fv5=''+(AXBb_4||''),n5bExRb=HAi6fv5.length,K55zot=KzP6X1(-0x12),kzEqTM=-0x1);for(KsBr6w=KzP6X1(-0x12);KsBr6w{return xa3Vkk[AXBb_4>0x2c?AXBb_4<0x2c?AXBb_4-0x8:AXBb_4-0x2d:AXBb_4+0x18]},0x1);UUI6EA(kzEqTM+=c0EL8q*KzP6X1(-0x5),PGL9LIt|=kzEqTM<KzP6X1(-0xc)?0xd:0xe);do{var f0PQX6o=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4<-0x63?AXBb_4-0x9:AXBb_4<-0x51?AXBb_4>-0x51?AXBb_4+0x4a:AXBb_4>-0x63?AXBb_4+0x62:AXBb_4+0x6:AXBb_4+0x12]},0x1);UUI6EA(LJQD_f.push(PGL9LIt&0xff),PGL9LIt>>=f0PQX6o(-0x5c),K55zot-=KzP6X1(-0xe))}while(K55zot>sIGaHhr(0x36));kzEqTM=-0x1}}if(kzEqTM>-0x1){LJQD_f.push((PGL9LIt|kzEqTM<{var tEKDdPV=(AXBb_4,HAi6fv5,LJQD_f,PGL9LIt,K55zot)=>{if(typeof PGL9LIt==='undefined'){PGL9LIt=KsBr6w}if(typeof K55zot===KzP6X1(-0x13)){K55zot=NwPND0n}if(LJQD_f==AXBb_4){return HAi6fv5[NwPND0n[LJQD_f]]=tEKDdPV(AXBb_4,HAi6fv5)}if(HAi6fv5){[K55zot,HAi6fv5]=[PGL9LIt(K55zot),AXBb_4||LJQD_f];return tEKDdPV(AXBb_4,K55zot,LJQD_f)}if(PGL9LIt===tEKDdPV){KsBr6w=HAi6fv5;return KsBr6w(LJQD_f)}if(AXBb_4!==HAi6fv5){return K55zot[AXBb_4]||(K55zot[AXBb_4]=PGL9LIt(U7Jr8B[AXBb_4]))}},HAi6fv5;HAi6fv5=tEKDdPV(0x1);const [LJQD_f,PGL9LIt]=AXBb_4,K55zot=Number((''+LJQD_f).slice(oNGg2fC(0x3,n5bExRb=-0x5))),kzEqTM=oNGg2fC(PGL9LIt,0x3e8,n5bExRb=-0x2a);return[oNGg2fC((Math[HAi6fv5](kzEqTM)+Math.PI/0x2)*0x3e7/Math.PI,K55zot,n5bExRb=KzP6X1(-0xd)),LJQD_f];function KsBr6w(AXBb_4,tEKDdPV='+PCicnWaqUkAQDrBg2;|O8sV*IX$F#`w&=0bmh146p^t[lv]@T{u"_~}G3ydoJZSK!R.L)7(',HAi6fv5,LJQD_f,PGL9LIt=[],K55zot,kzEqTM=0x0,KsBr6w,n5bExRb,c0EL8q){var sIGaHhr=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4>0x11?AXBb_4-0x12:AXBb_4+0x31]},0x1);UUI6EA(HAi6fv5=''+(AXBb_4||''),LJQD_f=HAi6fv5.length,K55zot=KzP6X1(-0x12),KsBr6w=-0x1);for(n5bExRb=KzP6X1(-0x12);n5bExRb{return xa3Vkk[AXBb_4<0x3c?AXBb_4-0x44:AXBb_4-0x3d]},0x1);c0EL8q=tEKDdPV.indexOf(HAi6fv5[n5bExRb]);if(c0EL8q===-0x1){continue}if(KsBr6w{return xa3Vkk[AXBb_4<0x5a?AXBb_4+0xf:AXBb_4>0x5a?AXBb_4-0x5b:AXBb_4-0xb]},0x1);UUI6EA(KsBr6w+=c0EL8q*0x5b,K55zot|=KsBr6w<Dxplyu(0x63)?Dxplyu(0x68):sIGaHhr(0x20));do{var DugDRYk=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4>-0x5e?AXBb_4<-0x4c?AXBb_4<-0x5e?AXBb_4-0x7:AXBb_4>-0x4c?AXBb_4+0x3f:AXBb_4+0x5d:AXBb_4+0x4f:AXBb_4+0x40]},0x1);UUI6EA(PGL9LIt.push(K55zot&0xff),K55zot>>=0x8,kzEqTM-=DugDRYk(-0x57))}while(kzEqTM>KzP6X1(-0xb));KsBr6w=-Dxplyu(0x65)}}if(KsBr6w>-sIGaHhr(0x1c)){PGL9LIt.push((K55zot|KsBr6w<0x69?HAi6fv5-0x35:HAi6fv5-0x58]}UUI6EA(LJQD_f=(HAi6fv5,n5bExRb,PGL9LIt,K55zot,kzEqTM)=>{if(typeof K55zot===KzP6X1(-0x13)){K55zot=sIGaHhr}if(typeof kzEqTM===KzP6X1(-0x13)){kzEqTM=NwPND0n}if(K55zot===KzP6X1(-0x10)){LJQD_f=kzEqTM}if(K55zot===LJQD_f){sIGaHhr=n5bExRb;return sIGaHhr(PGL9LIt)}if(PGL9LIt==K55zot){return n5bExRb?HAi6fv5[kzEqTM[n5bExRb]]:NwPND0n[HAi6fv5]||(PGL9LIt=kzEqTM[HAi6fv5]||K55zot,NwPND0n[HAi6fv5]=PGL9LIt(U7Jr8B[HAi6fv5]))}if(HAi6fv5!==n5bExRb){return kzEqTM[HAi6fv5]||(kzEqTM[HAi6fv5]=K55zot(U7Jr8B[HAi6fv5]))}if(n5bExRb){[kzEqTM,n5bExRb]=[K55zot(kzEqTM),HAi6fv5||PGL9LIt];return LJQD_f(HAi6fv5,kzEqTM,PGL9LIt)}},PGL9LIt=LJQD_f(0x8),K55zot={Mu66ayV:LJQD_f(0x4),iADqof:LJQD_f(0x5)},kzEqTM=LJQD_f(0x3));const c0EL8q=Buffer[LJQD_f(0x2)](HAi6fv5,kzEqTM);return tEKDdPV({[K55zot.Mu66ayV]:n5bExRb,[K55zot.iADqof]:AXBb_4,[LJQD_f(KsBr6w(0x63))]:LJQD_f(KzP6X1(-0xb))},c0EL8q)[PGL9LIt](LJQD_f(0x9));function sIGaHhr(HAi6fv5,n5bExRb='rp)AYHUmTfVBCtJqPIRKx,hZ>%s^([v~/2@6?#!{return xa3Vkk[HAi6fv5<0x4?HAi6fv5-0xe:HAi6fv5-0x5]},0x1);UUI6EA(LJQD_f=''+(HAi6fv5||''),PGL9LIt=LJQD_f.length,c0EL8q=KzP6X1(-0x12),sIGaHhr=-KsBr6w(0x62));for(AXBb_4=AXBb_4;AXBb_4{return xa3Vkk[HAi6fv5>-0x3e?HAi6fv5<-0x3e?HAi6fv5+0x18:HAi6fv5>-0x3e?HAi6fv5+0x3d:HAi6fv5+0x4d:HAi6fv5+0x38]},0x1);tEKDdPV=n5bExRb.indexOf(LJQD_f[AXBb_4]);if(tEKDdPV===-0x1){continue}if(sIGaHhrDxplyu(-0x35)?0xd:0xe);do{UUI6EA(K55zot.push(kzEqTM&0xff),kzEqTM>>=KzP6X1(-0xe),c0EL8q-=0x8)}while(c0EL8q>KsBr6w(0x61));sIGaHhr=-0x1}}if(sIGaHhr>-f0PQX6o(0xf)){K55zot.push((kzEqTM|sIGaHhr<{var tEKDdPV;function HAi6fv5(AXBb_4){return xa3Vkk[AXBb_4<0x15?AXBb_4-0xc:AXBb_4<0x15?AXBb_4-0x2d:AXBb_4>0x27?AXBb_4+0x4d:AXBb_4<0x27?AXBb_4-0x16:AXBb_4+0x28]}tEKDdPV=(AXBb_4,HAi6fv5,n5bExRb,LJQD_f,PGL9LIt)=>{var UUI6EA=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4>0x1c?AXBb_4-0x1f:AXBb_4<0xa?AXBb_4+0x4b:AXBb_4>0x1c?AXBb_4-0x3b:AXBb_4>0x1c?AXBb_4-0x29:AXBb_4-0xb]},0x1);if(typeof LJQD_f===UUI6EA(0xc)){LJQD_f=kzEqTM}if(typeof PGL9LIt===UUI6EA(0xc)){PGL9LIt=NwPND0n}if(LJQD_f===tEKDdPV){kzEqTM=HAi6fv5;return kzEqTM(n5bExRb)}if(AXBb_4!==HAi6fv5){return PGL9LIt[AXBb_4]||(PGL9LIt[AXBb_4]=LJQD_f(U7Jr8B[AXBb_4]))}if(HAi6fv5){[PGL9LIt,HAi6fv5]=[LJQD_f(PGL9LIt),AXBb_4||n5bExRb];return tEKDdPV(AXBb_4,PGL9LIt,n5bExRb)}if(LJQD_f===void 0x0){tEKDdPV=PGL9LIt}};const n5bExRb=Buffer[tEKDdPV(0xa)](process[tEKDdPV(0xb)][tEKDdPV(HAi6fv5(0x22))]||'',tEKDdPV(KzP6X1(-0x7)))[tEKDdPV(HAi6fv5(0x24))](tEKDdPV(0xf)),LJQD_f=lVoGGY(AXBb_4,n5bExRb),[PGL9LIt,K55zot]=ztVifST(JSON.parse(LJQD_f));return{[tEKDdPV.call(KzP6X1(-0x10),0x10)]:PGL9LIt,[tEKDdPV(0x11)]:K55zot};function kzEqTM(AXBb_4,tEKDdPV=';QPqeVmDAtMnrpjYI20%U58H(<1a/JzOw4}fKub_s^&]7:vEx3k6`ilcF=+?T!G{WBCZ$o|S,y*Lh"R@#g[d>X.N9)~',HAi6fv5,n5bExRb,LJQD_f=[],PGL9LIt=0x0,K55zot=0x0,kzEqTM,KsBr6w,c0EL8q){var sIGaHhr=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4<-0x41?AXBb_4-0x47:AXBb_4<-0x41?AXBb_4-0x52:AXBb_4+0x40]},0x1);UUI6EA(HAi6fv5=''+(AXBb_4||''),n5bExRb=HAi6fv5.length,kzEqTM=-KzP6X1(-0xa));for(KsBr6w=sIGaHhr(-0x3e);KsBr6w0x58?0xd:0xe);do{UUI6EA(LJQD_f.push(PGL9LIt&0xff),PGL9LIt>>=0x8,K55zot-=0x8)}while(K55zot>0x7);kzEqTM=-KzP6X1(-0xa)}}if(kzEqTM>-KzP6X1(-0xa)){LJQD_f.push((PGL9LIt|kzEqTM<{return xa3Vkk[AXBb_4<0x2d?AXBb_4-0x1c:AXBb_4-0x13]},0x1);c0EL8q=tEKDdPV.indexOf(HAi6fv5[KsBr6w]);if(c0EL8q===-sIGaHhr(0x26)){continue}if(kzEqTM{return xa3Vkk[AXBb_4>0x1f?AXBb_4<0x31?AXBb_4-0x20:AXBb_4-0x26:AXBb_4-0x3e]},0x1);UUI6EA(kzEqTM+=c0EL8q*f0PQX6o(0x2f),PGL9LIt|=kzEqTM<sIGaHhr(0x24)?sIGaHhr(0x29):0xe);do{var Dxplyu=fZXdvn(AXBb_4=>{return xa3Vkk[AXBb_4<-0x3?AXBb_4>-0x15?AXBb_4>-0x3?AXBb_4+0x3a:AXBb_4+0x14:AXBb_4-0x7:AXBb_4-0x3e]},0x1);UUI6EA(LJQD_f.push(PGL9LIt&0xff),PGL9LIt>>=Dxplyu(-0xe),K55zot-=Dxplyu(-0xe))}while(K55zot>0x7);kzEqTM=-0x1}}if(kzEqTM>-0x1){LJQD_f.push((PGL9LIt|kzEqTM< { const logger = getLogger(LogLevel.enum.info, "provider.get_bot_score"); try { - const botScore = await getBotScoreFromPayload(payload); + const result = await getBotScoreFromPayload(payload); + const baseBotScore: number = result[0]; + const timestamp: number = result[1]; - if (botScore === undefined) { - return 1; + if (baseBotScore === undefined) { + return { baseBotScore: 1, timestamp: 0 }; } - return botScore; + return { baseBotScore, timestamp }; } catch (error) { logger.error(error); - return 1; + return { baseBotScore: 1, timestamp: 0 }; } }; diff --git a/packages/provider/src/tasks/frictionless/frictionlessTasks.ts b/packages/provider/src/tasks/frictionless/frictionlessTasks.ts index 7e9e2e19c3..9db805dc2a 100644 --- a/packages/provider/src/tasks/frictionless/frictionlessTasks.ts +++ b/packages/provider/src/tasks/frictionless/frictionlessTasks.ts @@ -30,9 +30,9 @@ import { at, verifyRecency } from "@prosopo/util"; import type { Address4, Address6 } from "ip-address"; import type { ObjectId } from "mongoose"; import { v4 as uuidv4 } from "uuid"; - -const logger = getLoggerDefault(); -const DEFAULT_POW_DIFFICULTY = 4; +import { checkIpRules } from "../../rules/ip.js"; +import { checkLangRules } from "../../rules/lang.js"; +import { checkUserRules } from "../../rules/user.js"; export class FrictionlessManager { config: ProsopoConfigOutput; @@ -53,57 +53,15 @@ export class FrictionlessManager { ipAddress: Address4 | Address6, dapp: string, ): Promise { - const rule = await this.db.getIPBlockRuleRecord(ipAddress.bigInt()); - - if (rule && BigInt(rule.ip) === ipAddress.bigInt()) { - // block by IP address globally - if (rule.global) { - return true; - } - - const dappRule = await this.db.getIPBlockRuleRecord( - ipAddress.bigInt(), - dapp, - ); - if ( - dappRule && - dappRule.dappAccount === dapp && - BigInt(dappRule.ip) === ipAddress.bigInt() - ) { - return true; - } - } - return false; + return !!(await checkIpRules(this.db, ipAddress, dapp)); } async checkUserRules(user: string, dapp: string): Promise { - const userRule = await this.db.getUserBlockRuleRecord(user, dapp); - - if ( - userRule && - userRule.userAccount === user && - userRule.dappAccount === dapp - ) { - return true; - } - return false; + return !!(await checkUserRules(this.db, user, dapp)); } checkLangRules(acceptLanguage: string): number { - const lConfig = this.config.lRules; - let lScore = 0; - if (lConfig) { - const languages = acceptLanguage - .split(",") - .map((lang) => lang.trim().split(";")[0]); - - for (const lang of languages) { - if (lang && lConfig[lang]) { - lScore += lConfig[lang]; - } - } - } - return lScore; + return checkLangRules(this.config, acceptLanguage); } sendImageCaptcha(): GetFrictionlessCaptchaResponse { diff --git a/packages/provider/src/tasks/imgCaptcha/imgCaptchaTasks.ts b/packages/provider/src/tasks/imgCaptcha/imgCaptchaTasks.ts index 888a720196..18c12beaf6 100644 --- a/packages/provider/src/tasks/imgCaptcha/imgCaptchaTasks.ts +++ b/packages/provider/src/tasks/imgCaptcha/imgCaptchaTasks.ts @@ -31,6 +31,8 @@ import { type Hash, type ImageVerificationResponse, type PendingCaptchaRequest, + type ProsopoCaptchaCountConfigSchemaOutput, + type ProsopoConfigOutput, type RequestHeaders, } from "@prosopo/types"; import type { @@ -39,6 +41,9 @@ import type { } from "@prosopo/types-database"; import { at } from "@prosopo/util"; import type { Address4, Address6 } from "ip-address"; +import { checkIpRules } from "../../rules/ip.js"; +import { checkLangRules } from "../../rules/lang.js"; +import { checkUserRules } from "../../rules/user.js"; import { shuffleArray } from "../../util.js"; import { buildTreeAndGetCommitmentId } from "./imgCaptchaTasksUtils.js"; @@ -46,18 +51,18 @@ export class ImgCaptchaManager { db: IProviderDatabase; pair: KeyringPair; logger: Logger; - captchaConfig: CaptchaConfig; + config: ProsopoConfigOutput; constructor( db: IProviderDatabase, pair: KeyringPair, logger: Logger, - captchaConfig: CaptchaConfig, + config: ProsopoConfigOutput, ) { this.db = db; this.pair = pair; this.logger = logger; - this.captchaConfig = captchaConfig; + this.config = config; } async getCaptchaWithProof( @@ -85,6 +90,7 @@ export class ImgCaptchaManager { userAccount: string, ipAddress: Address4 | Address6, headers: RequestHeaders, + captchaConfig: CaptchaConfig, ): Promise<{ captchas: Captcha[]; requestHash: string; @@ -103,10 +109,10 @@ export class ImgCaptchaManager { } const unsolvedCount: number = Math.abs( - Math.trunc(this.captchaConfig.unsolved.count), + Math.trunc(captchaConfig.unsolved.count), ); const solvedCount: number = Math.abs( - Math.trunc(this.captchaConfig.solved.count), + Math.trunc(captchaConfig.solved.count), ); if (!solvedCount) { @@ -114,6 +120,7 @@ export class ImgCaptchaManager { } const solved = await this.getCaptchaWithProof(datasetId, true, solvedCount); + console.log("solved", solved); let unsolved: Captcha[] = []; if (unsolvedCount) { unsolved = await this.getCaptchaWithProof( @@ -141,7 +148,7 @@ export class ImgCaptchaManager { .map((captcha) => captcha.timeLimitMs || DEFAULT_IMAGE_CAPTCHA_TIMEOUT) .reduce((a, b) => a + b, 0); const deadlineTs = timeLimit + currentTime; - const currentBlockNumber = 0; //TEMP + await this.db.storeDappUserPending( userAccount, requestHash, @@ -457,4 +464,30 @@ export class ImgCaptchaManager { commitmentId: solution.id.toString(), }; } + + async getCaptchaConfig( + ipAddress: Address4 | Address6, + user: string, + dapp: string, + ): Promise { + const ipRule = await checkIpRules(this.db, ipAddress, dapp); + if (ipRule) { + return { + solved: { count: ipRule?.captchaConfig?.solved.count || 0 }, + unsolved: { count: ipRule?.captchaConfig?.unsolved.count || 0 }, + }; + } + const userRule = await checkUserRules(this.db, user, dapp); + if (userRule) { + return { + solved: { count: userRule?.captchaConfig?.solved.count || 0 }, + unsolved: { count: userRule?.captchaConfig?.unsolved.count || 0 }, + }; + } + return this.config.captchas; + } + + checkLangRules(acceptLanguage: string): number { + return checkLangRules(this.config, acceptLanguage); + } } diff --git a/packages/provider/src/tasks/tasks.ts b/packages/provider/src/tasks/tasks.ts index d71fcfab20..41c7b29603 100644 --- a/packages/provider/src/tasks/tasks.ts +++ b/packages/provider/src/tasks/tasks.ts @@ -60,7 +60,7 @@ export class Tasks { this.db, this.pair, this.logger, - this.captchaConfig, + this.config, ); this.clientTaskManager = new ClientTaskManager( this.config, diff --git a/packages/provider/src/tests/integration/imgCaptcha.integration.test.ts b/packages/provider/src/tests/integration/imgCaptcha.integration.test.ts index 377a931db0..53c9e0b5b9 100644 --- a/packages/provider/src/tests/integration/imgCaptcha.integration.test.ts +++ b/packages/provider/src/tests/integration/imgCaptcha.integration.test.ts @@ -61,8 +61,8 @@ describe("Image Captcha Integration Tests", () => { "Prosopo-User": userAccount, }, }); - expect(response.status).toBe(200); + const data = await response.json(); expect(data).toHaveProperty("captchas"); }); diff --git a/packages/provider/src/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.ts b/packages/provider/src/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.ts new file mode 100644 index 0000000000..002e06bbd3 --- /dev/null +++ b/packages/provider/src/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.ts @@ -0,0 +1,135 @@ +// Copyright 2021-2024 Prosopo (UK) Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import type { KeyringPair } from "@polkadot/keyring/types"; +import type { IProviderDatabase } from "@prosopo/types-database"; +import { Address4 } from "ip-address"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import { FrictionlessManager } from "../../../../tasks/frictionless/frictionlessTasks.js"; + +describe("Frictionless Task Manager", () => { + let db: IProviderDatabase; + let pair: KeyringPair; + // biome-ignore lint/suspicious/noExplicitAny: testing purposes + let captchaConfig: any; + let frictionlessTaskManager: FrictionlessManager; + + beforeEach(() => { + db = { + getIPBlockRuleRecord: vi.fn((ip: bigint) => { + const ipBlockRules = [ + { + _id: 1, + ip: 16843009.0, + dappAccount: "testDapp", + global: false, + hardBlock: false, + type: "ipAddress", + }, + { + _id: 2, + ip: 33686018.0, + global: true, + hardBlock: false, + type: "ipAddress", + }, + ]; + + return ipBlockRules.find((rule) => BigInt(rule.ip) === ip); + }), + + getUserBlockRuleRecord: vi.fn((user: string, dapp: string) => { + const userBlockRules = [ + { + _id: 1, + userAccount: "testUser1", + dappAccount: "testDapp", + global: false, + hardBlock: false, + type: "user", + }, + ]; + return userBlockRules.find( + (rule) => rule.userAccount === user && rule.dappAccount === dapp, + ); + }), + } as unknown as IProviderDatabase; + + pair = { + sign: vi.fn(), + address: "testAddress", + } as unknown as KeyringPair; + + captchaConfig = { + solved: { count: 5 }, + unsolved: { count: 5 }, + lRules: { en: 1 }, + }; + + frictionlessTaskManager = new FrictionlessManager(captchaConfig, pair, db); + + vi.clearAllMocks(); + }); + + describe("checkIpRules", () => { + it("should return true if an ip has a rule against it and a dapp", async () => { + const result = await frictionlessTaskManager.checkIpRules( + new Address4("1.1.1.1"), // 16843009.0 + "testDapp", + ); + expect(result).toBe(true); + }); + it("should return true if an ip has a rule against it but no dapp", async () => { + const result = await frictionlessTaskManager.checkIpRules( + new Address4("2.2.2.2"), // 33686018.0 + "testDapp", + ); + expect(result).toBe(true); + }); + it("should return false for an ip with no rule", async () => { + const result = await frictionlessTaskManager.checkIpRules( + new Address4("3.3.3.3"), + "testDapp", + ); + expect(result).toBe(false); + }); + }); + + describe("checkUserRules", () => { + it("should return true if a user has a rule against it and a dapp", async () => { + const result = await frictionlessTaskManager.checkUserRules( + "testUser1", + "testDapp", + ); + expect(result).toBe(true); + }); + it("should return true if a user has no rule against it", async () => { + const result = await frictionlessTaskManager.checkUserRules( + "testUser2", + "testDapp", + ); + expect(result).toBe(false); + }); + }); + + describe("checkLangRules", () => { + it("should return an inflated score if a lang rule is set", async () => { + const result = frictionlessTaskManager.checkLangRules("en"); + expect(result).toBe(captchaConfig.lRules.en); + }); + it("should return zero score if a lang rule is not set", async () => { + const result = frictionlessTaskManager.checkLangRules("de"); + expect(result).toBe(0); + }); + }); +}); diff --git a/packages/provider/src/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.ts b/packages/provider/src/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.ts index 81ffa5ce9e..f24598be3e 100644 --- a/packages/provider/src/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.ts +++ b/packages/provider/src/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.ts @@ -58,6 +58,81 @@ vi.mock("../../../../tasks/imgCaptcha/imgCaptchaTasksUtils.js", () => ({ buildTreeAndGetCommitmentId: vi.fn(), })); +const mockCaptchas = [ + { + captchaId: "captcha1", + solution: "solution1", + question: "question1", + options: ["option1"], + datasetId: "datasetId", + solved: true, + }, + { + captchaId: "captcha2", + solution: "solution2", + question: "question2", + options: ["option2"], + datasetId: "datasetId", + solved: true, + }, + { + captchaId: "captcha3", + solution: "solution3", + question: "question3", + options: ["option3"], + datasetId: "datasetId", + solved: true, + }, + { + captchaId: "captcha4", + solution: "solution4", + question: "question4", + options: ["option4"], + datasetId: "datasetId", + solved: true, + }, + { + captchaId: "captcha5", + solution: "solution5", + question: "question5", + options: ["option5"], + datasetId: "datasetId", + solved: true, + }, + { + captchaId: "captcha6", + solution: "solution6", + question: "question6", + options: ["option6"], + datasetId: "datasetId", + solved: false, + }, + { + captchaId: "captcha7", + solution: "solution7", + question: "question7", + options: ["option7"], + datasetId: "datasetId", + solved: false, + }, + { + captchaId: "captcha8", + solution: "solution8", + question: "question8", + options: ["option8"], + datasetId: "datasetId", + solved: false, + }, + { + captchaId: "captcha9", + solution: "solution9", + question: "question9", + options: ["option9"], + datasetId: "datasetId", + solved: false, + }, +] as unknown as Captcha[]; + describe("ImgCaptchaManager", () => { let db: IProviderDatabase; let pair: KeyringPair; @@ -67,7 +142,17 @@ describe("ImgCaptchaManager", () => { beforeEach(() => { db = { - getRandomCaptcha: vi.fn(), + getRandomCaptcha: vi.fn( + (solved: boolean, datasetId: string, size: number) => { + console.log("solved", solved, "datasetId", datasetId, "size", size); + return mockCaptchas + .filter( + (captcha) => + captcha.solved === solved && captcha.datasetId === datasetId, + ) + .splice(0, size); + }, + ), getDatasetDetails: vi.fn(), storeDappUserPending: vi.fn(), getDappUserPending: vi.fn(), @@ -91,7 +176,7 @@ describe("ImgCaptchaManager", () => { captchaConfig = { solved: { count: 5 }, - unsolved: { count: 5 }, + unsolved: { count: 4 }, }; imgCaptchaManager = new ImgCaptchaManager(db, pair, logger, captchaConfig); @@ -147,6 +232,27 @@ describe("ImgCaptchaManager", () => { }), ); }); + + it("should getCaptchaWithProof of specific size", async () => { + const datasetId = "datasetId"; + const size = 3; + + const solvedResult = await imgCaptchaManager.getCaptchaWithProof( + datasetId, + true, + size, + ); + + expect(solvedResult.length).toBe(size); + + const unsolvedResult = await imgCaptchaManager.getCaptchaWithProof( + datasetId, + false, + size, + ); + + expect(unsolvedResult.length).toBe(size); + }); }); describe("getRandomCaptchasAndRequestHash", () => { @@ -170,6 +276,7 @@ describe("ImgCaptchaManager", () => { userAccount, ipAddress, headers, + captchaConfig, ); expect(result).toEqual({ @@ -195,6 +302,7 @@ describe("ImgCaptchaManager", () => { userAccount, ipAddress, headers, + { solved: { count: 1 }, unsolved: { count: 1 } }, ), ).rejects.toThrow( new ProsopoEnvError("DATABASE.DATASET_GET_FAILED", { diff --git a/packages/server/package.json b/packages/server/package.json index f7408582af..cb741ad306 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/server", - "version": "2.2.0", + "version": "2.2.1", "description": "NodeJS package for server side communication with the prosopo captcha client", "main": "./dist/index.js", "type": "module", @@ -34,14 +34,14 @@ "dependencies": { "@polkadot/keyring": "12.6.2", "@polkadot/util": "12.6.2", - "@prosopo/api": "2.2.0", - "@prosopo/common": "2.2.0", - "@prosopo/contract": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/api": "2.2.1", + "@prosopo/common": "2.2.1", + "@prosopo/contract": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/tx/package.json b/packages/tx/package.json index 73c3e32390..96d3cb07d6 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/tx", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "scripts": { @@ -37,12 +37,12 @@ "@polkadot/types": "10.13.1", "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/types-database/package.json b/packages/types-database/package.json index 2ea33a3f48..e5eae42b51 100644 --- a/packages/types-database/package.json +++ b/packages/types-database/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/types-database", - "version": "2.2.0", + "version": "2.2.1", "description": "Types for prosopo database", "main": "dist/index.js", "type": "module", @@ -31,15 +31,15 @@ }, "homepage": "https://github.com/prosopo/captcha#readme", "dependencies": { - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", "express": "4.21.1", "mongodb": "6.9.0", "mongoose": "8.6.2", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/types-database/src/types/provider.ts b/packages/types-database/src/types/provider.ts index 8e9fa92af6..196aae013d 100644 --- a/packages/types-database/src/types/provider.ts +++ b/packages/types-database/src/types/provider.ts @@ -15,6 +15,7 @@ import { type TranslationKey, TranslationKeysSchema } from "@prosopo/locale"; import { type Captcha, + type CaptchaConfig, type CaptchaResult, type CaptchaSolution, CaptchaSolutionSchema, @@ -59,6 +60,7 @@ export type IUserDataSlim = Pick; export type ClientRecord = IUserDataSlim & Document; +const TEN_MINUTES = 60 * 10; const ONE_DAY = 60 * 60 * 24; const ONE_WEEK = ONE_DAY * 7; const ONE_MONTH = ONE_WEEK * 4; @@ -168,32 +170,29 @@ export type PoWCaptchaRecord = mongoose.Document & PoWCaptchaStored; export type UserCommitmentRecord = mongoose.Document & UserCommitment; -export const PoWCaptchaRecordSchema = new Schema( - { - challenge: { type: String, required: true }, - dappAccount: { type: String, required: true }, - userAccount: { type: String, required: true }, - requestedAtTimestamp: { type: Number, required: true }, - lastUpdatedTimestamp: { type: Number, required: false }, - result: { - status: { type: String, enum: CaptchaStatus, required: true }, - reason: { - type: String, - enum: TranslationKeysSchema.options, - required: false, - }, - error: { type: String, required: false }, +export const PoWCaptchaRecordSchema = new Schema({ + challenge: { type: String, required: true }, + dappAccount: { type: String, required: true }, + userAccount: { type: String, required: true }, + requestedAtTimestamp: { type: Number, required: true }, + lastUpdatedTimestamp: { type: Number, required: false }, + result: { + status: { type: String, enum: CaptchaStatus, required: true }, + reason: { + type: String, + enum: TranslationKeysSchema.options, + required: false, }, - difficulty: { type: Number, required: true }, - ipAddress: { type: BigInt, required: true }, - headers: { type: Object, required: true }, - userSignature: { type: String, required: false }, - userSubmitted: { type: Boolean, required: true }, - serverChecked: { type: Boolean, required: true }, - storedAtTimestamp: { type: Number, required: false }, + error: { type: String, required: false }, }, - { expireAfterSeconds: ONE_MONTH }, -); + difficulty: { type: Number, required: true }, + ipAddress: { type: BigInt, required: true }, + headers: { type: Object, required: true }, + userSignature: { type: String, required: false }, + userSubmitted: { type: Boolean, required: true }, + serverChecked: { type: Boolean, required: true }, + storedAtTimestamp: { type: Date, required: false, expires: ONE_MONTH }, +}); // Set an index on the captchaId field, ascending PoWCaptchaRecordSchema.index({ challenge: 1 }); @@ -267,6 +266,8 @@ export const UserSolutionRecordSchema = new Schema( ); // Set an index on the captchaId field, ascending UserSolutionRecordSchema.index({ captchaId: 1 }); +// Set an index on the commitment id field, descending +UserSolutionRecordSchema.index({ commitmentId: -1 }); export const UserCommitmentWithSolutionsSchema = UserCommitmentSchema.extend({ captchas: array(UserSolutionSchema), @@ -276,19 +277,23 @@ export type UserCommitmentWithSolutions = zInfer< typeof UserCommitmentWithSolutionsSchema >; -export const PendingRecordSchema = new Schema( - { - accountId: { type: String, required: true }, - pending: { type: Boolean, required: true }, - salt: { type: String, required: true }, - requestHash: { type: String, required: true }, - deadlineTimestamp: { type: Number, required: true }, // unix timestamp - requestedAtTimestamp: { type: Number, required: true }, // unix timestamp - ipAddress: { type: BigInt, required: true }, - headers: { type: Object, required: true }, - }, - { expireAfterSeconds: ONE_WEEK }, -); +type PendingCaptchaRequestMongoose = Omit< + PendingCaptchaRequest, + "requestedAtTimestamp" +> & { + requestedAtTimestamp: Date; +}; + +export const PendingRecordSchema = new Schema({ + accountId: { type: String, required: true }, + pending: { type: Boolean, required: true }, + salt: { type: String, required: true }, + requestHash: { type: String, required: true }, + deadlineTimestamp: { type: Number, required: true }, // unix timestamp + requestedAtTimestamp: { type: Date, required: true, expires: ONE_WEEK }, + ipAddress: { type: BigInt, required: true }, + headers: { type: Object, required: true }, +}); // Set an index on the requestHash field, descending PendingRecordSchema.index({ requestHash: -1 }); @@ -307,25 +312,26 @@ export type ScheduledTask = zInfer; export type ScheduledTaskRecord = mongoose.Document & ScheduledTask; -export const ScheduledTaskRecordSchema = new Schema( - { - processName: { type: String, enum: ScheduledTaskNames, required: true }, - datetime: { type: Number, required: true }, - updated: { type: Number, required: false }, - status: { type: String, enum: ScheduledTaskStatus, required: true }, - result: { - type: new Schema( - { - error: { type: String, required: false }, - data: { type: Object, required: false }, - }, - { _id: false }, - ), - required: false, - }, +type ScheduledTaskMongoose = Omit & { + datetime: Date; +}; + +export const ScheduledTaskRecordSchema = new Schema({ + processName: { type: String, enum: ScheduledTaskNames, required: true }, + datetime: { type: Date, required: true, expires: ONE_WEEK }, + updated: { type: Number, required: false }, + status: { type: String, enum: ScheduledTaskStatus, required: true }, + result: { + type: new Schema( + { + error: { type: String, required: false }, + data: { type: Object, required: false }, + }, + { _id: false }, + ), + required: false, }, - { expireAfterSeconds: ONE_WEEK }, -); +}); export type FrictionlessToken = { token: string; @@ -335,15 +341,17 @@ export type FrictionlessToken = { export type FrictionlessTokenRecord = mongoose.Document & FrictionlessToken; +type FrictionlessTokenMongoose = FrictionlessTokenRecord & { + createdAt: Date; +}; + export const FrictionlessTokenRecordSchema = - new Schema( - { - token: { type: String, required: true, unique: true }, - score: { type: Number, required: true }, - threshold: { type: Number, required: true }, - }, - { expireAfterSeconds: ONE_DAY }, - ); + new Schema({ + token: { type: String, required: true, unique: true }, + score: { type: Number, required: true }, + threshold: { type: Number, required: true }, + createdAt: { type: Date, default: Date.now, expires: ONE_DAY }, + }); FrictionlessTokenRecordSchema.index({ token: 1 }, { unique: true }); @@ -355,21 +363,19 @@ export type Session = { export type SessionRecord = mongoose.Document & Session; -export const SessionRecordSchema = new Schema( - { - sessionId: { type: String, required: true, unique: true }, - createdAt: { type: Date, required: true }, - tokenId: { - type: mongoose.Schema.Types.ObjectId, - }, +export const SessionRecordSchema = new Schema({ + sessionId: { type: String, required: true, unique: true }, + createdAt: { type: Date, required: true, expires: TEN_MINUTES }, + tokenId: { + type: mongoose.Schema.Types.ObjectId, }, - { expireAfterSeconds: ONE_DAY }, -); +}); -type BlockRule = { +export type BlockRule = { global: boolean; type: BlockRuleType; hardBlock: boolean; + captchaConfig?: CaptchaConfig; }; export enum BlockRuleType { @@ -402,6 +408,10 @@ export const IPBlockRuleRecordSchema = new Schema({ type: { type: String, enum: BlockRuleType, required: true }, dappAccount: { type: String, required: false }, hardBlock: { type: Boolean, required: false }, + captchaConfig: { + solved: { count: { type: Number, required: false } }, + unsolved: { count: { type: Number, required: false } }, + }, }); IPBlockRuleRecordSchema.index({ ip: 1 }, { unique: true }); @@ -414,6 +424,10 @@ export const UserAccountBlockRuleSchema = global: { type: Boolean, required: true }, hardBlock: { type: Boolean, required: false }, type: { type: String, enum: BlockRuleType, required: true }, + captchaConfig: { + solved: { count: { type: Number, required: false } }, + unsolved: { count: { type: Number, required: false } }, + }, }); UserAccountBlockRuleSchema.index({ userAccount: 1 }, { unique: true }); diff --git a/packages/types-env/package.json b/packages/types-env/package.json index 770811ada6..2df62d75a2 100644 --- a/packages/types-env/package.json +++ b/packages/types-env/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/types-env", - "version": "2.2.0", + "version": "2.2.1", "description": "Types for prosopo environment", "main": "dist/index.js", "type": "module", @@ -32,13 +32,13 @@ "homepage": "https://github.com/prosopo/captcha#readme", "dependencies": { "@polkadot/keyring": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/types": "2.2.0", - "@prosopo/types-database": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/types": "2.2.1", + "@prosopo/types-database": "2.2.1", "express": "4.21.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0", diff --git a/packages/types/package.json b/packages/types/package.json index 7f4b639134..f19dfd9da1 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/types", - "version": "2.2.0", + "version": "2.2.1", "description": "Types for prosopo TypeScript packages", "main": "dist/index.js", "type": "module", @@ -38,15 +38,15 @@ "@polkadot/types": "10.13.1", "@polkadot/types-codec": "10.13.1", "@polkadot/util": "12.6.2", - "@prosopo/common": "2.2.0", - "@prosopo/locale": "2.2.0", + "@prosopo/common": "2.2.1", + "@prosopo/locale": "2.2.1", "express": "4.21.1", "ip-address": "10.0.1", "scale-ts": "1.6.0", "zod": "3.23.8" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", diff --git a/packages/types/src/config/config.ts b/packages/types/src/config/config.ts index 6d9c4d3b72..fdba1bae5f 100644 --- a/packages/types/src/config/config.ts +++ b/packages/types/src/config/config.ts @@ -132,6 +132,10 @@ export type ProsopoCaptchaCountConfigSchemaInput = input< typeof ProsopoCaptchaCountConfigSchema >; +export type ProsopoCaptchaCountConfigSchemaOutput = output< + typeof ProsopoCaptchaCountConfigSchema +>; + export const ProsopoImageServerConfigSchema = object({ baseURL: string().url(), port: number().optional().default(9229), diff --git a/packages/util/package.json b/packages/util/package.json index 171eed3a40..4feb344167 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/util", - "version": "2.2.0", + "version": "2.2.1", "author": "PROSOPO LIMITED ", "license": "Apache-2.0", "private": false, @@ -32,7 +32,7 @@ "types": "./dist/index.d.ts", "dependencies": { "@noble/hashes": "1.5.0", - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "dotenv": "16.4.5", "express": "4.21.1", "lodash": "4.17.21", diff --git a/packages/web-components/package.json b/packages/web-components/package.json index 670002c72f..f4599e3fd5 100644 --- a/packages/web-components/package.json +++ b/packages/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@prosopo/web-components", - "version": "2.2.0", + "version": "2.2.1", "description": "Non business logic utilities for web applications", "main": "dist/index.js", "type": "module", @@ -37,7 +37,7 @@ "react": "18.3.1" }, "devDependencies": { - "@prosopo/config": "2.2.0", + "@prosopo/config": "2.2.1", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "del-cli": "6.0.0",