@prosopo/cli 3.6.76 → 3.6.77

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/cli@3.6.76 build:cjs
2
+ > @prosopo/cli@3.6.77 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -90,4 +90,4 @@ dist/cjs/RateLimiter.cjs 5.41 kB │ gzip: 0.84 kB
90
90
   │ ╰─────── This `import.meta` will be replaced with an empty object (`{}`) automatically. If this is desired, you can suppress this warning by adding `transform.define: { 'import.meta': {} }`. If `import.meta` needs to be kept as-is, you need to set the output format to `esm`.
91
91
  ────╯
92
92
  
93
- ✓ built in 54ms
93
+ ✓ built in 51ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/cli@3.6.76 build:tsc
2
+ > @prosopo/cli@3.6.77 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 12:37:19 PM - Projects in this build:
5
+ 11:41:35 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -28,53 +28,53 @@
28
28
  * ../../dev/workspace/tsconfig.json
29
29
  * tsconfig.json
30
30
 
31
- 12:37:19 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/index.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
31
+ 11:41:35 PM - 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'
32
32
 
33
- 12:37:19 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
33
+ 11:41:35 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
34
34
 
35
- 12:37:19 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
35
+ 11:41:35 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
36
36
 
37
- 12:37:19 PM - 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'
37
+ 11:41:35 PM - 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'
38
38
 
39
- 12:37:19 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
39
+ 11:41:35 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
40
40
 
41
- 12:37:19 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
+ 11:41:35 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
42
42
 
43
- 12:37:19 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
43
+ 11:41:35 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
44
44
 
45
- 12:37:19 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
45
+ 11:41:35 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
46
46
 
47
- 12:37:19 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
47
+ 11:41:35 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/env.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
48
48
 
49
- 12:37:19 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
49
+ 11:41:35 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
50
50
 
51
- 12:37:19 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/tests/apiRoute.unit.test.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
51
+ 11:41:35 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/index.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
52
52
 
53
- 12:37:19 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
53
+ 11:41:35 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
54
54
 
55
- 12:37:19 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
55
+ 11:41:35 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
56
56
 
57
- 12:37:19 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/types/bannedDomain.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
57
+ 11:41:35 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/types/captcha.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
58
58
 
59
- 12:37:19 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/redisCacheEscalation.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
59
+ 11:41:35 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/mongoGlobalSetup.ts' is older than output '../database/tsconfig.tsbuildinfo'
60
60
 
61
- 12:37:19 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
61
+ 11:41:35 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
62
62
 
63
- 12:37:19 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/index.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
63
+ 11:41:35 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/env.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
64
64
 
65
- 12:37:20 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
65
+ 11:41:36 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/index.ts' is older than output '../env/tsconfig.tsbuildinfo'
66
66
 
67
- 12:37:20 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/tests/unit/testDoubles.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
67
+ 11:41:36 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/middlewares/requestLoggerMiddleware.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
68
68
 
69
- 12:37:20 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
69
+ 11:41:36 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
70
70
 
71
- 12:37:20 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/providers.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
71
+ 11:41:36 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
72
72
 
73
- 12:37:20 PM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/utils/normalizeRequestIp.ts' is older than output '../provider/tsconfig.tsbuildinfo'
73
+ 11:41:36 PM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/util.ts' is older than output '../provider/tsconfig.tsbuildinfo'
74
74
 
75
- 12:37:20 PM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/projectInfo.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
75
+ 11:41:36 PM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/index.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
76
76
 
77
- 12:37:20 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
77
+ 11:41:36 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
78
78
 
79
- 12:37:20 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
79
+ 11:41:36 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
80
80
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/cli@3.6.76 build
2
+ > @prosopo/cli@3.6.77 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/cli@3.6.76 build:cross-env
6
+ > @prosopo/cli@3.6.77 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -86,4 +86,4 @@ dist/commands/siteKeyRegister.js 3.30 kB │ gzip: 1.14 kB
86
86
  dist/prosopo.config.js 4.43 kB │ gzip: 1.47 kB
87
87
  dist/RateLimiter.js 5.00 kB │ gzip: 0.84 kB
88
88
 
89
- ✓ built in 63ms
89
+ ✓ built in 56ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @prosopo/cli
2
2
 
