@prosopo/cli 3.7.2 → 3.7.5

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.7.2 build:cjs
2
+ > @prosopo/cli@3.7.5 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.42 kB │ gzip: 0.88 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 64ms
93
+ ✓ built in 69ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/cli@3.7.2 build:tsc
2
+ > @prosopo/cli@3.7.5 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 1:58:13 PM - Projects in this build:
5
+ 5:54:07 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
- 1:58:13 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'
31
+ 5:54:07 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
- 1:58:13 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
33
+ 5:54:07 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
- 1:58:13 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
35
+ 5:54:07 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
- 1:58:13 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
+ 5:54:07 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
- 1:58:13 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
39
+ 5:54:07 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
40
40
 
41
- 1:58:13 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
+ 5:54:07 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
- 1:58:13 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
43
+ 5:54:07 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
- 1:58:13 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
45
+ 5:54:07 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
- 1:58:13 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/tests/env.unit.test.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
47
+ 5:54:07 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
- 1:58:13 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/types.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
49
+ 5:54:07 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
- 1:58:14 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
51
+ 5:54:07 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
52
52
 
53
- 1:58:14 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/redisClient.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
53
+ 5:54:07 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/redisClient.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
54
54
 
55
- 1:58:14 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/ruleRecord.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
55
+ 5:54:07 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/ruleRecord.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
56
56
 
57
- 1:58:14 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/types.test-d.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
57
+ 5:54:07 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
- 1:58:14 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
+ 5:54:07 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'
60
60
 
61
- 1:58:14 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
61
+ 5:54:07 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
62
62
 
63
- 1:58:14 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
+ 5:54:07 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
- 1:58:14 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
65
+ 5:54:07 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
- 1:58:14 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'
67
+ 5:54:07 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
- 1:58:14 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
69
+ 5:54:07 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
70
70
 
71
- 1:58:14 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/index.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
71
+ 5:54:07 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
- 1:58:14 PM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/util.ts' is older than output '../provider/tsconfig.tsbuildinfo'
73
+ 5:54:07 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
- 1:58:14 PM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/tests/projectInfo.unit.test.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
75
+ 5:54:07 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
- 1:58:14 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
77
+ 5:54:07 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
78
78
 
79
- 1:58:14 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
79
+ 5:54:07 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
80
80
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/cli@3.7.2 build
2
+ > @prosopo/cli@3.7.5 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/cli@3.7.2 build:cross-env
6
+ > @prosopo/cli@3.7.5 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.02 kB │ gzip: 0.87 kB
88
88
 
89
- ✓ built in 75ms
89
+ ✓ built in 54ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @prosopo/cli
2
2
 
3
+ ## 3.7.5
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [d6cb841]
7
+ - Updated dependencies [fa0d494]
8
+ - Updated dependencies [d6cb841]
9
+ - @prosopo/provider@5.0.3
10
+ - @prosopo/types@5.0.2
11
+ - @prosopo/env@3.6.26
12
+ - @prosopo/api@4.0.2
13
+ - @prosopo/keyring@2.9.65
14
+
15
+ ## 3.7.4
16
+ ### Patch Changes
17
+
18
+ - @prosopo/env@3.6.25
19
+ - @prosopo/provider@5.0.2
20
+
21
+ ## 3.7.3
22
+ ### Patch Changes
23
+
24
+ - b3f3807: Bump `@prosopo/cli` so the frictionless detector-logging fix can ship as a release.
25
+
26
+ There is no cli change here. This exists purely to move the release number, and
27
+ the reason is structural rather than incidental.
28
+
29
+ `create_release_pr` sets the root and `docker/images/provider` versions to
30
+ whatever `@prosopo/cli` is after `changeset version`. The only pending changeset
31
+ bumps `@prosopo/procaptcha-frictionless` (2.13.2 → 2.13.3) and
32
+ `@prosopo/procaptcha-bundle` (4.1.46 → 4.1.47). Neither is in cli's dependency
33
+ tree — cli depends on `@prosopo/provider`, `api`, `types` and friends, which is
34
+ why ordinary releases bump it by cascade and this one does not. So
35
+ `changeset version` leaves cli, and therefore the root, at 3.7.2, the release PR
36
+ comes out titled "Release v3.7.2" again, and no new tag is cut.
37
+
38
+ That matters beyond a cosmetic version number, because captcha-private's own
39
+ `create_release_pr` derives its version from this repo's latest `v*.*.*` tag and
40
+ then **checks the submodule out at it**. Without a new tag it would pin the
41
+ submodule back to v3.7.2 — reverting the very fix this release is meant to carry.
42
+
43
+ The provider image published for this release is therefore functionally
44
+ identical to 3.7.2; the payload is the widget bundle.
45
+
3
46
  ## 3.7.2
