@prosopo/keyring 2.10.1 → 2.10.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.
- package/.turbo/turbo-build$colon$cjs.log +2 -2
- package/.turbo/turbo-build$colon$tsc.log +10 -10
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +36 -0
- package/dist/accounts/testAccounts.d.ts.map +1 -1
- package/dist/accounts/testAccounts.js +23 -8
- package/dist/accounts/testAccounts.js.map +1 -1
- package/dist/accounts/testAccounts.test.js +33 -4
- package/dist/accounts/testAccounts.test.js.map +1 -1
- package/dist/cjs/accounts/testAccounts.cjs +23 -8
- package/package.json +3 -3
|
@@ -35,10 +35,10 @@ dist/cjs/keyring/pairs.cjs 0.86 kB │ gzip: 0.38 kB
|
|
|
35
35
|
dist/cjs/index.cjs 0.91 kB │ gzip: 0.31 kB
|
|
36
36
|
dist/cjs/pair/encode.cjs 0.91 kB │ gzip: 0.44 kB
|
|
37
37
|
dist/cjs/accounts/mnemonic.cjs 0.95 kB │ gzip: 0.38 kB
|
|
38
|
-
dist/cjs/accounts/testAccounts.cjs 1.31 kB │ gzip: 0.63 kB
|
|
39
38
|
dist/cjs/accounts/getPair.cjs 1.41 kB │ gzip: 0.60 kB
|
|
40
39
|
dist/cjs/pair/decode.cjs 1.77 kB │ gzip: 0.70 kB
|
|
40
|
+
dist/cjs/accounts/testAccounts.cjs 1.83 kB │ gzip: 0.78 kB
|
|
41
41
|
dist/cjs/pair/index.cjs 7.28 kB │ gzip: 2.12 kB
|
|
42
42
|
dist/cjs/keyring/keyring.cjs 11.14 kB │ gzip: 3.05 kB
|
|
43
43
|
|
|
44
|
-
[32m✓ built in
|
|
44
|
+
[32m✓ built in 76ms[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
|
|
2
|
+
11:33:22 AM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
@@ -9,21 +9,21 @@ $ tsc --build --verbose
|
|
|
9
9
|
* ../common/tsconfig.json
|
|
10
10
|
* tsconfig.json
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
11:33:22 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
11:33:22 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
11:33:22 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
11:33:22 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
11:33:22 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
11:33:22 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
11:33:22 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
11:33:22 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
11:33:22 AM - Building project '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'...
|
|
29
29
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -37,10 +37,10 @@ dist/index.js 0.54 kB │ gzip: 0.23 kB
|
|
|
37
37
|
dist/keyring/pairs.js 0.71 kB │ gzip: 0.36 kB
|
|
38
38
|
dist/pair/encode.js 0.77 kB │ gzip: 0.41 kB
|
|
39
39
|
dist/accounts/mnemonic.js 0.84 kB │ gzip: 0.36 kB
|
|
40
|
-
dist/accounts/testAccounts.js 1.14 kB │ gzip: 0.60 kB
|
|
41
40
|
dist/accounts/getPair.js 1.24 kB │ gzip: 0.56 kB
|
|
42
41
|
dist/pair/decode.js 1.48 kB │ gzip: 0.66 kB
|
|
42
|
+
dist/accounts/testAccounts.js 1.63 kB │ gzip: 0.76 kB
|
|
43
43
|
dist/pair/index.js 6.98 kB │ gzip: 2.09 kB
|
|
44
44
|
dist/keyring/keyring.js 10.74 kB │ gzip: 2.99 kB
|
|
45
45
|
|
|
46
|
-
[32m✓ built in
|
|
46
|
+
[32m✓ built in 84ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @prosopo/keyring
|
|
2
2
|
|
|
3
|
+
## 2.10.3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [4570692]
|
|
7
|
+
- @prosopo/types@5.15.0
|
|
8
|
+
- @prosopo/common@3.1.64
|
|
9
|
+
|
|
10
|
+
## 2.10.2
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b299a91: An audio challenge, offered only as an accessibility alternative, like reCAPTCHA's audio option. The user hears a short sequence of spoken digits and types them in.
|
|
14
|
+
|
|
15
|
+
It is off by default and needs two switches. Prosopo has to turn on the `captchaTypeFeatureFlags.audio` feature flag for the site, which the site owner cannot do, and the site owner has to set `audioAccessibilityEnabled`. When both are on, image, puzzle and icon-order challenges show a "Use audio instead" button. Pressing it swaps the visual challenge for the audio one. After a wrong answer the user stays on audio and gets a fresh clip.
|
|
16
|
+
|
|
17
|
+
Audio is never a captcha type that can be selected or routed to. A site's `captchaType`, traffic-filter categories, Restrict rules and the site-key CLI all reject it, and routing, PoW escalation and the severity tiers leave it out. The provider only serves audio against the visual session the user was already given, and only on a site with both switches on; any other audio request is refused before the session is used up, and a request without a session is always refused.
|
|
18
|
+
|
|
19
|
+
The spoken digits are synthesised by `@prosopo/audio-assets`, so there is no recorded set of clips to collect. The answer never leaves the provider, and a challenge can be submitted and verified only once, even under concurrent requests. `@prosopo/procaptcha-audio` is the widget. It and the "Use audio instead" button are built on the shared widget code in `@prosopo/procaptcha-common`, and the provider side is built on the shared interactive-captcha code that puzzle and icon-order use.
|
|
20
|
+
|
|
21
|
+
The demo playground has audio pages, and there is an end-to-end test for it.
|
|
22
|
+
- e13d7a8: New captcha type: `iconOrder`. The user is shown a frame of icons and a legend, and clicks the legend's icons in the order given.
|
|
23
|
+
|
|
24
|
+
Icon-order is off by default. Only Prosopo can switch it on for a site, with the `captchaTypeFeatureFlags.iconOrder` feature flag; the site owner cannot. A site without the flag is never served icon-order by any route, and the challenge endpoint refuses it. Once the flag is on, the owner can still keep icon-order out of the frictionless flow with `frictionlessTypes.iconOrder`, the same way as image and puzzle.
|
|
25
|
+
|
|
26
|
+
The answer never leaves the provider. Icon positions are stored on the challenge record, and the widget receives only the rendered frame and legend. Grading checks order as well as position, and each icon's hit radius scales with its size. Verifying a token is single-use under concurrent requests.
|
|
27
|
+
|
|
28
|
+
`@prosopo/icon-order-assets` draws the imagery, and `@prosopo/procaptcha-icon-order` is the widget. Its text is translated into every supported language.
|
|
29
|
+
|
|
30
|
+
Puzzle and icon-order now share their server code: challenge and solution handlers, the verify route, the submit and verify pipeline, and the database record methods. The widget code they have in common moves into `@prosopo/procaptcha-common`: the lazy mount wrapper, manager expiry and dispose, spent-session handling, behavioural data encryption and trusted click coordinates. Puzzle's behaviour is unchanged.
|
|
31
|
+
|
|
32
|
+
The demo playground has icon-order pages, and there is an end-to-end test for it.
|
|
33
|
+
- Updated dependencies [b299a91]
|
|
34
|
+
- Updated dependencies [e13d7a8]
|
|
35
|
+
- Updated dependencies [270395d]
|
|
36
|
+
- @prosopo/types@5.14.0
|
|
37
|
+
- @prosopo/common@3.1.63
|
|
38
|
+
|
|
3
39
|
## 2.10.1
|
|
4
40
|
### Patch Changes
|
|
5
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testAccounts.d.ts","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"testAccounts.d.ts","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EAIN,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,MAAM,gBAAgB,CAAC;AAkBxB,wBAAgB,kBAAkB,IAAI,KAAK,EAAE,CA6C5C;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,CAcxD"}
|
|
@@ -2,16 +2,29 @@ import { DEV_PHRASE } from "../keyring/keyring.js";
|
|
|
2
2
|
import { getPair } from "./getPair.js";
|
|
3
3
|
import { CaptchaType, ClientSettingsSchema } from "@prosopo/types";
|
|
4
4
|
//#region src/accounts/testAccounts.ts
|
|
5
|
+
var seed = (captchaType, name = captchaType, audioAccessibilityEnabled = false) => ({
|
|
6
|
+
name,
|
|
7
|
+
captchaType,
|
|
8
|
+
audioAccessibilityEnabled
|
|
9
|
+
});
|
|
5
10
|
function getDefaultSiteKeys() {
|
|
6
|
-
const
|
|
7
|
-
CaptchaType.image,
|
|
8
|
-
CaptchaType.pow,
|
|
9
|
-
CaptchaType.frictionless,
|
|
10
|
-
|
|
11
|
+
const seeds = [
|
|
12
|
+
seed(CaptchaType.image),
|
|
13
|
+
seed(CaptchaType.pow),
|
|
14
|
+
seed(CaptchaType.frictionless),
|
|
15
|
+
{
|
|
16
|
+
...seed(CaptchaType.iconOrder),
|
|
17
|
+
captchaTypeFeatureFlags: { iconOrder: true }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
...seed(CaptchaType.image, "audio", true),
|
|
21
|
+
captchaTypeFeatureFlags: { audio: true }
|
|
22
|
+
},
|
|
23
|
+
seed(CaptchaType.puzzle)
|
|
11
24
|
];
|
|
12
25
|
const sites = [];
|
|
13
|
-
for (const captchaType of
|
|
14
|
-
const secret = `${DEV_PHRASE}//${
|
|
26
|
+
for (const { name, captchaType, audioAccessibilityEnabled, captchaTypeFeatureFlags } of seeds) {
|
|
27
|
+
const secret = `${DEV_PHRASE}//${name}`;
|
|
15
28
|
const pair = getPair(secret);
|
|
16
29
|
sites.push({
|
|
17
30
|
pair,
|
|
@@ -19,9 +32,11 @@ function getDefaultSiteKeys() {
|
|
|
19
32
|
secret,
|
|
20
33
|
settings: ClientSettingsSchema.parse({
|
|
21
34
|
captchaType,
|
|
35
|
+
audioAccessibilityEnabled,
|
|
22
36
|
domains: ["localhost"],
|
|
23
37
|
imageMaxRounds: 2,
|
|
24
|
-
frictionlessThreshold: .8
|
|
38
|
+
frictionlessThreshold: .8,
|
|
39
|
+
...captchaTypeFeatureFlags && { captchaTypeFeatureFlags }
|
|
25
40
|
})
|
|
26
41
|
});
|
|
27
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testAccounts.js","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,WAAW,EACX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"testAccounts.js","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,WAAW,EACX,oBAAoB,GAIpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAUvC,MAAM,IAAI,GAAG,CACZ,WAAwB,EACxB,OAAe,WAAW,EAC1B,yBAAyB,GAAG,KAAK,EACnB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,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AO,CACnB,oFAAoF,CACpF,CAAC;IACF,OAAO;QACN;YACC,GAAG,EAAE,wBAAwB;YAC7B,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,0BAA0B;YACvC,gBAAgB,EACf,oEAAoE;SACrE;KACD,CAAC;AACH,CAAC"}
|
|
@@ -5,17 +5,38 @@ import { getPair } from "./getPair.js";
|
|
|
5
5
|
import { getDefaultProviders, getDefaultSiteKeys } from "./testAccounts.js";
|
|
6
6
|
const SLOW = { timeout: 60000 };
|
|
7
7
|
describe("getDefaultSiteKeys", SLOW, () => {
|
|
8
|
-
|
|
8
|
+
const NAMES = [
|
|
9
|
+
"image",
|
|
10
|
+
"pow",
|
|
11
|
+
"frictionless",
|
|
12
|
+
"iconOrder",
|
|
13
|
+
"audio",
|
|
14
|
+
"puzzle",
|
|
15
|
+
];
|
|
16
|
+
it("provides one site per demo, in a stable order", () => {
|
|
9
17
|
expect(getDefaultSiteKeys().map((site) => site.settings.captchaType)).toEqual([
|
|
10
18
|
CaptchaType.image,
|
|
11
19
|
CaptchaType.pow,
|
|
12
20
|
CaptchaType.frictionless,
|
|
21
|
+
CaptchaType.iconOrder,
|
|
22
|
+
CaptchaType.image,
|
|
13
23
|
CaptchaType.puzzle,
|
|
14
24
|
]);
|
|
15
25
|
});
|
|
16
|
-
it("
|
|
26
|
+
it("never seeds a site with audio as its captcha type", () => {
|
|
17
27
|
for (const site of getDefaultSiteKeys()) {
|
|
18
|
-
expect(site.
|
|
28
|
+
expect(site.settings.captchaType).not.toBe(CaptchaType.audio);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
it("turns the audio alternative on for the audio demos' site only", () => {
|
|
32
|
+
const enabled = getDefaultSiteKeys().map((site) => site.settings.audioAccessibilityEnabled);
|
|
33
|
+
expect(enabled).toEqual(NAMES.map((name) => name === "audio"));
|
|
34
|
+
});
|
|
35
|
+
it("derives each site key from the dev phrase and its seed name", () => {
|
|
36
|
+
const sites = getDefaultSiteKeys();
|
|
37
|
+
expect(sites).toHaveLength(NAMES.length);
|
|
38
|
+
for (const [index, site] of sites.entries()) {
|
|
39
|
+
expect(site.secret).toBe(`${DEV_PHRASE}//${NAMES[index]}`);
|
|
19
40
|
expect(site.address).toBe(getPair(site.secret).address);
|
|
20
41
|
expect(site.pair?.address).toBe(site.address);
|
|
21
42
|
}
|
|
@@ -31,12 +52,20 @@ describe("getDefaultSiteKeys", SLOW, () => {
|
|
|
31
52
|
expect(site.settings.frictionlessThreshold.frictionlessPuzzleThreshold).toBe(0.8);
|
|
32
53
|
}
|
|
33
54
|
});
|
|
55
|
+
it("turns on the icon-order and audio feature flags for their demo sites only", () => {
|
|
56
|
+
const flags = getDefaultSiteKeys().map((site) => site.settings.captchaTypeFeatureFlags);
|
|
57
|
+
expect(flags).toEqual(NAMES.map((name) => name === "iconOrder"
|
|
58
|
+
? { iconOrder: true }
|
|
59
|
+
: name === "audio"
|
|
60
|
+
? { audio: true }
|
|
61
|
+
: undefined));
|
|
62
|
+
});
|
|
34
63
|
it("returns a fresh array each call, so callers cannot corrupt the seed", () => {
|
|
35
64
|
const first = getDefaultSiteKeys();
|
|
36
65
|
const second = getDefaultSiteKeys();
|
|
37
66
|
expect(first).not.toBe(second);
|
|
38
67
|
first.pop();
|
|
39
|
-
expect(second).toHaveLength(
|
|
68
|
+
expect(second).toHaveLength(NAMES.length);
|
|
40
69
|
});
|
|
41
70
|
});
|
|
42
71
|
describe("getDefaultProviders", SLOW, () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testAccounts.test.js","sourceRoot":"","sources":["../../src/accounts/testAccounts.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACj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E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,CAC7C,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CACjC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACxD,MAAM,aAAa,GAAG,IAAI,GAAG,CAC5B,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAChD,CAAC;QACF,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CACtE,KAAK,CACL,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -2,16 +2,29 @@ const require_keyring = require("../keyring/keyring.cjs");
|
|
|
2
2
|
const require_getPair = require("./getPair.cjs");
|
|
3
3
|
let _prosopo_types = require("@prosopo/types");
|
|
4
4
|
//#region src/accounts/testAccounts.ts
|
|
5
|
+
var seed = (captchaType, name = captchaType, audioAccessibilityEnabled = false) => ({
|
|
6
|
+
name,
|
|
7
|
+
captchaType,
|
|
8
|
+
audioAccessibilityEnabled
|
|
9
|
+
});
|
|
5
10
|
function getDefaultSiteKeys() {
|
|
6
|
-
const
|
|
7
|
-
_prosopo_types.CaptchaType.image,
|
|
8
|
-
_prosopo_types.CaptchaType.pow,
|
|
9
|
-
_prosopo_types.CaptchaType.frictionless,
|
|
10
|
-
|
|
11
|
+
const seeds = [
|
|
12
|
+
seed(_prosopo_types.CaptchaType.image),
|
|
13
|
+
seed(_prosopo_types.CaptchaType.pow),
|
|
14
|
+
seed(_prosopo_types.CaptchaType.frictionless),
|
|
15
|
+
{
|
|
16
|
+
...seed(_prosopo_types.CaptchaType.iconOrder),
|
|
17
|
+
captchaTypeFeatureFlags: { iconOrder: true }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
...seed(_prosopo_types.CaptchaType.image, "audio", true),
|
|
21
|
+
captchaTypeFeatureFlags: { audio: true }
|
|
22
|
+
},
|
|
23
|
+
seed(_prosopo_types.CaptchaType.puzzle)
|
|
11
24
|
];
|
|
12
25
|
const sites = [];
|
|
13
|
-
for (const captchaType of
|
|
14
|
-
const secret = `${require_keyring.DEV_PHRASE}//${
|
|
26
|
+
for (const { name, captchaType, audioAccessibilityEnabled, captchaTypeFeatureFlags } of seeds) {
|
|
27
|
+
const secret = `${require_keyring.DEV_PHRASE}//${name}`;
|
|
15
28
|
const pair = require_getPair.getPair(secret);
|
|
16
29
|
sites.push({
|
|
17
30
|
pair,
|
|
@@ -19,9 +32,11 @@ function getDefaultSiteKeys() {
|
|
|
19
32
|
secret,
|
|
20
33
|
settings: _prosopo_types.ClientSettingsSchema.parse({
|
|
21
34
|
captchaType,
|
|
35
|
+
audioAccessibilityEnabled,
|
|
22
36
|
domains: ["localhost"],
|
|
23
37
|
imageMaxRounds: 2,
|
|
24
|
-
frictionlessThreshold: .8
|
|
38
|
+
frictionlessThreshold: .8,
|
|
39
|
+
...captchaTypeFeatureFlags && { captchaTypeFeatureFlags }
|
|
25
40
|
})
|
|
26
41
|
});
|
|
27
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/keyring",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.3",
|
|
4
4
|
"description": "Keypair generator for Prosopo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@polkadot/util": "14.0.3",
|
|
31
|
-
"@prosopo/common": "3.1.
|
|
32
|
-
"@prosopo/types": "5.
|
|
31
|
+
"@prosopo/common": "3.1.64",
|
|
32
|
+
"@prosopo/types": "5.15.0",
|
|
33
33
|
"@prosopo/util": "3.3.14",
|
|
34
34
|
"@prosopo/util-crypto": "13.6.0",
|
|
35
35
|
"dotenv": "16.4.5"
|