@velion-la/onboarding-sdk-react-native 1.3.0-beta.20 → 1.3.0-beta.21

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/commonjs/i18n/strings/en.js +2 -0
  3. package/lib/commonjs/i18n/strings/en.js.map +1 -1
  4. package/lib/commonjs/i18n/strings/es.js +2 -0
  5. package/lib/commonjs/i18n/strings/es.js.map +1 -1
  6. package/lib/commonjs/steps/LivenessMatchStep.js +54 -4
  7. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -1
  8. package/lib/commonjs/steps/livenessGuidance.js +88 -0
  9. package/lib/commonjs/steps/livenessGuidance.js.map +1 -0
  10. package/lib/commonjs/transport/irisWebSocket.js +3 -0
  11. package/lib/commonjs/transport/irisWebSocket.js.map +1 -1
  12. package/lib/module/i18n/strings/en.js +2 -0
  13. package/lib/module/i18n/strings/en.js.map +1 -1
  14. package/lib/module/i18n/strings/es.js +2 -0
  15. package/lib/module/i18n/strings/es.js.map +1 -1
  16. package/lib/module/steps/LivenessMatchStep.js +54 -4
  17. package/lib/module/steps/LivenessMatchStep.js.map +1 -1
  18. package/lib/module/steps/livenessGuidance.js +80 -0
  19. package/lib/module/steps/livenessGuidance.js.map +1 -0
  20. package/lib/module/transport/irisWebSocket.js +3 -0
  21. package/lib/module/transport/irisWebSocket.js.map +1 -1
  22. package/lib/typescript/i18n/strings/en.d.ts.map +1 -1
  23. package/lib/typescript/i18n/strings/es.d.ts +2 -0
  24. package/lib/typescript/i18n/strings/es.d.ts.map +1 -1
  25. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -1
  26. package/lib/typescript/steps/livenessGuidance.d.ts +58 -0
  27. package/lib/typescript/steps/livenessGuidance.d.ts.map +1 -0
  28. package/lib/typescript/transport/irisWebSocket.d.ts +8 -0
  29. package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/i18n/strings/en.ts +4 -0
  32. package/src/i18n/strings/es.ts +4 -0
  33. package/src/steps/LivenessMatchStep.tsx +62 -5
  34. package/src/steps/livenessGuidance.ts +103 -0
  35. package/src/transport/irisWebSocket.ts +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["POSITIONING_CODES","Set","DEFAULT_PRELUDE_HOLD_MS","serverText","msg","text","message","trim","length","hasReason","reason","Array","isArray","reasons","includes","positioningInstruction","running","copy","code","has","fromServer","warningTooFarBlurry","warningTooFar","warningTooClose","warningGeneric","retryPrelude","challenge","warningMoveFartherRetry","preludeHoldMs","readDelayMs","Number","isFinite"],"sourceRoot":"../../../src","sources":["steps/livenessGuidance.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA,MAAMA,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;;AAEnF;AACA,OAAO,MAAMC,uBAAuB,GAAG,KAAK;;AAgB5C;;AAMA,SAASC,UAAUA,CAACC,GAAoB,EAAiB;EACvD,MAAMC,IAAI,GAAG,OAAOD,GAAG,CAACE,OAAO,KAAK,QAAQ,GAAGF,GAAG,CAACE,OAAO,CAACC,IAAI,CAAC,CAAC,GAAG,EAAE;EACtE,OAAOF,IAAI,CAACG,MAAM,GAAG,CAAC,GAAGH,IAAI,GAAG,IAAI;AACtC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,SAASA,CAACL,GAAoB,EAAEM,MAAc,EAAW;EACvE,OAAOC,KAAK,CAACC,OAAO,CAACR,GAAG,CAACS,OAAO,CAAC,IAAIT,GAAG,CAACS,OAAO,CAACC,QAAQ,CAACJ,MAAM,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,sBAAsBA,CACpCX,GAAoB,EACpBY,OAA6B,EAC7BC,IAAkB,EACH;EACf,IAAID,OAAO,KAAK,IAAI,EAAE,OAAO,IAAI;EACjC,IAAI,CAACZ,GAAG,CAACc,IAAI,IAAI,CAAClB,iBAAiB,CAACmB,GAAG,CAACf,GAAG,CAACc,IAAI,CAAC,EAAE,OAAO,IAAI;EAC9D,MAAME,UAAU,GAAGjB,UAAU,CAACC,GAAG,CAAC;EAClC,IAAIgB,UAAU,EAAE,OAAOA,UAAU;EACjC,QAAQhB,GAAG,CAACc,IAAI;IACd,KAAK,SAAS;MACZ,OAAOT,SAAS,CAACL,GAAG,EAAE,WAAW,CAAC,GAAGa,IAAI,CAACI,mBAAmB,GAAGJ,IAAI,CAACK,aAAa;IACpF,KAAK,WAAW;MACd,OAAOL,IAAI,CAACM,eAAe;IAC7B;MACE,OAAON,IAAI,CAACO,cAAc;EAC9B;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACrB,GAAoB,EAAEa,IAAkB,EAA2B;EAC9F,IAAIb,GAAG,CAACc,IAAI,KAAK,oBAAoB,EAAE,OAAO,IAAI;EAClD,OAAO;IACLQ,SAAS,EAAE,cAAc;IACzBrB,IAAI,EAAEF,UAAU,CAACC,GAAG,CAAC,IAAIa,IAAI,CAACU;EAChC,CAAC;AACH;;AAEA;AACA,OAAO,SAASC,aAAaA,CAACC,WAAoB,EAAU;EAC1D,OAAO,OAAOA,WAAW,KAAK,QAAQ,IAAIC,MAAM,CAACC,QAAQ,CAACF,WAAW,CAAC,IAAIA,WAAW,GAAG,CAAC,GACrFA,WAAW,GACX3B,uBAAuB;AAC7B","ignoreList":[]}
