@prosopo/procaptcha-common 0.3.3

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.
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const alertError = (error) => {
4
+ alert(error.message);
5
+ };
6
+ const getDefaultEvents = (stateUpdater, state, callbacks) => Object.assign(
7
+ {
8
+ onError: alertError,
9
+ onHuman: (output) => {
10
+ stateUpdater({ sendData: !state.sendData });
11
+ },
12
+ onExtensionNotFound: () => {
13
+ alert("No extension found");
14
+ },
15
+ onFailed: () => {
16
+ alert("Captcha challenge failed. Please try again");
17
+ stateUpdater({ sendData: !state.sendData });
18
+ },
19
+ onExpired: () => {
20
+ alert("Completed challenge has expired, please try again");
21
+ },
22
+ onChallengeExpired: () => {
23
+ alert("Uncompleted challenge has expired, please try again");
24
+ },
25
+ onOpen: () => {
26
+ console.info("captcha opened");
27
+ },
28
+ onClose: () => {
29
+ console.info("captcha closed");
30
+ }
31
+ },
32
+ callbacks
33
+ );
34
+ exports.getDefaultEvents = getDefaultEvents;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const events = require("./events.cjs");
4
+ const builder = require("./state/builder.cjs");
5
+ exports.getDefaultEvents = events.getDefaultEvents;
6
+ exports.buildUpdateState = builder.buildUpdateState;
7
+ exports.useProcaptcha = builder.useProcaptcha;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildUpdateState = (state, onStateUpdate) => (nextState) => {
4
+ Object.assign(state, nextState);
5
+ onStateUpdate(nextState);
6
+ };
7
+ const useRefAsState = (useRef, defaultValue) => {
8
+ const ref = useRef(defaultValue);
9
+ const setter = (value2) => {
10
+ ref.current = value2;
11
+ };
12
+ const value = ref.current;
13
+ return [value, setter];
14
+ };
15
+ const useProcaptcha = (useState, useRef) => {
16
+ const [isHuman, setIsHuman] = useState(false);
17
+ const [index, setIndex] = useState(0);
18
+ const [solutions, setSolutions] = useState([]);
19
+ const [captchaApi, setCaptchaApi] = useRefAsState(useRef, void 0);
20
+ const [showModal, setShowModal] = useState(false);
21
+ const [challenge, setChallenge] = useState(void 0);
22
+ const [loading, setLoading] = useState(false);
23
+ const [account, setAccount] = useState(void 0);
24
+ const [dappAccount, setDappAccount] = useState(void 0);
25
+ const [submission, setSubmission] = useRefAsState(useRef, void 0);
26
+ const [timeout, setTimeout] = useRefAsState(useRef, void 0);
27
+ const [blockNumber, setBlockNumber] = useRefAsState(useRef, void 0);
28
+ const [successfullChallengeTimeout, setSuccessfullChallengeTimeout] = useRefAsState(
29
+ useRef,
30
+ void 0
31
+ );
32
+ const [sendData, setSendData] = useState(false);
33
+ return [
34
+ // the state
35
+ {
36
+ isHuman,
37
+ index,
38
+ solutions,
39
+ captchaApi,
40
+ showModal,
41
+ challenge,
42
+ loading,
43
+ account,
44
+ dappAccount,
45
+ submission,
46
+ timeout,
47
+ blockNumber,
48
+ successfullChallengeTimeout,
49
+ sendData
50
+ },
51
+ // and method to update the state
52
+ (nextState) => {
53
+ if (nextState.account !== void 0)
54
+ setAccount(nextState.account);
55
+ if (nextState.isHuman !== void 0)
56
+ setIsHuman(nextState.isHuman);
57
+ if (nextState.index !== void 0)
58
+ setIndex(nextState.index);
59
+ if (nextState.solutions !== void 0)
60
+ setSolutions(nextState.solutions.slice());
61
+ if (nextState.captchaApi !== void 0)
62
+ setCaptchaApi(nextState.captchaApi);
63
+ if (nextState.showModal !== void 0)
64
+ setShowModal(nextState.showModal);
65
+ if (nextState.challenge !== void 0)
66
+ setChallenge(nextState.challenge);
67
+ if (nextState.loading !== void 0)
68
+ setLoading(nextState.loading);
69
+ if (nextState.showModal !== void 0)
70
+ setShowModal(nextState.showModal);
71
+ if (nextState.dappAccount !== void 0)
72
+ setDappAccount(nextState.dappAccount);
73
+ if (nextState.submission !== void 0)
74
+ setSubmission(nextState.submission);
75
+ if (nextState.timeout !== void 0)
76
+ setTimeout(nextState.timeout);
77
+ if (nextState.successfullChallengeTimeout !== void 0)
78
+ setSuccessfullChallengeTimeout(nextState.timeout);
79
+ if (nextState.blockNumber !== void 0)
80
+ setBlockNumber(nextState.blockNumber);
81
+ if (nextState.sendData !== void 0)
82
+ setSendData(nextState.sendData);
83
+ }
84
+ ];
85
+ };
86
+ exports.buildUpdateState = buildUpdateState;
87
+ exports.useProcaptcha = useProcaptcha;
@@ -0,0 +1,3 @@
1
+ import { ProcaptchaCallbacks, ProcaptchaEvents, ProcaptchaState, ProcaptchaStateUpdateFn } from '@prosopo/types';
2
+ export declare const getDefaultEvents: (stateUpdater: ProcaptchaStateUpdateFn, state: ProcaptchaState, callbacks: ProcaptchaCallbacks) => ProcaptchaEvents;
3
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAOhH,eAAO,MAAM,gBAAgB,iBACX,uBAAuB,SAC9B,eAAe,aACX,mBAAmB,KAC/B,gBA4BE,CAAA"}
package/dist/events.js ADDED
@@ -0,0 +1,29 @@
1
+ const alertError = (error) => {
2
+ alert(error.message);
3
+ };
4
+ export const getDefaultEvents = (stateUpdater, state, callbacks) => Object.assign({
5
+ onError: alertError,
6
+ onHuman: (output) => {
7
+ stateUpdater({ sendData: !state.sendData });
8
+ },
9
+ onExtensionNotFound: () => {
10
+ alert('No extension found');
11
+ },
12
+ onFailed: () => {
13
+ alert('Captcha challenge failed. Please try again');
14
+ stateUpdater({ sendData: !state.sendData });
15
+ },
16
+ onExpired: () => {
17
+ alert('Completed challenge has expired, please try again');
18
+ },
19
+ onChallengeExpired: () => {
20
+ alert('Uncompleted challenge has expired, please try again');
21
+ },
22
+ onOpen: () => {
23
+ console.info('captcha opened');
24
+ },
25
+ onClose: () => {
26
+ console.info('captcha closed');
27
+ },
28
+ }, callbacks);
29
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC5B,YAAqC,EACrC,KAAsB,EACtB,SAA8B,EACd,EAAE,CAClB,MAAM,CAAC,MAAM,CACT;IACI,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,CAAC,MAAmF,EAAE,EAAE;QAC7F,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,mBAAmB,EAAE,GAAG,EAAE;QACtB,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC/B,CAAC;IACD,QAAQ,EAAE,GAAG,EAAE;QACX,KAAK,CAAC,4CAA4C,CAAC,CAAA;QACnD,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,SAAS,EAAE,GAAG,EAAE;QACZ,KAAK,CAAC,mDAAmD,CAAC,CAAA;IAC9D,CAAC;IACD,kBAAkB,EAAE,GAAG,EAAE;QACrB,KAAK,CAAC,qDAAqD,CAAC,CAAA;IAChE,CAAC;IACD,MAAM,EAAE,GAAG,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAClC,CAAC;CACJ,EACD,SAAS,CACZ,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './events.js';
2
+ export * from './state/builder.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './events.js';
2
+ export * from './state/builder.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ProcaptchaState, ProcaptchaStateUpdateFn } from '@prosopo/types';
2
+ type useRefType = <T>(defaultValue: T) => {
3
+ current: T;
4
+ };
5
+ type useStateType = <T>(defaultValue: T) => [T, (value: T) => void];
6
+ export declare const buildUpdateState: (state: ProcaptchaState, onStateUpdate: ProcaptchaStateUpdateFn) => (nextState: Partial<ProcaptchaState>) => void;
7
+ export declare const useProcaptcha: (useState: useStateType, useRef: useRefType) => [ProcaptchaState, ProcaptchaStateUpdateFn];
8
+ export {};
9
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/state/builder.ts"],"names":[],"mappings":"AAaA,OAAO,EAGH,eAAe,EACf,uBAAuB,EAG1B,MAAM,gBAAgB,CAAA;AAEvB,KAAK,UAAU,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,KAAK;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAA;AACxD,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;AAEnE,eAAO,MAAM,gBAAgB,UACjB,eAAe,iBAAiB,uBAAuB,iBAAiB,QAAQ,eAAe,CAAC,SAMvG,CAAA;AAiBL,eAAO,MAAM,aAAa,aACZ,YAAY,UACd,UAAU,KACnB,CAAC,eAAe,EAAE,uBAAuB,CAyD3C,CAAA"}
@@ -0,0 +1,79 @@
1
+ export const buildUpdateState = (state, onStateUpdate) => (nextState) => {
2
+ Object.assign(state, nextState);
3
+ onStateUpdate(nextState);
4
+ };
5
+ const useRefAsState = (useRef, defaultValue) => {
6
+ const ref = useRef(defaultValue);
7
+ const setter = (value) => {
8
+ ref.current = value;
9
+ };
10
+ const value = ref.current;
11
+ return [value, setter];
12
+ };
13
+ export const useProcaptcha = (useState, useRef) => {
14
+ const [isHuman, setIsHuman] = useState(false);
15
+ const [index, setIndex] = useState(0);
16
+ const [solutions, setSolutions] = useState([]);
17
+ const [captchaApi, setCaptchaApi] = useRefAsState(useRef, undefined);
18
+ const [showModal, setShowModal] = useState(false);
19
+ const [challenge, setChallenge] = useState(undefined);
20
+ const [loading, setLoading] = useState(false);
21
+ const [account, setAccount] = useState(undefined);
22
+ const [dappAccount, setDappAccount] = useState(undefined);
23
+ const [submission, setSubmission] = useRefAsState(useRef, undefined);
24
+ const [timeout, setTimeout] = useRefAsState(useRef, undefined);
25
+ const [blockNumber, setBlockNumber] = useRefAsState(useRef, undefined);
26
+ const [successfullChallengeTimeout, setSuccessfullChallengeTimeout] = useRefAsState(useRef, undefined);
27
+ const [sendData, setSendData] = useState(false);
28
+ return [
29
+ {
30
+ isHuman,
31
+ index,
32
+ solutions,
33
+ captchaApi,
34
+ showModal,
35
+ challenge,
36
+ loading,
37
+ account,
38
+ dappAccount,
39
+ submission,
40
+ timeout,
41
+ blockNumber,
42
+ successfullChallengeTimeout,
43
+ sendData,
44
+ },
45
+ (nextState) => {
46
+ if (nextState.account !== undefined)
47
+ setAccount(nextState.account);
48
+ if (nextState.isHuman !== undefined)
49
+ setIsHuman(nextState.isHuman);
50
+ if (nextState.index !== undefined)
51
+ setIndex(nextState.index);
52
+ if (nextState.solutions !== undefined)
53
+ setSolutions(nextState.solutions.slice());
54
+ if (nextState.captchaApi !== undefined)
55
+ setCaptchaApi(nextState.captchaApi);
56
+ if (nextState.showModal !== undefined)
57
+ setShowModal(nextState.showModal);
58
+ if (nextState.challenge !== undefined)
59
+ setChallenge(nextState.challenge);
60
+ if (nextState.loading !== undefined)
61
+ setLoading(nextState.loading);
62
+ if (nextState.showModal !== undefined)
63
+ setShowModal(nextState.showModal);
64
+ if (nextState.dappAccount !== undefined)
65
+ setDappAccount(nextState.dappAccount);
66
+ if (nextState.submission !== undefined)
67
+ setSubmission(nextState.submission);
68
+ if (nextState.timeout !== undefined)
69
+ setTimeout(nextState.timeout);
70
+ if (nextState.successfullChallengeTimeout !== undefined)
71
+ setSuccessfullChallengeTimeout(nextState.timeout);
72
+ if (nextState.blockNumber !== undefined)
73
+ setBlockNumber(nextState.blockNumber);
74
+ if (nextState.sendData !== undefined)
75
+ setSendData(nextState.sendData);
76
+ },
77
+ ];
78
+ };
79
+ //# sourceMappingURL=builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/state/builder.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,gBAAgB,GACzB,CAAC,KAAsB,EAAE,aAAsC,EAAE,EAAE,CAAC,CAAC,SAAmC,EAAE,EAAE;IAGxG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAE/B,aAAa,CAAC,SAAS,CAAC,CAAA;AAC5B,CAAC,CAAA;AAQL,MAAM,aAAa,GAAG,CAAI,MAAkB,EAAE,YAAe,EAA2B,EAAE;IACtF,MAAM,GAAG,GAAG,MAAM,CAAI,YAAY,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,CAAC,KAAQ,EAAE,EAAE;QACxB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACvB,CAAC,CAAA;IACD,MAAM,KAAK,GAAM,GAAG,CAA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,SAAS,CAAC,WAAW,CAAC,CAAA;YAC9E,IAAI,SAAS,CAAC,UAAU,KAAK,SAAS;gBAAE,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;YAC3E,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS;gBAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAClE,IAAI,SAAS,CAAC,2BAA2B,KAAK,SAAS;gBAAE,8BAA8B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAC1G,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS;gBAAE,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;YAC9E,IAAI,SAAS,CAAC,QAAQ,KAAK,SAAS;gBAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QACzE,CAAC;KACJ,CAAA;AACL,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@prosopo/procaptcha-common",
3
+ "version": "0.3.3",
4
+ "author": "PROSOPO LIMITED <info@prosopo.io>",
5
+ "license": "Apache-2.0",
6
+ "main": "./dist/index.js",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "engines": {
10
+ "node": ">=18",
11
+ "npm": ">=9"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/cjs/index.cjs"
17
+ }
18
+ },
19
+ "types": "./dist/index.d.ts",
20
+ "source": "./src/index.ts",
21
+ "scripts": {
22
+ "clean": "tsc --build --clean",
23
+ "build": "tsc --build --verbose tsconfig.json",
24
+ "build:cjs": "npx vite --config vite.cjs.config.ts build",
25
+ "eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
26
+ "eslint:fix": "npm run eslint -- --fix",
27
+ "prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
28
+ "prettier:fix": "npm run prettier -- --write",
29
+ "lint": "npm run eslint && npm run prettier",
30
+ "lint:fix": "npm run eslint:fix && npm run prettier:fix"
31
+ },
32
+ "browserslist": [
33
+ "> 0.5%, last 2 versions, not dead"
34
+ ],
35
+ "dependencies": {
36
+ "@prosopo/common": "0.3.3",
37
+ "@prosopo/types": "0.3.3",
38
+ "@prosopo/util": "0.3.3"
39
+ },
40
+ "devDependencies": {
41
+ "tslib": "2.6.2",
42
+ "typescript": "5.1.6"
43
+ },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/prosopo/captcha.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/prosopo/captcha/issues"
50
+ },
51
+ "homepage": "https://github.com/prosopo/captcha#readme",
52
+ "description": "",
53
+ "publishConfig": {
54
+ "registry": "https://registry.npmjs.org"
55
+ }
56
+ }
@@ -0,0 +1,19 @@
1
+ // Copyright 2021-2024 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { ViteCommonJSConfig } from '@prosopo/config'
15
+ import path from 'path'
16
+
17
+ export default function () {
18
+ return ViteCommonJSConfig('procaptcha-common', path.resolve('./tsconfig.cjs.json'))
19
+ }