4
47
  ### Patch Changes
5
48
 
@@ -1152,7 +1152,7 @@ function rn(e, t, n) {
1152
1152
  }
1153
1153
  //#endregion
1154
1154
  //#region ../util/dist/version.js
1155
- var an = (typeof process < "u" ? "3.7.2" : void 0) || "dev", on = Array(256), sn = Array(256 * 256);
1155
+ var an = (typeof process < "u" ? "3.7.5" : void 0) || "dev", on = Array(256), sn = Array(256 * 256);
1156
1156
  for (let e = 0; e < 256; e++) on[e] = e.toString(16).padStart(2, "0");
1157
1157
  for (let e = 0; e < 256; e++) {
1158
1158
  let t = e << 8;
@@ -10494,6 +10494,7 @@ J({
10494
10494
  webView: bi(),
10495
10495
  iFrame: bi(),
10496
10496
  isEscalation: bi().optional(),
10497
+ originSessionId: K().optional(),
10497
10498
  decryptedHeadHash: K(),
10498
10499
  siteKey: K().optional(),
10499
10500
  currentUrl: K().optional(),
@@ -51125,6 +51126,10 @@ var yF = new rN.Schema({
51125
51126
  type: Boolean,
51126
51127
  required: !1
51127
51128
  },
51129
+ originSessionId: {
51130
+ type: String,
51131
+ required: !1
51132
+ },
51128
51133
  decryptedHeadHash: {
51129
51134
  type: String,
51130
51135
  required: !1,
@@ -65822,7 +65827,9 @@ var sK = (e, t) => _.createHash(t).update(JSON.stringify(e, (e, t) => typeof t =
65822
65827
  solvedImagesCount: 1,
65823
65828
  userSitekeyIpHash: 1,
65824
65829
  simdReadings: 1,
65830
+ bundleId: 1,
65825
65831
  dnsEvent: 1,
65832
+ originSessionId: 1,
65826
65833
  currentUrl: 1,
65827
65834
  iframeUrl: 1,
65828
65835
  captchaType: 1,
@@ -70755,6 +70762,23 @@ var HQ = (e) => e.find((e) => e.deferToVerify === !0 || e.type === IG.Block && !
70755
70762
  let { timestamp: r, ...i } = n;
70756
70763
  return i;
70757
70764
  }
70765
+ async getSessionRecordWithOriginFallback(e) {
70766
+ let t = await this.db.getSessionRecordBySessionId(e);
70767
+ if (!t) return;
70768
+ if (!t.originSessionId) return t;
70769
+ let n = t.simdReadings === void 0 || t.simdReadings === null, r = t.dnsEvent === void 0 || t.dnsEvent === null, i = t.entropyMathRandomFingerprint === void 0, a = t.entropyCryptoFingerprint === void 0, o = t.entropyWallClockOffsetMs === void 0, s = t.entropyMathRandomFirst === void 0;
70770
+ if (!n && !r && !i && !a && !o && !s) return t;
70771
+ let c = await this.db.getSessionRecordBySessionId(t.originSessionId);
70772
+ return c ? {
70773
+ ...t,
70774
+ ...n && c.simdReadings && { simdReadings: c.simdReadings },
70775
+ ...r && c.dnsEvent && { dnsEvent: c.dnsEvent },
70776
+ ...i && c.entropyMathRandomFingerprint !== void 0 && { entropyMathRandomFingerprint: c.entropyMathRandomFingerprint },
70777
+ ...a && c.entropyCryptoFingerprint !== void 0 && { entropyCryptoFingerprint: c.entropyCryptoFingerprint },
70778
+ ...o && c.entropyWallClockOffsetMs !== void 0 && { entropyWallClockOffsetMs: c.entropyWallClockOffsetMs },
70779
+ ...s && c.entropyMathRandomFirst !== void 0 && { entropyMathRandomFirst: c.entropyMathRandomFirst }
70780
+ } : t;
70781
+ }
70758
70782
  async decryptAndAttachSimdReadingsIfAbsent(e, t, n) {
70759
70783
  let r = await this.resolveBundleBySessionId(e), i = await this.decryptSimdReadingsForAttach(t, r);
70760
70784
  i && await this.recordSessionSimdReadingsIfAbsentWithCache(e, i, n);
@@ -70793,18 +70817,7 @@ var HQ = (e) => e.find((e) => e.deferToVerify === !0 || e.type === IG.Block && !
70793
70817
  captchaType: t,
70794
70818
  sessionId: r
70795
70819
  }
70796
- })), i?.captchaType !== void 0 && i.captchaType !== t) return this.logger.warn(() => ({
70797
- msg: "Invalid captcha type for user access policy",
70798
- data: {
70799
- account: e.account,
70800
- captchaType: i.captchaType
70801
- }
70802
- })), {
70803
- valid: !1,
70804
- reason: yg.INCORRECT_CAPTCHA_TYPE,
70805
- type: t
70806
- };
70807
- if (r) {
70820
+ })), r) {
70808
70821
  let i = this.writeQueue ? await this.writeQueue.getCachedSession(r) : null, o = typeof i?.userSitekeyIpHash == "string" ? i.userSitekeyIpHash : void 0;
70809
70822
  await Promise.all([this.writeQueue?.invalidateCachedSession(r), o ? this.writeQueue?.invalidateCachedSessionByHash(o) : Promise.resolve()]);
70810
70823
  let s = await this.db.checkAndRemoveSession(r), c = r;
@@ -70887,7 +70900,18 @@ var HQ = (e) => e.find((e) => e.deferToVerify === !0 || e.type === IG.Block && !
70887
70900
  type: t
70888
70901
  });
70889
70902
  }
