@prosopo/procaptcha-pow 2.7.14 → 2.7.16

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 CHANGED
@@ -1,5 +1,38 @@
1
1
  # @prosopo/procaptcha-pow
2
2
 
3
+ ## 2.7.16
4
+ ### Patch Changes
5
+
6
+ - @prosopo/procaptcha@2.7.16
7
+
8
+ ## 2.7.15
9
+ ### Patch Changes
10
+
11
+ - 3573f0b: fix npm scripts bundle command
12
+ - 3573f0b: build using vite, typecheck using tsc
13
+ - efd8102: Add tests for unwrap error helper
14
+ - 3573f0b: standardise all vite based npm scripts for bundling
15
+ - Updated dependencies [52dbf21]
16
+ - Updated dependencies [93d5e50]
17
+ - Updated dependencies [3573f0b]
18
+ - Updated dependencies [3573f0b]
19
+ - Updated dependencies [efd8102]
20
+ - Updated dependencies [93d5e50]
21
+ - Updated dependencies [63519d7]
22
+ - Updated dependencies [f29fc7e]
23
+ - Updated dependencies [3573f0b]
24
+ - Updated dependencies [2d0dd8a]
25
+ - @prosopo/util@3.0.3
26
+ - @prosopo/widget-skeleton@2.6.1
27
+ - @prosopo/locale@3.1.0
28
+ - @prosopo/types@3.0.4
29
+ - @prosopo/procaptcha-common@2.7.10
30
+ - @prosopo/procaptcha@2.7.15
31
+ - @prosopo/account@2.7.10
32
+ - @prosopo/common@3.1.0
33
+ - @prosopo/api@3.1.1
34
+ - @prosopo/config@3.1.1
35
+
3
36
  ## 2.7.14
4
37
  ### Patch Changes
5
38
 
@@ -1,5 +1,17 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { Suspense, lazy } from "react";
3
- const ProcaptchaWidget = lazy(async () => import("./ProcaptchaWidget.js"));
4
- export const ProcaptchaPow = (props) => (_jsx(Suspense, { children: _jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks, frictionlessState: props.frictionlessState, i18n: props.i18n }) }));
5
- //# sourceMappingURL=ProcaptchaPoW.js.map
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { lazy, Suspense } from "react";
3
+ const ProcaptchaWidget = lazy(
4
+ async () => import("./ProcaptchaWidget.js")
5
+ );
6
+ const ProcaptchaPow = (props) => /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(
7
+ ProcaptchaWidget,
8
+ {
9
+ config: props.config,
10
+ callbacks: props.callbacks,
11
+ frictionlessState: props.frictionlessState,
12
+ i18n: props.i18n
13
+ }
14
+ ) });
15
+ export {
16
+ ProcaptchaPow
17
+ };
@@ -1,76 +1,91 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { loadI18next, useTranslation } from "@prosopo/locale";
3
- import { buildUpdateState, useProcaptcha } from "@prosopo/procaptcha-common";
4
- import { Checkbox } from "@prosopo/procaptcha-common";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { useTranslation, loadI18next } from "@prosopo/locale";
3
+ import { useProcaptcha, buildUpdateState, Checkbox } from "@prosopo/procaptcha-common";
5
4
  import { ModeEnum } from "@prosopo/types";
6
- import { darkTheme, lightTheme } from "@prosopo/widget-skeleton";
7
- import { useEffect, useRef, useState } from "react";
5
+ import { lightTheme, darkTheme } from "@prosopo/widget-skeleton";
6
+ import { useState, useRef, useEffect } from "react";
8
7
  import { Manager } from "../services/Manager.js";
9
8
  const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