3
+ ## 3.6.77
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [71a5952]
7
+ - Updated dependencies [a66273a]
8
+ - @prosopo/keyring@2.9.62
9
+ - @prosopo/provider@4.15.17
10
+ - @prosopo/env@3.6.22
11
+
3
12
  ## 3.6.76
4
13
  ### Patch Changes
5
14
 
@@ -1152,7 +1152,7 @@ function Jt(e, t, n) {
1152
1152
  }
1153
1153
  //#endregion
1154
1154
  //#region ../util/dist/version.js
1155
- var Yt = (typeof process < "u" ? "3.6.76" : void 0) || "dev", Xt = Array(256), Zt = Array(256 * 256);
1155
+ var Yt = (typeof process < "u" ? "3.6.77" : void 0) || "dev", Xt = Array(256), Zt = Array(256 * 256);
1156
1156
  for (let e = 0; e < 256; e++) Xt[e] = e.toString(16).padStart(2, "0");
1157
1157
  for (let e = 0; e < 256; e++) {
1158
1158
  let t = e << 8;
@@ -75745,8 +75745,8 @@ var G2 = async (e, t) => {
75745
75745
  i18n: n.i18n,
75746
75746
  logger: n.logger
75747
75747
  }));
75748
- let c = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, h = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, g = XZ(de(n.headers), n.ja4, o, l, void 0, void 0, c, h), _ = (await m.imgCaptchaManager.getPrioritisedAccessPolicies(t, u, g)).find((e) => !e.deferToVerify), { valid: v, reason: y, sessionId: b, solvedImagesCount: x } = await m.imgCaptchaManager.isValidRequest(a, Zp.image, e, d, _, o);
75749
- if (!v) return i(new Ep(y || "API.BAD_REQUEST", {
75748
+ let c = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, h = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, g = d ? await m.db.getSessionRecordBySessionId(d) : void 0, _ = XZ(de(n.headers), n.ja4, o, l, g?.decryptedHeadHash, void 0, c, h), v = (await m.imgCaptchaManager.getPrioritisedAccessPolicies(t, u, _)).find((e) => !e.deferToVerify), { valid: y, reason: b, sessionId: x, solvedImagesCount: S } = await m.imgCaptchaManager.isValidRequest(a, Zp.image, e, d, v, o);
75749
+ if (!y) return i(new Ep(b || "API.BAD_REQUEST", {
75750
75750
  context: {
75751
75751
  code: 400,
75752
75752
  siteKey: u,
@@ -75755,38 +75755,38 @@ var G2 = async (e, t) => {
75755
75755
  i18n: n.i18n,
75756
75756
  logger: n.logger
75757
75757
  }));
75758
- let S = {
75759
- solved: { count: Math.min(x || _?.solvedImagesCount || e.config.captchas.solved.count, a.settings.imageMaxRounds ?? 32) },
75760
- unsolved: { count: _?.unsolvedImagesCount || e.config.captchas.unsolved.count }
75758
+ let C = {
75759
+ solved: { count: Math.min(S || v?.solvedImagesCount || e.config.captchas.solved.count, a.settings.imageMaxRounds ?? 32) },
75760
+ unsolved: { count: v?.unsolvedImagesCount || e.config.captchas.unsolved.count }
75761
75761
  };
75762
- b && f && await m.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(b, f, vg.challenge).catch((e) => {
75762
+ x && f && await m.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(x, f, vg.challenge).catch((e) => {
75763
75763
  n.logger.warn(() => ({
75764
75764
  err: e,
75765
75765
  msg: "Failed to patch session with SIMD readings on image challenge"
75766
75766
  }));
75767
75767
  });
75768
- let C = await m.imgCaptchaManager.getRandomCaptchasAndRequestHash(p, l, s, S, a.settings.imageThreshold ?? .8, b, n.ipInfo), w = {
75768
+ let w = await m.imgCaptchaManager.getRandomCaptchasAndRequestHash(p, l, s, C, a.settings.imageThreshold ?? .8, x, n.ipInfo), T = {
75769
75769
  [X.status]: "ok",
75770
- [X.captchas]: C.captchas.map((t) => ({
75770
+ [X.captchas]: w.captchas.map((t) => ({
75771
75771
  ...t,
75772
75772
  target: n.t(`TARGET.${t.target}`),
75773
75773
  items: t.items.map((t) => f0(t, e.assetsResolver))
75774
75774
  })),
75775
- [X.requestHash]: C.requestHash,
75776
- [X.timestamp]: C.timestamp.toString(),
75777
- [X.signature]: { [X.provider]: { [X.requestHash]: C.signedRequestHash } }
75775
+ [X.requestHash]: w.requestHash,
75776
+ [X.timestamp]: w.timestamp.toString(),
75777
+ [X.signature]: { [X.provider]: { [X.requestHash]: w.signedRequestHash } }
75778
75778
  };
75779
75779
  return n.logger.info(() => ({
75780
75780
  msg: "Image captcha challenge issued",
75781
75781
  data: {
75782
75782
  captchaType: Zp.image,
75783
- requestHash: C.requestHash,
75784
- solvedImagesCount: S.solved.count,
75783
+ requestHash: w.requestHash,
75784
+ solvedImagesCount: C.solved.count,
75785
75785
  user: l,
75786
75786
  dapp: u,
75787
75787
  sessionId: d
75788
75788
  }
75789
- })), LZ(Zp.image), r.json(w);
75789
+ })), LZ(Zp.image), r.json(T);
75790
75790
  } catch (e) {
75791
75791
  return RZ(Zp.image), n.logger.error(() => ({
75792
75792
  err: e,
@@ -75838,8 +75838,8 @@ var G2 = async (e, t) => {
75838
75838
  }));
75839
75839
  let d = y2(n.ip, n.logger);
75840
75840
  d || n.logger.warn(() => ({ msg: "Request missing IP; geoblocking will be skipped" }));
75841
- let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = XZ(de(n.headers), n.ja4, d, o, void 0, void 0, f, p), h = (await u.powCaptchaManager.getPrioritisedAccessPolicies(t, s, m)).find((e) => !e.deferToVerify), { valid: g, reason: _, sessionId: v, powDifficulty: y } = await u.powCaptchaManager.isValidRequest(a, Zp.pow, e, c, h, d);
75842
- if (!g) return i(new Ep(_ || "API.BAD_REQUEST", {
75841
+ let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = c ? await u.db.getSessionRecordBySessionId(c) : void 0, h = XZ(de(n.headers), n.ja4, d, o, m?.decryptedHeadHash, void 0, f, p), g = (await u.powCaptchaManager.getPrioritisedAccessPolicies(t, s, h)).find((e) => !e.deferToVerify), { valid: _, reason: v, sessionId: y, powDifficulty: b } = await u.powCaptchaManager.isValidRequest(a, Zp.pow, e, c, g, d);
75842
+ if (!_) return i(new Ep(v || "API.BAD_REQUEST", {
75843
75843
  context: {
75844
75844
  code: 400,
75845
75845
  siteKey: s,
@@ -75848,8 +75848,8 @@ var G2 = async (e, t) => {
75848
75848
  i18n: n.i18n,
75849
75849
  logger: n.logger
75850
75850
  }));
75851
- let b = n.headers.origin;
75852
- if (!b) return i(new Ep("API.BAD_REQUEST", {
75851
+ let x = n.headers.origin;
75852
+ if (!x) return i(new Ep("API.BAD_REQUEST", {
75853
75853
  context: {
75854
75854
  error: "Origin header not found",
75855
75855
  code: 400,
@@ -75859,35 +75859,35 @@ var G2 = async (e, t) => {
75859
75859
  i18n: n.i18n,
75860
75860
  logger: n.logger
75861
75861
  }));
75862
- let x = y || h?.powDifficulty || a?.settings?.powDifficulty, S = await u.powCaptchaManager.getPowCaptchaChallenge(o, s, b, x);
75863
- v && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(v, l, vg.challenge).catch((e) => {
75862
+ let S = b || g?.powDifficulty || a?.settings?.powDifficulty, C = await u.powCaptchaManager.getPowCaptchaChallenge(o, s, x, S);
75863
+ y && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(y, l, vg.challenge).catch((e) => {
75864
75864
  n.logger.warn(() => ({
75865
75865
  err: e,
75866
75866
  msg: "Failed to patch session with SIMD readings on PoW challenge"
75867
75867
  }));
75868
- }), await u.db.storePowCaptchaRecord(S.challenge, {
75869
- requestedAtTimestamp: S.requestedAtTimestamp,
75868
+ }), await u.db.storePowCaptchaRecord(C.challenge, {
75869
+ requestedAtTimestamp: C.requestedAtTimestamp,
75870
75870
  userAccount: o,
75871
75871
  dappAccount: s
75872
- }, S.difficulty, S.providerSignature, zq(d), de(n.headers), n.ja4, v, void 0, void 0, void 0, n.ipInfo);
75873
- let C = {
75872
+ }, C.difficulty, C.providerSignature, zq(d), de(n.headers), n.ja4, y, void 0, void 0, void 0, n.ipInfo);
75873
+ let w = {
75874
75874
  [X.status]: "ok",
75875
- [X.challenge]: S.challenge,
75876
- [X.difficulty]: S.difficulty,
75877
- [X.timestamp]: S.requestedAtTimestamp.toString(),
75878
- [X.signature]: { [X.provider]: { [X.challenge]: S.providerSignature } }
75875
+ [X.challenge]: C.challenge,
75876
+ [X.difficulty]: C.difficulty,
75877
+ [X.timestamp]: C.requestedAtTimestamp.toString(),
75878
+ [X.signature]: { [X.provider]: { [X.challenge]: C.providerSignature } }
75879
75879
  };
75880
75880
  return n.logger.info(() => ({
75881
75881
  msg: "PoW captcha challenge issued",
75882
75882
  data: {
75883
75883
  captchaType: Zp.pow,
75884
- challenge: S.challenge,
75885
- difficulty: S.difficulty,
75884
+ challenge: C.challenge,
75885
+ difficulty: C.difficulty,
75886
75886
  user: o,
75887
75887
  dapp: s,
75888
75888
  session: c
75889
75889
  }
75890
- })), LZ(Zp.pow), r.json(C);
75890
+ })), LZ(Zp.pow), r.json(w);
75891
75891
  } catch (e) {
75892
75892
  return RZ(Zp.pow), n.logger.error(() => ({
75893
75893
  err: e,
@@ -75940,8 +75940,8 @@ var G2 = async (e, t) => {
75940
75940
  }));
75941
75941
  let d = y2(n.ip, n.logger);
75942
75942
  d || n.logger.warn(() => ({ msg: "Request missing IP; geoblocking will be skipped" }));
75943
- let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = XZ(de(n.headers), n.ja4, d, o, void 0, void 0, f, p), h = (await u.puzzleCaptchaManager.getPrioritisedAccessPolicies(t, s, m)).find((e) => !e.deferToVerify), { valid: g, reason: _, sessionId: v } = await u.puzzleCaptchaManager.isValidRequest(a, Zp.puzzle, e, c, h, d);
75944
- if (!g) return i(new Ep(_ || "API.BAD_REQUEST", {
75943
+ let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = c ? await u.db.getSessionRecordBySessionId(c) : void 0, h = XZ(de(n.headers), n.ja4, d, o, m?.decryptedHeadHash, void 0, f, p), g = (await u.puzzleCaptchaManager.getPrioritisedAccessPolicies(t, s, h)).find((e) => !e.deferToVerify), { valid: _, reason: v, sessionId: y } = await u.puzzleCaptchaManager.isValidRequest(a, Zp.puzzle, e, c, g, d);
75944
+ if (!_) return i(new Ep(v || "API.BAD_REQUEST", {
75945
75945
  context: {
75946
75946
  code: 400,
75947
75947
  siteKey: s,
@@ -75950,8 +75950,8 @@ var G2 = async (e, t) => {
75950
75950
  i18n: n.i18n,
75951
75951
  logger: n.logger
75952
75952
  }));
75953
- let y = n.headers.origin;
75954
- if (!y) return i(new Ep("API.BAD_REQUEST", {
75953
+ let b = n.headers.origin;
75954
+ if (!b) return i(new Ep("API.BAD_REQUEST", {
75955
75955
  context: {
75956
75956
  error: "Origin header not found",
75957
75957
  code: 400,
@@ -75961,39 +75961,39 @@ var G2 = async (e, t) => {
75961
75961
  i18n: n.i18n,
75962
75962
  logger: n.logger
75963
75963
  }));
75964
- let b = a?.settings?.puzzleTolerance, x = await u.puzzleCaptchaManager.getPuzzleCaptchaChallenge(o, s, y, b);
75965
- v && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(v, l, vg.challenge).catch((e) => {
75964
+ let x = a?.settings?.puzzleTolerance, S = await u.puzzleCaptchaManager.getPuzzleCaptchaChallenge(o, s, b, x);
75965
+ y && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(y, l, vg.challenge).catch((e) => {
75966
75966
  n.logger.warn(() => ({
75967
75967
  err: e,
75968
75968
  msg: "Failed to patch session with SIMD readings on puzzle challenge"
75969
75969
  }));
75970
- }), await u.db.storePuzzleCaptchaRecord(x.challenge, {
75971
- requestedAtTimestamp: x.requestedAtTimestamp,
75970
+ }), await u.db.storePuzzleCaptchaRecord(S.challenge, {
75971
+ requestedAtTimestamp: S.requestedAtTimestamp,
75972
75972
  userAccount: o,
75973
75973
  dappAccount: s
75974
- }, x.targetX, x.targetY, x.originX, x.originY, x.tolerance, x.providerSignature, zq(d), de(n.headers), n.ja4, v, n.ipInfo);
75975
- let S = {
75974
+ }, S.targetX, S.targetY, S.originX, S.originY, S.tolerance, S.providerSignature, zq(d), de(n.headers), n.ja4, y, n.ipInfo);
75975
+ let C = {
75976
75976
  [X.status]: "ok",
75977
- [X.challenge]: x.challenge,
75978
- [X.targetX]: x.targetX,
75979
- [X.targetY]: x.targetY,
75980
- [X.originX]: x.originX,
75981
- [X.originY]: x.originY,
75982
- [X.tolerance]: x.tolerance,
75983
- [X.timestamp]: x.requestedAtTimestamp.toString(),
75984
- [X.signature]: { [X.provider]: { [X.challenge]: x.providerSignature } }
75977
+ [X.challenge]: S.challenge,
75978
+ [X.targetX]: S.targetX,
75979
+ [X.targetY]: S.targetY,
75980
+ [X.originX]: S.originX,
75981
+ [X.originY]: S.originY,
75982
+ [X.tolerance]: S.tolerance,
75983
+ [X.timestamp]: S.requestedAtTimestamp.toString(),
75984
+ [X.signature]: { [X.provider]: { [X.challenge]: S.providerSignature } }
75985
75985
  };
75986
75986
  return n.logger.info(() => ({
75987
75987
  msg: "Puzzle captcha challenge issued",
75988
75988
  data: {
75989
75989
  captchaType: Zp.puzzle,
75990
- challenge: x.challenge,
75991
- tolerance: x.tolerance,
75990
+ challenge: S.challenge,
75991
+ tolerance: S.tolerance,
75992
75992
  user: o,
75993
75993
  dapp: s,
75994
75994
  session: c
75995
75995
  }
75996
- })), LZ(Zp.puzzle), r.json(S);
75996
+ })), LZ(Zp.puzzle), r.json(C);
75997
75997
  } catch (e) {
75998
75998
  return RZ(Zp.puzzle), n.logger.error(() => ({
75999
75999
  err: e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/cli",
3
- "version": "3.6.76",
3
+ "version": "3.6.77",
4
4
  "description": "CLI for Prosopo Provider",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  "@prosopo/common": "3.1.48",
37
37
  "@prosopo/logger": "2.0.4",
38
38
  "@prosopo/dotenv": "3.0.50",
39
- "@prosopo/env": "3.6.21",
40
- "@prosopo/keyring": "2.9.61",
39
+ "@prosopo/env": "3.6.22",
40
+ "@prosopo/keyring": "2.9.62",
41
41
  "@prosopo/locale": "3.2.8",
42
- "@prosopo/provider": "4.15.16",
42
+ "@prosopo/provider": "4.15.17",
43
43
  "@prosopo/types": "4.10.0",
44
44
  "@prosopo/util": "3.3.5",
45
45
  "@prosopo/workspace": "3.2.0",