70890
- return e?.settings?.captchaType === t ? {
70903
+ return i?.captchaType !== void 0 && i.captchaType !== t ? (this.logger.warn(() => ({
70904
+ msg: "Invalid captcha type for user access policy (sessionless)",
70905
+ data: {
70906
+ account: e.account,
70907
+ captchaType: i.captchaType,
70908
+ requestedCaptchaType: t
70909
+ }
70910
+ })), {
70911
+ valid: !1,
70912
+ reason: yg.INCORRECT_CAPTCHA_TYPE,
70913
+ type: t
70914
+ }) : e?.settings?.captchaType === t ? {
70891
70915
  valid: !0,
70892
70916
  type: t
70893
70917
  } : (this.logger.warn(() => ({
@@ -71946,8 +71970,8 @@ var b1 = 600 * 1e3, x1 = (e) => e ? e.replace(".prosopo.io", "") : "local", S1 =
71946
71970
  checkLangRules(e) {
71947
71971
  return hQ(this.config, e);
71948
71972
  }
71949
- async createSession(e, t, n, r, i, a, o, s, c, l, u = !1, d = !1, f = "", p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A) {
71950
- let j = {
71973
+ async createSession(e, t, n, r, i, a, o, s, c, l, u = !1, d = !1, f = "", p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j) {
71974
+ let M = {
71951
71975
  sessionId: `${x1(this.config.host)}-${v1()}`,
71952
71976
  createdAt: /* @__PURE__ */ new Date(),
71953
71977
  token: e,
@@ -71963,6 +71987,7 @@ var b1 = 600 * 1e3, x1 = (e) => e ? e.replace(".prosopo.io", "") : "local", S1 =
71963
71987
  webView: u,
71964
71988
  iFrame: d,
71965
71989
  ...O && { isEscalation: !0 },
71990
+ ...j && { originSessionId: j },
71966
71991
  decryptedHeadHash: f,
71967
71992
  bundleId: w,
71968
71993
  reason: p,
@@ -71983,11 +72008,11 @@ var b1 = 600 * 1e3, x1 = (e) => e ? e.replace(".prosopo.io", "") : "local", S1 =
71983
72008
  tcpToChelloUs: E,
71984
72009
  chelloToHandshakeUs: D
71985
72010
  };
71986
- if (await this.db.storeSessionRecord(j), this.writeQueue) {
71987
- let e = j, t = [this.writeQueue.cacheSession(j.sessionId, e)];
71988
- l && t.push(this.writeQueue.cacheSessionByHash(l, j.sessionId)), await Promise.all(t).catch(() => {});
72011
+ if (await this.db.storeSessionRecord(M), this.writeQueue) {
72012
+ let e = M, t = [this.writeQueue.cacheSession(M.sessionId, e)];
72013
+ l && t.push(this.writeQueue.cacheSessionByHash(l, M.sessionId)), await Promise.all(t).catch(() => {});
71989
72014
  }
71990
- return j;
72015
+ return M;
71991
72016
  }
71992
72017
  async sendImageCaptcha(e) {
71993
72018
  return this.sendCaptcha(Xp.image, e);
@@ -74249,7 +74274,7 @@ var B0 = async (e, t, n) => {
74249
74274
  error: e
74250
74275
  }));
74251
74276
  }
74252
- let S = h.sessionId ? await this.db.getSessionRecordBySessionId(h.sessionId) : void 0, C = await kQ(S?.dnsEvent, r.ipInfoService, a ?? h.ipInfo?.ip);
74277
+ let S = h.sessionId ? await this.getSessionRecordWithOriginFallback(h.sessionId) : void 0, C = await kQ(S?.dnsEvent, r.ipInfoService, a ?? h.ipInfo?.ip);
74253
74278
  if (!y) {
74254
74279
  let e = await this.resolveTrafficFilterCheck(r, h.ipInfo, f, a, C);
74255
74280
  e.isBlocked && (m.info(() => ({
@@ -74635,7 +74660,7 @@ var B0 = async (e, t, n) => {
74635
74660
  error: e
74636
74661
  }));
74637
74662
  }
74638
- let x = p.sessionId ? await this.db.getSessionRecordBySessionId(p.sessionId) : void 0, S = await kQ(x?.dnsEvent, r.ipInfoService, i ?? p.ipInfo?.ip);
74663
+ let x = p.sessionId ? await this.getSessionRecordWithOriginFallback(p.sessionId) : void 0, S = await kQ(x?.dnsEvent, r.ipInfoService, i ?? p.ipInfo?.ip);
74639
74664
  if (!g) {
74640
74665
  let e = await this.resolveTrafficFilterCheck(r, p.ipInfo, l, i, S);
74641
74666
  e.isBlocked && (f.info(() => ({
@@ -74957,7 +74982,7 @@ var B0 = async (e, t, n) => {
74957
74982
  error: e
74958
74983
  }));
74959
74984
  }
74960
- let v = p.sessionId ? await this.db.getSessionRecordBySessionId(p.sessionId) : void 0, y = await kQ(v?.dnsEvent, r.ipInfoService, i ?? p.ipInfo?.ip);
74985
+ let v = p.sessionId ? await this.getSessionRecordWithOriginFallback(p.sessionId) : void 0, y = await kQ(v?.dnsEvent, r.ipInfoService, i ?? p.ipInfo?.ip);
74961
74986
  {
74962
74987
  let e = await this.resolveTrafficFilterCheck(r, p.ipInfo, l, i, y);
74963
74988
  if (e.isBlocked) {
@@ -75939,23 +75964,27 @@ var m4 = async (e, t) => {
75939
75964
  existingToken: i,
75940
75965
  dedup: o
75941
75966
  };
75942
- }, y4 = (e) => ({
75943
- token: e.token || `nodetector-${v1()}`,
75944
- score: 0,
75945
- threshold: e.clientRecord.settings?.frictionlessThreshold ?? .5,
75946
- scoreComponents: { baseScore: 0 },
75947
- ipAddress: e.ipAddress,
75948
- webView: !1,
75949
- iFrame: !1,
75950
- decryptedHeadHash: "",
75951
- siteKey: e.dapp,
75952
- ipInfo: e.ipInfo,
75953
- headers: e.flatHeaders,
75954
- mode: e.sessionMode,
75955
- userSitekeyIpHash: e.userSitekeyIpHash,
75956
- ...e.tcpToChelloUs !== void 0 && { tcpToChelloUs: e.tcpToChelloUs },
75957
- ...e.chelloToHandshakeUs !== void 0 && { chelloToHandshakeUs: e.chelloToHandshakeUs }
75958
- }), b4 = async (e, t) => {
75967
+ }, y4 = async (e) => {
75968
+ let t = e.detectorSessionId ? (await e.tasks.frictionlessManager.resolveBundleByDetectorSession(e.detectorSessionId))?.bundleId : void 0;
75969
+ return {
75970
+ token: e.token || `nodetector-${v1()}`,
75971
+ score: 0,
75972
+ threshold: e.clientRecord.settings?.frictionlessThreshold ?? .5,
75973
+ scoreComponents: { baseScore: 0 },
75974
+ ipAddress: e.ipAddress,
75975
+ webView: !1,
75976
+ iFrame: !1,
75977
+ decryptedHeadHash: "",
75978
+ siteKey: e.dapp,
75979
+ ipInfo: e.ipInfo,
75980
+ headers: e.flatHeaders,
75981
+ mode: e.sessionMode,
75982
+ userSitekeyIpHash: e.userSitekeyIpHash,
75983
+ ...t && { bundleId: t },
75984
+ ...e.tcpToChelloUs !== void 0 && { tcpToChelloUs: e.tcpToChelloUs },
75985
+ ...e.chelloToHandshakeUs !== void 0 && { chelloToHandshakeUs: e.chelloToHandshakeUs }
75986
+ };
75987
+ }, b4 = async (e, t) => {
75959
75988
  let n = SQ();
75960
75989
  return n && n.size() > 0 ? null : (e.logger.warn(() => ({
75961
75990
  msg: "Frictionless decision",
@@ -75964,11 +75993,11 @@ var m4 = async (e, t) => {
75964
75993
  decision: "empty_detector_pool_pow_fallback",
75965
75994
  captchaType: Xp.pow
75966
75995
  }
75967
- })), l4(t, e.clientRecord), t.json(await e.tasks.frictionlessManager.sendPowCaptcha(y4(e))));
75996
+ })), l4(t, e.clientRecord), t.json(await e.tasks.frictionlessManager.sendPowCaptcha(await y4(e))));
75968
75997
  }, x4 = async (e, t) => {
75969
75998
  let n = e.clientRecord.settings?.captchaType;
75970
75999
  if (!n || n === Xp.frictionless) return null;
75971
- let r = y4(e);
76000
+ let r = await y4(e);
75972
76001
  switch (e.logger.info(() => ({
75973
76002
  msg: "Frictionless decision",
75974
76003
  data: {
@@ -76117,6 +76146,7 @@ var m4 = async (e, t) => {
76117
76146
  userSitekeyIpHash: x,
76118
76147
  requestId: n.requestId,
76119
76148
  logger: n.logger,
76149
+ ...d && { detectorSessionId: d },
76120
76150
  ...n.tcpToChelloUs !== void 0 && { tcpToChelloUs: n.tcpToChelloUs },
76121
76151
  ...n.chelloToHandshakeUs !== void 0 && { chelloToHandshakeUs: n.chelloToHandshakeUs }
76122
76152
  }, j = await x4(A, r);
@@ -76731,7 +76761,7 @@ var m4 = async (e, t) => {
76731
76761
  if (!a?.sessionId) return;
76732
76762
  let o = await e.db.getSessionRecordBySessionId(a.sessionId);
76733
76763
  if (!o) return;
76734
- let s = t.routingOutput, c = s.reason ?? o.reason, l = await e.frictionlessManager.createSession(o.token, o.score, o.threshold, o.scoreComponents, o.ipAddress, s.captchaType, o.siteKey ?? a.dappAccount, s.captchaType === Xp.image ? s.solvedImagesCount ?? o.solvedImagesCount : void 0, void 0, o.userSitekeyIpHash, o.webView, o.iFrame, o.decryptedHeadHash, c, void 0, void 0, o.ipInfo, o.headers, o.mode, o.simdReadings, o.entropyMathRandomFingerprint, o.entropyCryptoFingerprint, o.entropyWallClockOffsetMs, o.entropyMathRandomFirst, o.bundleId, o.currentUrl, r?.tcpToChelloUs, r?.chelloToHandshakeUs, !0, o.iframeUrl, o.isProtect);
76764
+ let s = t.routingOutput, c = s.reason ?? o.reason, l = await e.frictionlessManager.createSession(o.token, o.score, o.threshold, o.scoreComponents, o.ipAddress, s.captchaType, o.siteKey ?? a.dappAccount, s.captchaType === Xp.image ? s.solvedImagesCount ?? o.solvedImagesCount : void 0, void 0, o.userSitekeyIpHash, o.webView, o.iFrame, o.decryptedHeadHash, c, void 0, void 0, o.ipInfo, o.headers, o.mode, o.simdReadings, o.entropyMathRandomFingerprint, o.entropyCryptoFingerprint, o.entropyWallClockOffsetMs, o.entropyMathRandomFirst, o.bundleId, o.currentUrl, r?.tcpToChelloUs, r?.chelloToHandshakeUs, !0, o.iframeUrl, o.isProtect, o.sessionId);
76735
76765
  return e.writeQueue && await e.writeQueue.cacheSessionEscalation(a.sessionId, l.sessionId), {
76736
76766
  captchaType: s.captchaType,
76737
76767
  sessionId: l.sessionId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/cli",
3
- "version": "3.7.2",
3
+ "version": "3.7.5",
4
4
  "description": "CLI for Prosopo Provider",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,15 +32,15 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@polkadot/types-codec": "16.4.9",
35
- "@prosopo/api": "4.0.1",
35
+ "@prosopo/api": "4.0.2",
36
36
  "@prosopo/common": "3.1.49",
37
37
  "@prosopo/logger": "2.0.5",
38
38
  "@prosopo/dotenv": "3.0.51",
39
- "@prosopo/env": "3.6.24",
40
- "@prosopo/keyring": "2.9.64",
39
+ "@prosopo/env": "3.6.26",
40
+ "@prosopo/keyring": "2.9.65",
41
41
  "@prosopo/locale": "3.2.9",
42
- "@prosopo/provider": "5.0.1",
43
- "@prosopo/types": "5.0.1",
42
+ "@prosopo/provider": "5.0.3",
43
+ "@prosopo/types": "5.0.2",
44
44
  "@prosopo/util": "3.3.5",
45
45
  "@prosopo/workspace": "3.2.0",
46
46
  "cron-parser": "4.9.0",