10
9
  const Procaptcha = (props) => {
11
- const { t, ready: isTranslationReady } = useTranslation();
12
- const config = props.config;
13
- const i18n = props.i18n;
14
- const theme = "light" === config.theme ? lightTheme : darkTheme;
15
- const frictionlessState = props.frictionlessState;
16
- const callbacks = props.callbacks || {};
17
- const [state, _updateState] = useProcaptcha(useState, useRef);
18
- const [loading, setLoading] = useState(false);
19
- const updateState = buildUpdateState(state, _updateState);
20
- const manager = useRef(Manager(config, state, updateState, callbacks, frictionlessState));
21
- useEffect(() => {
22
- if (config.language) {
23
- if (i18n) {
24
- if (i18n.language !== config.language) {
25
- i18n.changeLanguage(config.language).then((r) => r);
26
- }
27
- }
28
- else {
29
- loadI18next(false).then((i18n) => {
30
- if (i18n.language !== config.language)
31
- i18n.changeLanguage(config.language).then((r) => r);
32
- });
33
- }
10
+ const { t, ready: isTranslationReady } = useTranslation();
11
+ const config = props.config;
12
+ const i18n = props.i18n;
13
+ const theme = "light" === config.theme ? lightTheme : darkTheme;
14
+ const frictionlessState = props.frictionlessState;
15
+ const callbacks = props.callbacks || {};
16
+ const [state, _updateState] = useProcaptcha(useState, useRef);
17
+ const [loading, setLoading] = useState(false);
18
+ const updateState = buildUpdateState(state, _updateState);
19
+ const manager = useRef(
20
+ Manager(config, state, updateState, callbacks, frictionlessState)
21
+ );
22
+ useEffect(() => {
23
+ if (config.language) {
24
+ if (i18n) {
25
+ if (i18n.language !== config.language) {
26
+ i18n.changeLanguage(config.language).then((r) => r);
34
27
  }
35
- }, [i18n, config.language]);
36
- useEffect(() => {
37
- if (state.error) {
38
- setLoading(false);
39
- if (state.error.key === "CAPTCHA.NO_SESSION_FOUND" && frictionlessState) {
40
- setTimeout(() => {
41
- frictionlessState.restart();
42
- }, 3000);
43
- }
28
+ } else {
29
+ loadI18next(false).then((i18n2) => {
30
+ if (i18n2.language !== config.language)
31
+ i18n2.changeLanguage(config.language).then((r) => r);
32
+ });
33
+ }
34
+ }
35
+ }, [i18n, config.language]);
36
+ useEffect(() => {
37
+ if (state.error) {
38
+ setLoading(false);
39
+ if (state.error.key === "CAPTCHA.NO_SESSION_FOUND" && frictionlessState) {
40
+ setTimeout(() => {
41
+ frictionlessState.restart();
42
+ }, 3e3);
43
+ }
44
+ }
45
+ }, [state.error, frictionlessState]);
46
+ useEffect(() => {
47
+ if (config.mode === ModeEnum.invisible) {
48
+ const handleExecuteEvent = (event) => {
49
+ try {
50
+ manager.current.start();
51
+ } catch (error) {
52
+ console.error("Error starting PoW verification:", error);
44
53
  }
45
- }, [state.error, frictionlessState]);
46
- useEffect(() => {
47
- if (config.mode === ModeEnum.invisible) {
48
- const handleExecuteEvent = (event) => {
49
- try {
50
- manager.current.start();
51
- }
52
- catch (error) {
53
- console.error("Error starting PoW verification:", error);
54
- }
55
- };
56
- document.addEventListener(PROCAPTCHA_EXECUTE_EVENT, handleExecuteEvent);
57
- return () => {
58
- document.removeEventListener(PROCAPTCHA_EXECUTE_EVENT, handleExecuteEvent);
59
- };
54
+ };
55
+ document.addEventListener(PROCAPTCHA_EXECUTE_EVENT, handleExecuteEvent);
56
+ return () => {
57
+ document.removeEventListener(
58
+ PROCAPTCHA_EXECUTE_EVENT,
59
+ handleExecuteEvent
60
+ );
61
+ };
62
+ }
63
+ return () => {
64
+ };
65
+ }, [config.mode]);
66
+ if (config.mode === ModeEnum.invisible) {
67
+ return null;
68
+ }
69
+ return /* @__PURE__ */ jsx(
70
+ Checkbox,
71
+ {
72
+ checked: state.isHuman,
73
+ onChange: async () => {
74
+ if (loading) {
75
+ return;
60
76
  }
61
- return () => { };
62
- }, [config.mode]);
63
- if (config.mode === ModeEnum.invisible) {
64
- return null;
77
+ setLoading(true);
78
+ await manager.current.start();
79
+ setLoading(false);
80
+ },
81
+ theme,
82
+ labelText: isTranslationReady ? t("WIDGET.I_AM_HUMAN") : "",
83
+ error: state.error?.message,
84
+ "aria-label": "human checkbox",
85
+ loading
65
86
  }
66
- return (_jsx(Checkbox, { checked: state.isHuman, onChange: async () => {
67
- if (loading) {
68
- return;
69
- }
70
- setLoading(true);
71
- await manager.current.start();
72
- setLoading(false);
73
- }, theme: theme, labelText: isTranslationReady ? t("WIDGET.I_AM_HUMAN") : "", error: state.error?.message, "aria-label": "human checkbox", loading: loading }));
87
+ );
88
+ };
89
+ export {
90
+ Procaptcha as default
74
91
  };
75
- export default Procaptcha;
76
- //# sourceMappingURL=ProcaptchaWidget.js.map
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
- export * from "./components/ProcaptchaWidget.js";
2
- export * from "./components/ProcaptchaPoW.js";
3
- //# sourceMappingURL=index.js.map
1
+ import "./components/ProcaptchaWidget.js";
2
+ import { ProcaptchaPow } from "./components/ProcaptchaPoW.js";
3
+ export {
4
+ ProcaptchaPow
5
+ };
@@ -1,190 +1,210 @@
1
1
  import { stringToHex } from "@polkadot/util/string";
2
2
  import { ProviderApi } from "@prosopo/api";
3
3
  import { ProsopoEnvError } from "@prosopo/common";
4
- import { ExtensionLoader, buildUpdateState, getRandomActiveProvider, providerRetry, } from "@prosopo/procaptcha-common";
5
- import { getDefaultEvents } from "@prosopo/procaptcha-common";
6
- import { ApiParams, ProcaptchaConfigSchema, encodeProcaptchaOutput, } from "@prosopo/types";
7
- import { sleep } from "@prosopo/util";
8
- import { solvePoW } from "@prosopo/util";
9
- export const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState) => {
10
- const events = getDefaultEvents(callbacks);
11
- const defaultState = () => {
12
- return {
13
- showModal: false,
14
- loading: false,
15
- index: 0,
16
- challenge: undefined,
17
- solutions: undefined,
18
- isHuman: false,
19
- captchaApi: undefined,
20
- account: undefined,
21
- };
4
+ import { getDefaultEvents, buildUpdateState, providerRetry, ExtensionLoader, getRandomActiveProvider } from "@prosopo/procaptcha-common";
5
+ import { ProcaptchaConfigSchema, ApiParams, encodeProcaptchaOutput } from "@prosopo/types";
6
+ import { sleep, solvePoW } from "@prosopo/util";
7
+ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState) => {
8
+ const events = getDefaultEvents(callbacks);
9
+ const defaultState = () => {
10
+ return {
11
+ // note order matters! see buildUpdateState. These fields are set in order, so disable modal first, then set loading to false, etc.
12
+ showModal: false,
13
+ loading: false,
14
+ index: 0,
15
+ challenge: void 0,
16
+ solutions: void 0,
17
+ isHuman: false,
18
+ captchaApi: void 0,
19
+ account: void 0
20
+ // don't handle timeout here, this should be handled by the state management
22
21
  };
23
- const clearTimeout = () => {
24
- window.clearTimeout(Number(state.timeout));
25
- updateState({ timeout: undefined });
22
+ };
23
+ const clearTimeout = () => {
24
+ window.clearTimeout(Number(state.timeout));
25
+ updateState({ timeout: void 0 });
26
+ };
27
+ const onFailed = () => {
28
+ updateState({
29
+ isHuman: false,
30
+ loading: false
31
+ });
32
+ events.onFailed();
33
+ resetState(frictionlessState?.restart);
34
+ };
35
+ const clearSuccessfulChallengeTimeout = () => {
36
+ window.clearTimeout(Number(state.successfullChallengeTimeout));
37
+ updateState({ successfullChallengeTimeout: void 0 });
38
+ };
39
+ const getConfig = () => {
40
+ const config = {
41
+ userAccountAddress: configInput.userAccountAddress || "",
42
+ ...configInput
26
43
  };
27
- const onFailed = () => {
44
+ console.log("Using config:", config);
45
+ if (state.account) {
46
+ config.userAccountAddress = state.account.account.address;
47
+ }
48
+ return ProcaptchaConfigSchema.parse(config);
49
+ };
50
+ const getAccount = () => {
51
+ if (!state.account) {
52
+ throw new ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
53
+ context: { error: "Account not loaded" }
54
+ });
55
+ }
56
+ const account = state.account;
57
+ return { account };
58
+ };
59
+ const getDappAccount = () => {
60
+ if (!state.dappAccount) {
61
+ throw new ProsopoEnvError("GENERAL.SITE_KEY_MISSING");
62
+ }
63
+ const dappAccount = state.dappAccount;
64
+ return dappAccount;
65
+ };
66
+ const updateState = buildUpdateState(state, onStateUpdate);
67
+ const resetState = (frictionlessRestart) => {
68
+ clearTimeout();
69
+ clearSuccessfulChallengeTimeout();
70
+ updateState(defaultState());
71
+ events.onReset();
72
+ if (frictionlessRestart) {
73
+ frictionlessRestart();
74
+ }
75
+ };
76
+ const setValidChallengeTimeout = () => {
77
+ const timeMillis = getConfig().captchas.pow.solutionTimeout;
78
+ const successfullChallengeTimeout = setTimeout(() => {
79
+ updateState({ isHuman: false });
80
+ events.onExpired();
81
+ resetState(frictionlessState?.restart);
82
+ }, timeMillis);
83
+ updateState({ successfullChallengeTimeout });
84
+ };
85
+ const start = async () => {
86
+ await providerRetry(
87
+ async () => {
88
+ if (state.loading) {
89
+ return;
90
+ }
91
+ if (state.isHuman) {
92
+ return;
93
+ }
94
+ resetState();
28
95
  updateState({
29
- isHuman: false,
30
- loading: false,
96
+ loading: true
31
97
  });
32
- events.onFailed();
33
- resetState(frictionlessState?.restart);
34
- };
35
- const clearSuccessfulChallengeTimeout = () => {
36
- window.clearTimeout(Number(state.successfullChallengeTimeout));
37
- updateState({ successfullChallengeTimeout: undefined });
38
- };
39
- const getConfig = () => {
40
- const config = {
41
- userAccountAddress: configInput.userAccountAddress || "",
42
- ...configInput,
98
+ updateState({ attemptCount: state.attemptCount + 1 });
99
+ const config = getConfig();
100
+ const selectAccount = async () => {
101
+ if (frictionlessState) {
102
+ return frictionlessState.userAccount;
103
+ }
104
+ const ext = new (await ExtensionLoader(config.web2))();
105
+ return ext.getAccount(config);
43
106
  };
44
- console.log("Using config:", config);
45
- if (state.account) {
46
- config.userAccountAddress = state.account.account.address;
47
- }
48
- return ProcaptchaConfigSchema.parse(config);
49
- };
50
- const getAccount = () => {
51
- if (!state.account) {
52
- throw new ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
53
- context: { error: "Account not loaded" },
54
- });
55
- }
56
- const account = state.account;
57
- return { account };
58
- };
59
- const getDappAccount = () => {
60
- if (!state.dappAccount) {
61
- throw new ProsopoEnvError("GENERAL.SITE_KEY_MISSING");
107
+ const user = await selectAccount();
108
+ console.log("User", user);
109
+ const userAccount = user.account.address;
110
+ updateState({
111
+ account: { account: { address: userAccount } }
112
+ });
113
+ updateState({ dappAccount: config.account.address });
114
+ await sleep(100);
115
+ if (!config.web2 && !config.userAccountAddress) {
116
+ throw new ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
117
+ context: {
118
+ error: "Account address has not been set for web3 mode"
119
+ }
120
+ });
62
121
  }
63
- const dappAccount = state.dappAccount;
64
- return dappAccount;
65
- };
66
- const updateState = buildUpdateState(state, onStateUpdate);
67
- const resetState = (frictionlessRestart) => {
68
- clearTimeout();
69
- clearSuccessfulChallengeTimeout();
70
- updateState(defaultState());
71
- events.onReset();
72
- if (frictionlessRestart) {
73
- frictionlessRestart();
122
+ let getRandomProviderResponse = void 0;
123
+ if (frictionlessState?.provider) {
124
+ getRandomProviderResponse = frictionlessState.provider;
125
+ } else {
126
+ getRandomProviderResponse = await getRandomActiveProvider(
127
+ getConfig()
128
+ );
74
129
  }
75
- };
76
- const setValidChallengeTimeout = () => {
77
- const timeMillis = getConfig().captchas.pow.solutionTimeout;
78
- const successfullChallengeTimeout = setTimeout(() => {
79
- updateState({ isHuman: false });
80
- events.onExpired();
81
- resetState(frictionlessState?.restart);
82
- }, timeMillis);
83
- updateState({ successfullChallengeTimeout });
84
- };
85
- const start = async () => {
86
- await providerRetry(async () => {
87
- if (state.loading) {
88
- return;
89
- }
90
- if (state.isHuman) {
91
- return;
130
+ const providerUrl = getRandomProviderResponse.provider.url;
131
+ const providerApi = new ProviderApi(providerUrl, getDappAccount());
132
+ const challenge = await providerApi.getPowCaptchaChallenge(
133
+ userAccount,
134
+ getDappAccount(),
135
+ frictionlessState?.sessionId
136
+ );
137
+ if (challenge.error) {
138
+ updateState({
139
+ loading: false,
140
+ error: {
141
+ message: challenge.error.message,
142
+ key: challenge.error.key || "API.UNKNOWN_ERROR"
92
143
  }
93
- resetState();
94
- updateState({
95
- loading: true,
144
+ });
145
+ } else {
146
+ const solution = solvePoW(challenge.challenge, challenge.difficulty);
147
+ const signer = user.extension?.signer;
148
+ if (!signer || !signer.signRaw) {
149
+ throw new ProsopoEnvError("GENERAL.CANT_FIND_KEYRINGPAIR", {
150
+ context: {
151
+ error: "Signer is not defined, cannot sign message to prove account ownership"
152
+ }
96
153
  });
97
- updateState({ attemptCount: state.attemptCount + 1 });
98
- const config = getConfig();
99
- const selectAccount = async () => {
100
- if (frictionlessState) {
101
- return frictionlessState.userAccount;
102
- }
103
- const ext = new (await ExtensionLoader(config.web2))();
104
- return ext.getAccount(config);
105
- };
106
- const user = await selectAccount();
107
- console.log("User", user);
108
- const userAccount = user.account.address;
154
+ }
155
+ const userTimestampSignature = await signer.signRaw({
156
+ address: userAccount,
157
+ data: stringToHex(challenge[ApiParams.timestamp].toString()),
158
+ type: "bytes"
159
+ });
160
+ const verifiedSolution = await providerApi.submitPowCaptchaSolution(
161
+ challenge,
162
+ getAccount().account.account.address,
163
+ getDappAccount(),
164
+ solution,
165
+ userTimestampSignature.signature.toString(),
166
+ config.captchas.pow.verifiedTimeout
167
+ );
168
+ if (verifiedSolution[ApiParams.verified]) {
109
169
  updateState({
110
- account: { account: { address: userAccount } },
170
+ isHuman: true,
171
+ loading: false
111
172
  });
112
- updateState({ dappAccount: config.account.address });
113
- await sleep(100);
114
- if (!config.web2 && !config.userAccountAddress) {
115
- throw new ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
116
- context: {
117
- error: "Account address has not been set for web3 mode",
118
- },
119
- });
120
- }
121
- let getRandomProviderResponse = undefined;
122
- if (frictionlessState?.provider) {
123
- getRandomProviderResponse = frictionlessState.provider;
124
- }
125
- else {
126
- getRandomProviderResponse = await getRandomActiveProvider(getConfig());
127
- }
128
- const providerUrl = getRandomProviderResponse.provider.url;
129
- const providerApi = new ProviderApi(providerUrl, getDappAccount());
130
- const challenge = await providerApi.getPowCaptchaChallenge(userAccount, getDappAccount(), frictionlessState?.sessionId);
131
- if (challenge.error) {
132
- updateState({
133
- loading: false,
134
- error: {
135
- message: challenge.error.message,
136
- key: challenge.error.key || "API.UNKNOWN_ERROR",
137
- },
138
- });
139
- }
140
- else {
141
- const solution = solvePoW(challenge.challenge, challenge.difficulty);
142
- const signer = user.extension?.signer;
143
- if (!signer || !signer.signRaw) {
144
- throw new ProsopoEnvError("GENERAL.CANT_FIND_KEYRINGPAIR", {
145
- context: {
146
- error: "Signer is not defined, cannot sign message to prove account ownership",
147
- },
148
- });
173
+ events.onHuman(
174
+ encodeProcaptchaOutput({
175
+ [ApiParams.providerUrl]: providerUrl,
176
+ [ApiParams.user]: getAccount().account.account.address,
177
+ [ApiParams.dapp]: getDappAccount(),
178
+ [ApiParams.challenge]: challenge.challenge,
179
+ [ApiParams.nonce]: solution,
180
+ [ApiParams.timestamp]: challenge.timestamp,
181
+ [ApiParams.signature]: {
182
+ [ApiParams.provider]: challenge.signature.provider,
183
+ [ApiParams.user]: {
184
+ [ApiParams.timestamp]: userTimestampSignature.signature.toString()
185
+ }
149
186
  }
150
- const userTimestampSignature = await signer.signRaw({
151
- address: userAccount,
152
- data: stringToHex(challenge[ApiParams.timestamp].toString()),
153
- type: "bytes",
154
- });
155
- const verifiedSolution = await providerApi.submitPowCaptchaSolution(challenge, getAccount().account.account.address, getDappAccount(), solution, userTimestampSignature.signature.toString(), config.captchas.pow.verifiedTimeout);
156
- if (verifiedSolution[ApiParams.verified]) {
157
- updateState({
158
- isHuman: true,
159
- loading: false,
160
- });
161
- events.onHuman(encodeProcaptchaOutput({
162
- [ApiParams.providerUrl]: providerUrl,
163
- [ApiParams.user]: getAccount().account.account.address,
164
- [ApiParams.dapp]: getDappAccount(),
165
- [ApiParams.challenge]: challenge.challenge,
166
- [ApiParams.nonce]: solution,
167
- [ApiParams.timestamp]: challenge.timestamp,
168
- [ApiParams.signature]: {
169
- [ApiParams.provider]: challenge.signature.provider,
170
- [ApiParams.user]: {
171
- [ApiParams.timestamp]: userTimestampSignature.signature.toString(),
172
- },
173
- },
174
- }));
175
- setValidChallengeTimeout();
176
- }
177
- else {
178
- onFailed();
179
- }
180
- }
181
- }, start, () => {
182
- resetState();
183
- }, state.attemptCount, 3);
184
- };
185
- return {
186
- start,
187
- resetState,
188
- };
187
+ })
188
+ );
189
+ setValidChallengeTimeout();
190
+ } else {
191
+ onFailed();
192
+ }
193
+ }
194
+ },
195
+ start,
196
+ () => {
197
+ resetState();
198
+ },
199
+ state.attemptCount,
200
+ 3
201
+ );
202
+ };
203
+ return {
204
+ start,
205
+ resetState
206
+ };
207
+ };
208
+ export {
209
+ Manager
189
210
  };
190
- //# sourceMappingURL=Manager.js.map
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-pow",
3
- "version": "2.7.14",
3
+ "version": "2.7.16",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
- "main": "./dist/index.js",
6
+ "main": "dist/index.js",
7
7
  "type": "module",
8
8
  "sideEffects": false,
9
9
  "engines": {
@@ -12,36 +12,40 @@
12
12
  },
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.js",
16
17
  "require": "./dist/cjs/index.cjs"
17
18
  }
18
19
  },
19
- "types": "./dist/index.d.ts",
20
+ "types": "dist/index.d.ts",
20
21
  "source": "./src/index.ts",
21
22
  "scripts": {
22
- "test": "echo \"No test specified\"",
23
- "clean": "tsc --build --clean",
24
- "build": "tsc --build --verbose",
25
- "build:cjs": "npx vite --config vite.cjs.config.ts build"
23
+ "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
24
+ "build": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
25
+ "build:tsc": "tsc --build --verbose",
26
+ "build:cjs": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
27
+ "typecheck": "tsc --build --declaration --emitDeclarationOnly",
28
+ "test": "echo no tests"
26
29
  },
27
30
  "browserslist": ["> 0.5%, last 2 versions, not dead"],
28
31
  "dependencies": {
29
32
  "@polkadot/util": "12.6.2",
30
- "@prosopo/account": "2.7.9",
31
- "@prosopo/api": "3.1.0",
32
- "@prosopo/common": "3.0.2",
33
- "@prosopo/locale": "3.0.2",
34
- "@prosopo/procaptcha": "2.7.14",
35
- "@prosopo/procaptcha-common": "2.7.9",
36
- "@prosopo/types": "3.0.3",
37
- "@prosopo/util": "3.0.2",
38
- "@prosopo/widget-skeleton": "2.6.0",
33
+ "@prosopo/account": "2.7.10",
34
+ "@prosopo/api": "3.1.1",
35
+ "@prosopo/common": "3.1.0",
36
+ "@prosopo/locale": "3.1.0",
37
+ "@prosopo/procaptcha": "2.7.16",
38
+ "@prosopo/procaptcha-common": "2.7.10",
39
+ "@prosopo/types": "3.0.4",
40
+ "@prosopo/util": "3.0.3",
41
+ "@prosopo/widget-skeleton": "2.6.1",
39
42
  "@typegoose/auto-increment": "4.13.0",
40
43
  "axios": "1.10.0",
41
44
  "esbuild": "0.25.6",
42
45
  "express": "4.21.2",
43
- "openpgp": "5.11.3",
44
46
  "react": "18.3.1",
47
+ "@prosopo/config": "3.1.1",
48
+ "openpgp": "5.11.3",
45
49
  "webpack-dev-server": "5.2.2"
46
50
  },
47
51
  "overrides": {
@@ -52,7 +56,6 @@
52
56
  }
53
57
  },
54
58
  "devDependencies": {
55
- "@prosopo/config": "3.1.0",
56
59
  "@vitest/coverage-v8": "3.0.9",
57
60
  "concurrently": "9.0.1",
58
61
  "del-cli": "6.0.0",
@@ -16,7 +16,7 @@ import { ViteCommonJSConfig } from "@prosopo/config";
16
16
 
17
17
  export default function () {
18
18
  return ViteCommonJSConfig(
19
- "procaptcha-pow",
20
- path.resolve("./tsconfig.cjs.json"),
19
+ path.basename("."),
20
+ path.resolve("./tsconfig.json"),
21
21
  );
22
22
  }
@@ -0,0 +1,20 @@
1
+ // Copyright 2021-2025 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
+
15
+ import path from "node:path";
16
+ import { ViteEsmConfig } from "@prosopo/config";
17
+
18
+ export default function () {
19
+ return ViteEsmConfig(path.basename("."), path.resolve("./tsconfig.json"));
20
+ }
@@ -1,3 +0,0 @@
1
- import type { ProcaptchaProps } from "@prosopo/types";
2
- export declare const ProcaptchaPow: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=ProcaptchaPoW.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProcaptchaPoW.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaPoW.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAuB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAc3E,eAAO,MAAM,aAAa,UAAW,eAAe,qDASnD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProcaptchaPoW.js","sourceRoot":"","sources":["../../src/components/ProcaptchaPoW.tsx"],"names":[],"mappings":";AAeA,OAAO,EAA4B,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AASjE,MAAM,gBAAgB,GAAmD,IAAI,CAC5E,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CACxD,KAAC,QAAQ,cACR,KAAC,gBAAgB,IAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,GACf,GACQ,CACX,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type ProcaptchaProps } from "@prosopo/types";
2
- declare const Procaptcha: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
3
- export default Procaptcha;
4
- //# sourceMappingURL=ProcaptchaWidget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQhE,QAAA,MAA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C,CAAC,EAAE,EAC3D,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,gBAChB,gBAAgB,EAC3B,OAAO,EAAE,OAAO,GACf,CACF,CAAC;AACH,CAAC,CAAC;AACF,eAAe,UAAU,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./components/ProcaptchaWidget.js";
2
- export * from "./components/ProcaptchaPoW.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { type FrictionlessState, type ProcaptchaCallbacks, type ProcaptchaClientConfigInput, type ProcaptchaState, type ProcaptchaStateUpdateFn } from "@prosopo/types";
2
- export declare const Manager: (configInput: ProcaptchaClientConfigInput, state: ProcaptchaState, onStateUpdate: ProcaptchaStateUpdateFn, callbacks: ProcaptchaCallbacks, frictionlessState?: FrictionlessState) => {
3
- start: () => Promise<void>;
4
- resetState: (frictionlessRestart?: () => void) => void;
5
- };
6
- //# sourceMappingURL=Manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../src/services/Manager.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAEhC,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,OAAO,gBACN,2BAA2B,SACjC,eAAe,iBACP,uBAAuB,aAC3B,mBAAmB,sBACV,iBAAiB;;uCA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