@prosopo/procaptcha-frictionless 2.6.28 → 2.6.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/ProcaptchaFrictionless.js +156 -91
- package/dist/cjs/detector/dist/index.cjs +2334 -0
- package/dist/cjs/detectorLoader.cjs +2 -23
- package/dist/customDetectBot.js +29 -22
- package/dist/detector/dist/index.js +2335 -0
- package/dist/detectorLoader.js +4 -2
- package/dist/index.js +4 -2
- package/package.json +18 -15
- package/vite.cjs.config.ts +2 -2
- package/vite.esm.config.ts +20 -0
- package/dist/ProcaptchaFrictionless.d.ts +0 -3
- package/dist/ProcaptchaFrictionless.d.ts.map +0 -1
- package/dist/ProcaptchaFrictionless.js.map +0 -1
- package/dist/customDetectBot.d.ts +0 -4
- package/dist/customDetectBot.d.ts.map +0 -1
- package/dist/customDetectBot.js.map +0 -1
- package/dist/detectorLoader.d.ts +0 -4
- package/dist/detectorLoader.d.ts.map +0 -1
- package/dist/detectorLoader.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const
|
|
3
|
+
const _interopNamespaceDefaultOnly = (e) => Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: "Module" }));
|
|
4
|
+
const DetectorLoader = async () => (await Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./detector/dist/index.cjs")))).default;
|
|
26
5
|
exports.DetectorLoader = DetectorLoader;
|
package/dist/customDetectBot.js
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import { ProviderApi } from "@prosopo/api";
|
|
2
2
|
import { ProsopoEnvError } from "@prosopo/common";
|
|
3
|
-
import { getRandomActiveProvider } from "@prosopo/procaptcha-common";
|
|
4
|
-
import { ExtensionLoader } from "@prosopo/procaptcha-common";
|
|
3
|
+
import { ExtensionLoader, getRandomActiveProvider } from "@prosopo/procaptcha-common";
|
|
5
4
|
import { DetectorLoader } from "./detectorLoader.js";
|
|
6
5
|
const customDetectBot = async (config) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
const detect = await DetectorLoader();
|
|
7
|
+
const botScore = await detect();
|
|
8
|
+
const ext = new (await ExtensionLoader(config.web2))();
|
|
9
|
+
const userAccount = await ext.getAccount(config);
|
|
10
|
+
if (!config.account.address) {
|
|
11
|
+
throw new ProsopoEnvError("GENERAL.SITE_KEY_MISSING");
|
|
12
|
+
}
|
|
13
|
+
const provider = await getRandomActiveProvider(config);
|
|
14
|
+
const providerApi = new ProviderApi(
|
|
15
|
+
provider.provider.url,
|
|
16
|
+
config.account.address
|
|
17
|
+
);
|
|
18
|
+
const captcha = await providerApi.getFrictionlessCaptcha(
|
|
19
|
+
botScore.token,
|
|
20
|
+
config.account.address,
|
|
21
|
+
userAccount.account.address
|
|
22
|
+
);
|
|
23
|
+
return {
|
|
24
|
+
captchaType: captcha.captchaType,
|
|
25
|
+
sessionId: captcha.sessionId,
|
|
26
|
+
provider,
|
|
27
|
+
status: captcha.status,
|
|
28
|
+
userAccount,
|
|
29
|
+
error: captcha.error
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
customDetectBot as default
|
|
25
34
|
};
|
|
26
|
-
export default customDetectBot;
|
|
27
|
-
//# sourceMappingURL=customDetectBot.js.map
|