@@ -81,6 +81,9 @@ export function openIrisWebSocket(opts) {
81
81
  } : {}),
82
82
  ...(parsed.consecutiveMisses != null ? {
83
83
  consecutiveMisses: parsed.consecutiveMisses
84
+ } : {}),
85
+ ...(parsed.reasons != null ? {
86
+ reasons: parsed.reasons
84
87
  } : {})
85
88
  });
86
89
  try {
@@ -1 +1 @@
1
- {"version":3,"names":["isSecureWebSocketUrl","log","WS_OPEN","buildIrisUrl","websocketUrl","connectionToken","locale","url","sep","includes","encodeURIComponent","normalizedLang","toLowerCase","startsWith","langSep","openIrisWebSocket","opts","Error","info","ws","WebSocket","closed","onopen","onOpen","onmessage","event","data","parsed","JSON","parse","type","code","message","consecutiveMisses","onMessage","err","error","onerror","warn","onError","onclose","reason","onClose","sendBinary","readyState","send","sendJson","envelope","close","isOpen","TERMINAL_WARNING_CODES","Set"],"sourceRoot":"../../../src","sources":["transport/irisWebSocket.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,aAAa;AAClD,SAASC,GAAG,QAAQ,cAAc;AA+DlC,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,OAAO,SAASC,YAAYA,CAC1BC,YAAoB,EACpBC,eAAmC,EACnCC,MAAc,EACN;EACR,IAAIC,GAAG,GAAGH,YAAY;EACtB,IAAIC,eAAe,EAAE;IACnB,MAAMG,GAAG,GAAGD,GAAG,CAACE,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;IACzCF,GAAG,GAAG,GAAGA,GAAG,GAAGC,GAAG,SAASE,kBAAkB,CAACL,eAAe,CAAC,EAAE;EAClE;EACA,MAAMM,cAAc,GAAGL,MAAM,CAACM,WAAW,CAAC,CAAC,CAACC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;EAC1E,MAAMC,OAAO,GAAGP,GAAG,CAACE,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;EAC7CF,GAAG,GAAG,GAAGA,GAAG,GAAGO,OAAO,QAAQH,cAAc,EAAE;EAC9C,OAAOJ,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,iBAAiBA,CAACC,IAAqB,EAAkB;EACvE,IAAI,CAAChB,oBAAoB,CAACgB,IA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FiB,EAAE,CAAC0B,IAAI,CAACE,QAAQ,CAAC;QACjB,OAAO,IAAI;MACb,CAAC,CAAC,OAAOZ,GAAG,EAAE;QACZlC,GAAG,CAACqC,IAAI,CAAC,0BAA0B,EAAEH,GAAG,CAAC;QACzC,OAAO,KAAK;MACd;IACF,CAAC;IACDa,KAAK,EAAEA,CAACjB,IAAI,GAAG,IAAI,EAAEU,MAAM,GAAG,EAAE,KAAK;MACnC,IAAIpB,MAAM,EAAE;MACZA,MAAM,GAAG,IAAI;MACb,IAAI;QACFF,EAAE,CAAC6B,KAAK,CAACjB,IAAI,EAAEU,MAAM,CAAC;MACxB,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ,CAAC;IACDQ,MAAM,EAAEA,CAAA,KAAM,CAAC5B,MAAM,IAAIF,EAAE,CAACyB,UAAU,KAAK1C;EAC7C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMgD,sBAAsB,GAAG,IAAIC,GAAG,CAAS,CACpD,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB;AAChB;AACA;AACA;AACA,yBAAyB,EACzB,2BAA2B,CAC5B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isSecureWebSocketUrl","log","WS_OPEN","buildIrisUrl","websocketUrl","connectionToken","locale","url","sep","includes","encodeURIComponent","normalizedLang","toLowerCase","startsWith","langSep","openIrisWebSocket","opts","Error","info","ws","WebSocket","closed","onopen","onOpen","onmessage","event","data","parsed","JSON","parse","type","code","message","consecutiveMisses","reasons","onMessage","err","error","onerror","warn","onError","onclose","reason","onClose","sendBinary","readyState","send","sendJson","envelope","close","isOpen","TERMINAL_WARNING_CODES","Set"],"sourceRoot":"../../../src","sources":["transport/irisWebSocket.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,aAAa;AAClD,SAASC,GAAG,QAAQ,cAAc;AAuElC,MAAMC,OAAO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,EAAEW,MAAM,CAAC;MACxB,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ,CAAC;IACDQ,MAAM,EAAEA,CAAA,KAAM,CAAC7B,MAAM,IAAIF,EAAE,CAAC0B,UAAU,KAAK3C;EAC7C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMiD,sBAAsB,GAAG,IAAIC,GAAG,CAAS,CACpD,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB;AAChB;AACA;AACA;AACA,yBAAyB,EACzB,2BAA2B,CAC5B,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,eAAO,MAAM,EAAE,EAAE,YAgVhB,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,eAAO,MAAM,EAAE,EAAE,YAoVhB,CAAC"}
@@ -246,6 +246,8 @@ export declare const ES: {
246
246
  warningGeneric: string;
247
247
  warningConsecutiveMisses: string;
248
248
  warningTooFar: string;
249
+ warningTooFarBlurry: string;
250
+ warningMoveFartherRetry: string;
249
251
  warningTooClose: string;
250
252
  warningMoveCloserHint: string;
251
253
  warningMoveFartherHint: string;
@@ -1 +1 @@
1
- {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/es.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Ud,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/es.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiVd,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LivenessMatchStep.d.ts","sourceRoot":"","sources":["../../../src/steps/LivenessMatchStep.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA8DH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAsNpD,qBAAa,iBAAkB,YAAW,UAAU;IAKtC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,SAAS,CAAS;gBAEG,IAAI,EAAE,QAAQ;IAE3C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BpB,OAAO,IAAI,IAAI;CAIhB"}
1
+ {"version":3,"file":"LivenessMatchStep.d.ts","sourceRoot":"","sources":["../../../src/steps/LivenessMatchStep.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoEH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAsNpD,qBAAa,iBAAkB,YAAW,UAAU;IAKtC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,SAAS,CAAS;gBAEG,IAAI,EAAE,QAAQ;IAE3C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BpB,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Which Iris instructions stay pinned above the oval instead of flashing by
3
+ * in a toast (OSDKR-40).
4
+ *
5
+ * Two cases left users stuck because the instruction they needed was only
6
+ * shown for a moment, or overwritten right away:
7
+ *
8
+ * - The positioning gate. Iris blocks until the frame is good enough and, with
9
+ * IRIS-45, says why — `TOO_FAR` with `reasons: ['SHARPNESS']` when a small
10
+ * face reads blurry. A toast expires while the block goes on (30 s on the
11
+ * Motorola Edge 30 Neo sessions), so the instruction is pinned until Iris
12
+ * sends another one or POSITIONING_READY.
13
+ * - The MOVE_FARTHER retry. IRIS-44 sends `MOVE_FARTHER_RETRY` ("first bring
14
+ * the phone closer, then move it away") and re-announces MOVE_FARTHER in the
15
+ * same instant. The CHALLENGE used to replace it with "move the phone away"
16
+ * at once, so the user, already far, had no room left to pull back. The
17
+ * instruction is now held for the challenge's read delay, before the window
18
+ * opens.
19
+ */
20
+ import type { IrisChallenge } from '../transport/irisWebSocket';
21
+ /** Hold used when the CHALLENGE carries no `readDelayMs` (older Iris). */
22
+ export declare const DEFAULT_PRELUDE_HOLD_MS = 2000;
23
+ export interface GuidanceCopy {
24
+ warningTooFar: string;
25
+ warningTooFarBlurry: string;
26
+ warningTooClose: string;
27
+ warningGeneric: string;
28
+ warningMoveFartherRetry: string;
29
+ }
30
+ export interface GuidanceWarning {
31
+ code?: string | undefined;
32
+ message?: string | undefined;
33
+ reasons?: unknown;
34
+ }
35
+ /** Instruction to show before a re-issued challenge's window opens. */
36
+ export interface ChallengePrelude {
37
+ challenge: IrisChallenge;
38
+ text: string;
39
+ }
40
+ /**
41
+ * Whether the warning lists `reason`. Tolerates an Iris that predates the
42
+ * field or sends something unexpected in it.
43
+ */
44
+ export declare function hasReason(msg: GuidanceWarning, reason: string): boolean;
45
+ /**
46
+ * Text to pin above the oval for a positioning warning, or `null` when the
47
+ * warning is not a positioning one or a challenge is already running (those
48
+ * hints stay toasts: the challenge instruction owns the pinned slot).
49
+ */
50
+ export declare function positioningInstruction(msg: GuidanceWarning, running: IrisChallenge | null, copy: GuidanceCopy): string | null;
51
+ /**
52
+ * Prelude for the challenge Iris is about to re-issue, or `null` when the
53
+ * warning does not ask for one.
54
+ */
55
+ export declare function retryPrelude(msg: GuidanceWarning, copy: GuidanceCopy): ChallengePrelude | null;
56
+ /** How long the prelude stays before the challenge instruction replaces it. */
57
+ export declare function preludeHoldMs(readDelayMs: unknown): number;
58
+ //# sourceMappingURL=livenessGuidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"livenessGuidance.d.ts","sourceRoot":"","sources":["../../../src/steps/livenessGuidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAKhE,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAE7C,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAOD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,aAAa,GAAG,IAAI,EAC7B,IAAI,EAAE,YAAY,GACjB,MAAM,GAAG,IAAI,CAaf;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAM9F;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAI1D"}
@@ -24,6 +24,14 @@ export interface IrisServerMessage {
24
24
  code?: string;
25
25
  /** Bumps as the user keeps missing positioning. */
26
26
  consecutiveMisses?: number;
27
+ /**
28
+ * Capture-quality dimensions the frame fails on (positioning WARNINGs only,
29
+ * IRIS-45): `FACE_DETECTION`, `LIGHTING`, `BACKGROUND`, `SHARPNESS`,
30
+ * `FACE_AREA`. Absent on older Iris versions.
31
+ */
32
+ reasons?: string[];
33
+ /** Ms between the CHALLENGE announcement and its window opening (CHALLENGE only). */
34
+ readDelayMs?: number;
27
35
  /** Final score map on SESSION_COMPLETE. */
28
36
  signals?: Record<string, number>;
29
37
  /** Zero-based position of this challenge in the session sequence (CHALLENGE only). */
@@ -1 +1 @@
1
- {"version":3,"file":"irisWebSocket.d.ts","sourceRoot":"","sources":["../../../src/transport/irisWebSocket.ts"],"names":[],"mappings":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ED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CAiGvE;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,aASjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velion-la/onboarding-sdk-react-native",
3
- "version": "1.3.0-beta.20",
3
+ "version": "1.3.0-beta.21",
4
4
  "description": "Native React Native SDK for the Velion Onboarding (KYC) flow: ID document OCR, passive + active liveness, device fingerprint, OTP verification, address picker, and personal / legal information forms.",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -270,6 +270,10 @@ export const EN: StringsTable = {
270
270
  warningConsecutiveMisses:
271
271
  'Re-center your face (attempt {n}) — follow the instructions',
272
272
  warningTooFar: 'Move closer to the phone so your face fills the oval guide',
273
+ warningTooFarBlurry:
274
+ 'Your face is too far to look sharp. Bring the phone closer until your face fills the oval',
275
+ warningMoveFartherRetry:
276
+ "Let's try again: first bring the phone closer to your face, then move it away slowly",
273
277
  warningTooClose: 'Move the phone a bit farther so your whole face fits',
274
278
  warningMoveCloserHint:
275
279
  'Bring the phone closer — your face should grow inside the guide',
@@ -272,6 +272,10 @@ export const ES = {
272
272
  warningGeneric: 'Acomodá tu rostro y mantené la posición',
273
273
  warningConsecutiveMisses: 'Acomodá tu rostro (intento {n}) — seguí las instrucciones',
274
274
  warningTooFar: 'Acercate al teléfono para que tu rostro llene la guía',
275
+ warningTooFarBlurry:
276
+ 'Tu rostro está muy lejos para verse nítido. Acercá el teléfono hasta que tu cara llene el óvalo',
277
+ warningMoveFartherRetry:
278
+ 'Probemos de nuevo: primero acercá el teléfono a tu rostro y después alejalo despacio',
275
279
  warningTooClose: 'Alejá un poco el teléfono para que tu rostro entre completo',
276
280
  warningMoveCloserHint: 'Acercá el teléfono — tu cara debería crecer dentro de la guía',
277
281
  warningMoveFartherHint: 'Alejá el teléfono — tu cara debería achicarse dentro de la guía',
@@ -64,6 +64,12 @@ import {
64
64
  type IrisServerMessage,
65
65
  } from '../transport/irisWebSocket';
66
66
  import { planLivenessRestart, type LivenessPhase } from './livenessRestart';
67
+ import {
68
+ positioningInstruction,
69
+ preludeHoldMs,
70
+ retryPrelude,
71
+ type ChallengePrelude,
72
+ } from './livenessGuidance';
67
73
  import {
68
74
  LivenessCamera,
69
75
  type LivenessCameraHandle,
@@ -425,6 +431,11 @@ function LivenessMatchView({
425
431
  // treat a handled rejection as "socket closed before the step finalized".
426
432
  const closingForRetryRef = useRef(false);
427
433
  const toastTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
434
+ // "Come closer first" waiting for the MOVE_FARTHER that Iris re-issues right
435
+ // after it, and the timer that hands the slot back to that challenge's own
436
+ // instruction once its read delay ends (OSDKR-40).
437
+ const pendingPreludeRef = useRef<ChallengePrelude | null>(null);
438
+ const preludeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
428
439
  // Tracks the toast currently on screen so we can extend its visibility when
429
440
  // the same message arrives again (instead of dismount/remount, which made
430
441
  // warnings flash in <2s and the user couldn't read them).
@@ -510,8 +521,17 @@ function LivenessMatchView({
510
521
  }
511
522
  }, []);
512
523
 
524
+ const clearPrelude = useCallback(() => {
525
+ pendingPreludeRef.current = null;
526
+ if (preludeTimerRef.current) {
527
+ clearTimeout(preludeTimerRef.current);
528
+ preludeTimerRef.current = null;
529
+ }
530
+ }, []);
531
+
513
532
  const stopCapture = useCallback(() => {
514
533
  clearCaptureTimer();
534
+ clearPrelude();
515
535
  captureGenerationRef.current += 1;
516
536
  const pending = pendingFrameRef.current;
517
537
  pendingFrameRef.current = null;
@@ -520,7 +540,7 @@ function LivenessMatchView({
520
540
  // next loop start must not stay blocked on it.
521
541
  captureInFlightRef.current = false;
522
542
  processingRef.current = false;
523
- }, [clearCaptureTimer]);
543
+ }, [clearCaptureTimer, clearPrelude]);
524
544
 
525
545
  // ── Video upload pipeline (OSDKR-4) ─────────────────────────────────────
526
546
  // Everything below is best-effort: never throws into the caller; never
@@ -1023,6 +1043,8 @@ function LivenessMatchView({
1023
1043
  case 'CHALLENGE': {
1024
1044
  const ch = (msg.challenge ?? null) as IrisChallenge | null;
1025
1045
  currentChallengeRef.current = ch;
1046
+ const prelude = pendingPreludeRef.current;
1047
+ clearPrelude();
1026
1048
  // Stash the sequence position so CHALLENGE_COMPLETE can tell
1027
1049
  // whether this was the LAST challenge and switch to the analyzing
1028
1050
  // overlay immediately instead of waiting for SESSION_COMPLETE.
@@ -1042,18 +1064,32 @@ function LivenessMatchView({
1042
1064
  ? FRAME_MS_BLINK
1043
1065
  : FRAME_MS_DEFAULT,
1044
1066
  );
1045
- setChallengeText(challengeLabel(ch));
1046
1067
  // Map distance challenges to an oval-size cue so the viewfinder
1047
1068
  // shape reinforces the instruction (grows for closer, returns to
1048
1069
  // neutral for farther). All other challenges keep the neutral
1049
1070
  // oval — the dim mask shouldn't move under a turn / smile / blink.
1050
- setOvalCue(
1071
+ const challengeCue: LivenessOvalCue =
1051
1072
  ch === 'MOVE_CLOSER'
1052
1073
  ? 'MOVE_CLOSER'
1053
1074
  : ch === 'MOVE_FARTHER'
1054
1075
  ? 'MOVE_FARTHER'
1055
- : 'NEUTRAL',
1056
- );
1076
+ : 'NEUTRAL';
1077
+ if (prelude && prelude.challenge === ch) {
1078
+ // Keep "come closer first" up through the read delay: the user,
1079
+ // already far after the failed attempt, needs room to pull back
1080
+ // before the window opens (OSDKR-40, IRIS-44).
1081
+ setChallengeText(prelude.text);
1082
+ setOvalCue('MOVE_CLOSER');
1083
+ preludeTimerRef.current = setTimeout(() => {
1084
+ preludeTimerRef.current = null;
1085
+ if (currentChallengeRef.current !== ch) return;
1086
+ setChallengeText(challengeLabel(ch));
1087
+ setOvalCue(challengeCue);
1088
+ }, preludeHoldMs(msg.readDelayMs));
1089
+ } else {
1090
+ setChallengeText(challengeLabel(ch));
1091
+ setOvalCue(challengeCue);
1092
+ }
1057
1093
  setProgress(0);
1058
1094
  // Positioning skipped or already passed — start the evidence
1059
1095
  // recorder if it is not running yet (idempotent).
@@ -1142,7 +1178,26 @@ function LivenessMatchView({
1142
1178
  resetWatchdog();
1143
1179
  return;
1144
1180
  }
1181
+ const prelude = retryPrelude(msg, t.liveness);
1182
+ if (prelude) {
1183
+ // Pinned now and held into the MOVE_FARTHER Iris re-issues next.
1184
+ pendingPreludeRef.current = prelude;
1185
+ currentChallengeRef.current = null;
1186
+ setProgress(null);
1187
+ setChallengeText(prelude.text);
1188
+ setOvalCue('MOVE_CLOSER');
1189
+ showToast('warning', prelude.text);
1190
+ resetWatchdog();
1191
+ return;
1192
+ }
1193
+ // While the positioning gate blocks, its instruction has to outlive
1194
+ // the toast: the block can last tens of seconds (OSDKR-40, IRIS-45).
1195
+ const pinned = positioningInstruction(msg, currentChallengeRef.current, t.liveness);
1196
+ if (pinned) setChallengeText(pinned);
1145
1197
  const isPositioningReady = msg.code === 'POSITIONING_READY';
1198
+ if (isPositioningReady && currentChallengeRef.current === null) {
1199
+ setChallengeText(t.liveness.positioningReady);
1200
+ }
1146
1201
  // Per-code SDK-side fallback used when the orchestrator forwarded a
1147
1202
  // code but no localised text (e.g. older orchestrator versions, or
1148
1203
  // the rare WS message that drops the body). The orchestrator's own
@@ -1306,6 +1361,7 @@ function LivenessMatchView({
1306
1361
  adjustFps,
1307
1362
  api,
1308
1363
  challengeLabel,
1364
+ clearPrelude,
1309
1365
  failWith,
1310
1366
  onComplete,
1311
1367
  presentTerminalRetry,
@@ -1317,6 +1373,7 @@ function LivenessMatchView({
1317
1373
  stopCapture,
1318
1374
  stopVideoRecordingIfActive,
1319
1375
  stopWatchdog,
1376
+ t.liveness,
1320
1377
  t.liveness.getReady,
1321
1378
  t.liveness.positioningReady,
1322
1379
  t.liveness.repositioning,
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Which Iris instructions stay pinned above the oval instead of flashing by
3
+ * in a toast (OSDKR-40).
4
+ *
5
+ * Two cases left users stuck because the instruction they needed was only
6
+ * shown for a moment, or overwritten right away:
7
+ *
8
+ * - The positioning gate. Iris blocks until the frame is good enough and, with
9
+ * IRIS-45, says why — `TOO_FAR` with `reasons: ['SHARPNESS']` when a small
10
+ * face reads blurry. A toast expires while the block goes on (30 s on the
11
+ * Motorola Edge 30 Neo sessions), so the instruction is pinned until Iris
12
+ * sends another one or POSITIONING_READY.
13
+ * - The MOVE_FARTHER retry. IRIS-44 sends `MOVE_FARTHER_RETRY` ("first bring
14
+ * the phone closer, then move it away") and re-announces MOVE_FARTHER in the
15
+ * same instant. The CHALLENGE used to replace it with "move the phone away"
16
+ * at once, so the user, already far, had no room left to pull back. The
17
+ * instruction is now held for the challenge's read delay, before the window
18
+ * opens.
19
+ */
20
+
21
+ import type { IrisChallenge } from '../transport/irisWebSocket';
22
+
23
+ /** Positioning-gate codes whose instruction is pinned while the gate blocks. */
24
+ const POSITIONING_CODES = new Set(['POSITIONING_REQUIRED', 'TOO_FAR', 'TOO_CLOSE']);
25
+
26
+ /** Hold used when the CHALLENGE carries no `readDelayMs` (older Iris). */
27
+ export const DEFAULT_PRELUDE_HOLD_MS = 2_000;
28
+
29
+ export interface GuidanceCopy {
30
+ warningTooFar: string;
31
+ warningTooFarBlurry: string;
32
+ warningTooClose: string;
33
+ warningGeneric: string;
34
+ warningMoveFartherRetry: string;
35
+ }
36
+
37
+ export interface GuidanceWarning {
38
+ code?: string | undefined;
39
+ message?: string | undefined;
40
+ reasons?: unknown;
41
+ }
42
+
43
+ /** Instruction to show before a re-issued challenge's window opens. */
44
+ export interface ChallengePrelude {
45
+ challenge: IrisChallenge;
46
+ text: string;
47
+ }
48
+
49
+ function serverText(msg: GuidanceWarning): string | null {
50
+ const text = typeof msg.message === 'string' ? msg.message.trim() : '';
51
+ return text.length > 0 ? text : null;
52
+ }
53
+
54
+ /**
55
+ * Whether the warning lists `reason`. Tolerates an Iris that predates the
56
+ * field or sends something unexpected in it.
57
+ */
58
+ export function hasReason(msg: GuidanceWarning, reason: string): boolean {
59
+ return Array.isArray(msg.reasons) && msg.reasons.includes(reason);
60
+ }
61
+
62
+ /**
63
+ * Text to pin above the oval for a positioning warning, or `null` when the
64
+ * warning is not a positioning one or a challenge is already running (those
65
+ * hints stay toasts: the challenge instruction owns the pinned slot).
66
+ */
67
+ export function positioningInstruction(
68
+ msg: GuidanceWarning,
69
+ running: IrisChallenge | null,
70
+ copy: GuidanceCopy,
71
+ ): string | null {
72
+ if (running !== null) return null;
73
+ if (!msg.code || !POSITIONING_CODES.has(msg.code)) return null;
74
+ const fromServer = serverText(msg);
75
+ if (fromServer) return fromServer;
76
+ switch (msg.code) {
77
+ case 'TOO_FAR':
78
+ return hasReason(msg, 'SHARPNESS') ? copy.warningTooFarBlurry : copy.warningTooFar;
79
+ case 'TOO_CLOSE':
80
+ return copy.warningTooClose;
81
+ default:
82
+ return copy.warningGeneric;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Prelude for the challenge Iris is about to re-issue, or `null` when the
88
+ * warning does not ask for one.
89
+ */
90
+ export function retryPrelude(msg: GuidanceWarning, copy: GuidanceCopy): ChallengePrelude | null {
91
+ if (msg.code !== 'MOVE_FARTHER_RETRY') return null;
92
+ return {
93
+ challenge: 'MOVE_FARTHER',
94
+ text: serverText(msg) ?? copy.warningMoveFartherRetry,
95
+ };
96
+ }
97
+
98
+ /** How long the prelude stays before the challenge instruction replaces it. */
99
+ export function preludeHoldMs(readDelayMs: unknown): number {
100
+ return typeof readDelayMs === 'number' && Number.isFinite(readDelayMs) && readDelayMs > 0
101
+ ? readDelayMs
102
+ : DEFAULT_PRELUDE_HOLD_MS;
103
+ }
@@ -43,6 +43,14 @@ export interface IrisServerMessage {
43
43
  code?: string;
44
44
  /** Bumps as the user keeps missing positioning. */
45
45
  consecutiveMisses?: number;
46
+ /**
47
+ * Capture-quality dimensions the frame fails on (positioning WARNINGs only,
48
+ * IRIS-45): `FACE_DETECTION`, `LIGHTING`, `BACKGROUND`, `SHARPNESS`,
49
+ * `FACE_AREA`. Absent on older Iris versions.
50
+ */
51
+ reasons?: string[];
52
+ /** Ms between the CHALLENGE announcement and its window opening (CHALLENGE only). */
53
+ readDelayMs?: number;
46
54
  /** Final score map on SESSION_COMPLETE. */
47
55
  signals?: Record<string, number>;
48
56
  /** Zero-based position of this challenge in the session sequence (CHALLENGE only). */
@@ -146,6 +154,7 @@ export function openIrisWebSocket(opts: IrisOpenOptions): IrisConnection {
146
154
  ...(parsed.consecutiveMisses != null
147
155
  ? { consecutiveMisses: parsed.consecutiveMisses }
148
156
  : {}),
157
+ ...(parsed.reasons != null ? { reasons: parsed.reasons } : {}),
149
158
  });
150
159
 
151
160
  try {