@sekyro/react-native 0.1.0-rc.40 → 0.1.0-rc.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sekyro/react-native
2
2
 
3
+ ## 0.1.0-rc.42
4
+
5
+ ### Minor Changes
6
+
7
+ - 682deae: Sandbox sessions open with a choice between test data and real checks as an enrolled tester, and real checks start with the tester face check. The result's `sandbox` is now `{ mode, testerName? }` (`mode`: `simulated` or `tester`), replacing `{ simulated, reason }`; the types `SekyroSandboxMode` and `SekyroSandboxRun` replace `SekyroSandboxSimulatedReason` and `SekyroSandboxSimulation`.
8
+
9
+ ### Patch Changes
10
+
11
+ - 41c2701: Pins the native SDKs 0.1.0-rc.35: the capture trace names the upload id of each document photo so staff see every phone photo beside the server's attempt on it, and the blur gate measures the photo taken right after a blur refusal too, so a second refusal in a row offers the shutter and holds the automatic photo until the card leaves the frame and the gate never loops. No API change in this package.
12
+
13
+ ## 0.1.0-rc.41
14
+
15
+ ### Patch Changes
16
+
17
+ - 5bfab9c: Pins the native SDKs 0.1.0-rc.33: a card too dark to read is never photographed automatically and the camera says "Too dark. Move to better light or turn on the light.", a photo the server could not read because it was too dark gets its own retake reason, the capture tray follows the faces the server kept and never waits endlessly for a final result while a side is still asked for, and darkness is measured on a found card only. No API change in this package.
18
+ - 25b4668: Pins the native SDKs 0.1.0-rc.34: a reflection over a field the read needs holds the automatic photo and the camera says "Tilt the card a little to move the reflection.", the gate is stricter with the light on and the light is never turned on by the SDK, and each photo records whether the light was on and the glare measured. A photo the server could not read because of glare gets its own retake reason. No API change in this package.
19
+
3
20
  ## 0.1.0-rc.40
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -66,11 +66,10 @@ const result = await startSekyro({
66
66
  `superseded`) and `reasonCode` gives the code behind it when there is one. Read the decision itself server-side
67
67
  (webhooks or `sessions.get`).
68
68
 
69
- `sandbox` is present when a Sandbox session ran on simulated test data, so no real check ran:
70
- `{ simulated: true, reason }`, where `reason` is `no_testers` (your organization has no active Sandbox tester),
71
- `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester
72
- check ran and recognized nobody). It is absent in Live and on a Sandbox session an enrolled tester ran. The result
73
- screen shows the same notice.
69
+ `sandbox` is present on a Sandbox session once its mode is set: `{ mode, testerName? }`. `mode` is `simulated` (test
70
+ data: no real check ran, so the outcome says nothing about a person) or `tester` (real checks against one enrolled
71
+ Sandbox tester, named by `testerName` when the server gives it). The person picks the mode on the first screen unless
72
+ your backend set it when it created the session. It is absent in Live. The result screen shows the same mode.
74
73
 
75
74
  Or declaratively: `<SekyroFlow clientToken={token} onResult={setResult} />` (renders nothing).
76
75
 
@@ -74,16 +74,16 @@ internal object ConfigMapper {
74
74
  // Everything else from the native SDK's own wire form (SekyroWire.result), so the JS side reads the same
75
75
  // strings as Flutter: displayStatus verified | review_pending | not_verified, reason and reasonCode on
76
76
  // not_verified, level (1 Contact, 2 Human, 3 Identity, 0 nothing proven) and assurance once decided. Each
77
- // key only when known: JS reads absent as "none". `sandbox` ({ simulated: true, reason }) is there when a
78
- // Sandbox session ran on simulated test data; a native SDK that does not report it sends no such key.
77
+ // key only when known: JS reads absent as "none". `sandbox` ({ mode, testerName? }) is there once a Sandbox
78
+ // session's mode is set; a native SDK that does not report it sends no such key.
79
79
  val wire = SekyroWire.result(r)
80
80
  (wire["displayStatus"] as? String)?.let { putString("displayStatus", it) }
81
81
  (wire["level"] as? Int)?.takeIf { it in 0..3 }?.let { putInt("level", it) }
82
82
  for (key in listOf("assurance", "reason", "reasonCode")) {
83
83
  (wire[key] as? String)?.takeIf { it.isNotEmpty() }?.let { putString(key, it) }
84
84
  }
85
- sandboxReason(wire)?.let { reason ->
86
- putMap("sandbox", newMap().apply { putBoolean("simulated", true); putString("reason", reason) })
85
+ sandboxOf(wire)?.let { (mode, testerName) ->
86
+ putMap("sandbox", newMap().apply { putString("mode", mode); testerName?.let { putString("testerName", it) } })
87
87
  }
88
88
  }
89
89
  SekyroResult.Cancelled -> putString("status", "cancelled")
@@ -91,7 +91,10 @@ internal object ConfigMapper {
91
91
  }
92
92
  }
93
93
 
94
- /** The reason of the native wire's `sandbox` entry, or null when the entry is absent or names none. */
95
- internal fun sandboxReason(wire: Map<String, Any?>): String? =
96
- ((wire["sandbox"] as? Map<*, *>)?.get("reason") as? String)?.takeIf { it.isNotEmpty() }
94
+ /** The mode and tester name of the native wire's `sandbox` entry, or null when the entry is absent or names no mode. */
95
+ internal fun sandboxOf(wire: Map<String, Any?>): Pair<String, String?>? {
96
+ val entry = wire["sandbox"] as? Map<*, *> ?: return null
97
+ val mode = (entry["mode"] as? String)?.takeIf { it.isNotEmpty() } ?: return null
98
+ return mode to (entry["testerName"] as? String)?.takeIf { it.isNotEmpty() }
99
+ }
97
100
  }
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var C=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},O=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of x(o))!h.call(e,r)&&r!==t&&p(e,r,{get:()=>o[r],enumerable:!(s=b(o,r))||s.enumerable});return e};var T=e=>O(p({},"__esModule",{value:!0}),e);var z={};C(z,{SDK_VERSION:()=>w,SekyroError:()=>l,SekyroFlow:()=>N,nativeVersion:()=>R,startSekyro:()=>y});module.exports=T(z);var k=require("react-native"),c=k.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(o,t=o){super(t),this.name="SekyroError",this.code=o}};var D=500,I=new Set(["ar","fr","en","es","pt","de"]),F=["brand","brandFg","bg","surface","fg","fgMuted","border"],V=["danger","success","warning"],g=!1,L=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),M=/^#[0-9a-fA-F]{6}$/,A=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function m(e){(typeof e!="object"||e===null)&&a("config");for(let s of Object.keys(e))L.has(s)||a(`unknown key "${s.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let o={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&A.test(e.apiOrigin))||a("apiOrigin"),o.apiOrigin=e.apiOrigin),e.locale!==void 0&&(I.has(e.locale)||a("locale"),o.locale=e.locale);let t=e.theme;if(t){if(t.colors){let s={};for(let[r,i]of Object.entries(t.colors))if(i!==void 0){if(V.includes(r)){__DEV__&&!g&&(g=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!F.includes(r)||typeof i!="string"||!M.test(i))&&a(`theme.colors.${r.slice(0,32)}`),s[r]=i}o.colors=s}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),o.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),o.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),o.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let s=e.strings[e.locale]??{},r={},i=Object.entries(s).filter(([,n])=>n!==void 0);i.length>D&&a("strings (too many overrides)");for(let[n,f]of i)/^[a-zA-Z0-9_.]{1,96}$/.test(n)||a("strings key"),(typeof f!="string"||f.length>2e3)&&a(`strings.${n}`),r[n]=f;o.strings=r}return o}var $=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait","proof_of_address","form"]);function v(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!$.has(e.step))return null;let o=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:o,retryReason:t}:{type:"step",step:o}}var P=new Set(["verified","review_pending","not_verified"]),j=new Set([0,1,2,3]),K=new Set(["no_testers","tester_gate_not_used","tester_gate_missed"]);function u(e){return typeof e=="string"&&e!==""}function _(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){let o=P.has(e.displayStatus),t=o?e.displayStatus:"not_verified",s=t==="not_verified",r=e.sandbox?.reason;return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&j.has(e.level)?{level:e.level}:{},...u(e.assurance)?{assurance:e.assurance}:{},...s&&o&&u(e.reason)?{reason:e.reason}:{},...s&&o&&u(e.reasonCode)?{reasonCode:e.reasonCode}:{},...u(r)&&K.has(r)?{sandbox:{simulated:!0,reason:r}}:{}}}return{status:"failed",code:"unknown_error"}}function E(){if(!c)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return c}var S=!1,Y=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function y(e){let o=m(e),t=E();if(S)throw new l("flow_in_progress");S=!0;let s=e.onEvent,r=s?t.onEvent(i=>{let n=v(i);n&&s(n)}):void 0;try{return _(await t.start(o))}catch(i){let n=i?.code;if(typeof n=="string"&&Y.has(n))throw new l(n);return{status:"failed",code:"unknown_error"}}finally{r?.remove(),S=!1}}function R(){return E().nativeVersion()}var d=require("react");function N(e){let o=(0,d.useRef)(null),t=(0,d.useRef)(e);return t.current=e,(0,d.useEffect)(()=>{if(o.current===e.clientToken)return;o.current=e.clientToken;let{onResult:s,onEvent:r,...i}=t.current;y({...i,onEvent:n=>t.current.onEvent?.(n)}).then(n=>t.current.onResult(n),n=>t.current.onResult({status:"failed",code:n instanceof l?n.code:"unknown_error"}))},[e.clientToken]),null}var w="0.1.0-rc.40";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
1
+ "use strict";var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var h=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},O=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of x(o))!C.call(e,r)&&r!==t&&p(e,r,{get:()=>o[r],enumerable:!(s=b(o,r))||s.enumerable});return e};var T=e=>O(p({},"__esModule",{value:!0}),e);var z={};h(z,{SDK_VERSION:()=>w,SekyroError:()=>l,SekyroFlow:()=>N,nativeVersion:()=>R,startSekyro:()=>f});module.exports=T(z);var k=require("react-native"),c=k.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(o,t=o){super(t),this.name="SekyroError",this.code=o}};var I=500,D=new Set(["ar","fr","en","es","pt","de"]),F=["brand","brandFg","bg","surface","fg","fgMuted","border"],V=["danger","success","warning"],g=!1,M=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),L=/^#[0-9a-fA-F]{6}$/,$=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function m(e){(typeof e!="object"||e===null)&&a("config");for(let s of Object.keys(e))M.has(s)||a(`unknown key "${s.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let o={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&$.test(e.apiOrigin))||a("apiOrigin"),o.apiOrigin=e.apiOrigin),e.locale!==void 0&&(D.has(e.locale)||a("locale"),o.locale=e.locale);let t=e.theme;if(t){if(t.colors){let s={};for(let[r,i]of Object.entries(t.colors))if(i!==void 0){if(V.includes(r)){__DEV__&&!g&&(g=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!F.includes(r)||typeof i!="string"||!L.test(i))&&a(`theme.colors.${r.slice(0,32)}`),s[r]=i}o.colors=s}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),o.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),o.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),o.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let s=e.strings[e.locale]??{},r={},i=Object.entries(s).filter(([,n])=>n!==void 0);i.length>I&&a("strings (too many overrides)");for(let[n,y]of i)/^[a-zA-Z0-9_.]{1,96}$/.test(n)||a("strings key"),(typeof y!="string"||y.length>2e3)&&a(`strings.${n}`),r[n]=y;o.strings=r}return o}var A=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait","proof_of_address","form"]);function v(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!A.has(e.step))return null;let o=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:o,retryReason:t}:{type:"step",step:o}}var P=new Set(["verified","review_pending","not_verified"]),j=new Set([0,1,2,3]);function u(e){return typeof e=="string"&&e!==""}function K(e){if(typeof e!="object"||e===null)return;let{mode:o,testerName:t}=e;if(o==="simulated")return{mode:o};if(o==="tester")return u(t)&&t.trim()!==""?{mode:o,testerName:t.trim()}:{mode:o}}function _(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){let o=P.has(e.displayStatus),t=o?e.displayStatus:"not_verified",s=t==="not_verified",r=K(e.sandbox);return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&j.has(e.level)?{level:e.level}:{},...u(e.assurance)?{assurance:e.assurance}:{},...s&&o&&u(e.reason)?{reason:e.reason}:{},...s&&o&&u(e.reasonCode)?{reasonCode:e.reasonCode}:{},...r!==void 0?{sandbox:r}:{}}}return{status:"failed",code:"unknown_error"}}function E(){if(!c)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return c}var S=!1,Y=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function f(e){let o=m(e),t=E();if(S)throw new l("flow_in_progress");S=!0;let s=e.onEvent,r=s?t.onEvent(i=>{let n=v(i);n&&s(n)}):void 0;try{return _(await t.start(o))}catch(i){let n=i?.code;if(typeof n=="string"&&Y.has(n))throw new l(n);return{status:"failed",code:"unknown_error"}}finally{r?.remove(),S=!1}}function R(){return E().nativeVersion()}var d=require("react");function N(e){let o=(0,d.useRef)(null),t=(0,d.useRef)(e);return t.current=e,(0,d.useEffect)(()=>{if(o.current===e.clientToken)return;o.current=e.clientToken;let{onResult:s,onEvent:r,...i}=t.current;f({...i,onEvent:n=>t.current.onEvent?.(n)}).then(n=>t.current.onResult(n),n=>t.current.onResult({status:"failed",code:n instanceof l?n.code:"unknown_error"}))},[e.clientToken]),null}var w="0.1.0-rc.42";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
package/dist/index.d.cts CHANGED
@@ -74,20 +74,19 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
74
74
  */
75
75
  type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
76
76
  /**
77
- * Why a Sandbox session ran on simulated test data: `no_testers` (the organization has no active Sandbox tester),
78
- * `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester
79
- * check ran and recognized nobody). @public
77
+ * The mode a Sandbox session runs in: `simulated` (test data, no real check runs) or `tester` (real checks against one
78
+ * enrolled Sandbox tester). @public
80
79
  */
81
- type SekyroSandboxSimulatedReason = 'no_testers' | 'tester_gate_not_used' | 'tester_gate_missed';
80
+ type SekyroSandboxMode = 'simulated' | 'tester';
82
81
  /**
83
- * Set on the finished result of a Sandbox session that ran on simulated test data: no real check ran, so the outcome
84
- * says nothing about the person. @public
82
+ * Set on the finished result of a Sandbox session once its mode is set (the same mode as `sandbox.mode` on
83
+ * `sessions.get` and the session webhooks). @public
85
84
  */
86
- interface SekyroSandboxSimulation {
87
- /** Always `true`. */
88
- simulated: true;
89
- /** Why the session ran on simulated test data. */
90
- reason: SekyroSandboxSimulatedReason;
85
+ interface SekyroSandboxRun {
86
+ /** `simulated`: test data, so the outcome says nothing about a person. `tester`: real checks against an enrolled tester. */
87
+ mode: SekyroSandboxMode;
88
+ /** `tester` mode only: the recognized tester's given names, when the server gives them. */
89
+ testerName?: string;
91
90
  }
92
91
  /** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
93
92
  type SekyroLevel = 0 | 1 | 2 | 3;
@@ -121,10 +120,10 @@ type SekyroResult = {
121
120
  */
122
121
  reasonCode?: string;
123
122
  /**
124
- * Present when a Sandbox session ran on simulated test data, with why. Absent in Live, on a Sandbox session an
125
- * enrolled tester ran, and when the native SDK does not report it.
123
+ * The mode a Sandbox session ran in. Absent in Live, when the session ended before a mode was set, and when the
124
+ * native SDK does not report it.
126
125
  */
127
- sandbox?: SekyroSandboxSimulation;
126
+ sandbox?: SekyroSandboxRun;
128
127
  } | {
129
128
  status: 'cancelled';
130
129
  } | {
@@ -139,7 +138,7 @@ type SekyroResult = {
139
138
  */
140
139
  declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
141
140
  /**
142
- * Version of the bundled native core: `'android 0.1.0-rc.32'` / `'ios 0.1.0-rc.32'`.
141
+ * Version of the bundled native core: `'android 0.1.0-rc.35'` / `'ios 0.1.0-rc.35'`.
143
142
  * @public
144
143
  */
145
144
  declare function nativeVersion(): string;
@@ -171,4 +170,4 @@ declare class SekyroError extends Error {
171
170
  */
172
171
  declare const SDK_VERSION: string;
173
172
 
174
- export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSandboxSimulatedReason, type SekyroSandboxSimulation, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
173
+ export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSandboxMode, type SekyroSandboxRun, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
package/dist/index.d.ts CHANGED
@@ -74,20 +74,19 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
74
74
  */
75
75
  type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
76
76
  /**
77
- * Why a Sandbox session ran on simulated test data: `no_testers` (the organization has no active Sandbox tester),
78
- * `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester
79
- * check ran and recognized nobody). @public
77
+ * The mode a Sandbox session runs in: `simulated` (test data, no real check runs) or `tester` (real checks against one
78
+ * enrolled Sandbox tester). @public
80
79
  */
81
- type SekyroSandboxSimulatedReason = 'no_testers' | 'tester_gate_not_used' | 'tester_gate_missed';
80
+ type SekyroSandboxMode = 'simulated' | 'tester';
82
81
  /**
83
- * Set on the finished result of a Sandbox session that ran on simulated test data: no real check ran, so the outcome
84
- * says nothing about the person. @public
82
+ * Set on the finished result of a Sandbox session once its mode is set (the same mode as `sandbox.mode` on
83
+ * `sessions.get` and the session webhooks). @public
85
84
  */
86
- interface SekyroSandboxSimulation {
87
- /** Always `true`. */
88
- simulated: true;
89
- /** Why the session ran on simulated test data. */
90
- reason: SekyroSandboxSimulatedReason;
85
+ interface SekyroSandboxRun {
86
+ /** `simulated`: test data, so the outcome says nothing about a person. `tester`: real checks against an enrolled tester. */
87
+ mode: SekyroSandboxMode;
88
+ /** `tester` mode only: the recognized tester's given names, when the server gives them. */
89
+ testerName?: string;
91
90
  }
92
91
  /** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
93
92
  type SekyroLevel = 0 | 1 | 2 | 3;
@@ -121,10 +120,10 @@ type SekyroResult = {
121
120
  */
122
121
  reasonCode?: string;
123
122
  /**
124
- * Present when a Sandbox session ran on simulated test data, with why. Absent in Live, on a Sandbox session an
125
- * enrolled tester ran, and when the native SDK does not report it.
123
+ * The mode a Sandbox session ran in. Absent in Live, when the session ended before a mode was set, and when the
124
+ * native SDK does not report it.
126
125
  */
127
- sandbox?: SekyroSandboxSimulation;
126
+ sandbox?: SekyroSandboxRun;
128
127
  } | {
129
128
  status: 'cancelled';
130
129
  } | {
@@ -139,7 +138,7 @@ type SekyroResult = {
139
138
  */
140
139
  declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
141
140
  /**
142
- * Version of the bundled native core: `'android 0.1.0-rc.32'` / `'ios 0.1.0-rc.32'`.
141
+ * Version of the bundled native core: `'android 0.1.0-rc.35'` / `'ios 0.1.0-rc.35'`.
143
142
  * @public
144
143
  */
145
144
  declare function nativeVersion(): string;
@@ -171,4 +170,4 @@ declare class SekyroError extends Error {
171
170
  */
172
171
  declare const SDK_VERSION: string;
173
172
 
174
- export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSandboxSimulatedReason, type SekyroSandboxSimulation, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
173
+ export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSandboxMode, type SekyroSandboxRun, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{TurboModuleRegistry as _}from"react-native";var y=_.get("SekyroReactNative");var l=class extends Error{code;constructor(o,t=o){super(t),this.name="SekyroError",this.code=o}};var E=500,R=new Set(["ar","fr","en","es","pt","de"]),N=["brand","brandFg","bg","surface","fg","fgMuted","border"],w=["danger","success","warning"],c=!1,b=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),x=/^#[0-9a-fA-F]{6}$/,h=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function S(e){(typeof e!="object"||e===null)&&a("config");for(let n of Object.keys(e))b.has(n)||a(`unknown key "${n.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let o={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&h.test(e.apiOrigin))||a("apiOrigin"),o.apiOrigin=e.apiOrigin),e.locale!==void 0&&(R.has(e.locale)||a("locale"),o.locale=e.locale);let t=e.theme;if(t){if(t.colors){let n={};for(let[s,i]of Object.entries(t.colors))if(i!==void 0){if(w.includes(s)){__DEV__&&!c&&(c=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!N.includes(s)||typeof i!="string"||!x.test(i))&&a(`theme.colors.${s.slice(0,32)}`),n[s]=i}o.colors=n}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),o.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),o.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),o.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let n=e.strings[e.locale]??{},s={},i=Object.entries(n).filter(([,r])=>r!==void 0);i.length>E&&a("strings (too many overrides)");for(let[r,u]of i)/^[a-zA-Z0-9_.]{1,96}$/.test(r)||a("strings key"),(typeof u!="string"||u.length>2e3)&&a(`strings.${r}`),s[r]=u;o.strings=s}return o}var C=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait","proof_of_address","form"]);function k(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!C.has(e.step))return null;let o=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:o,retryReason:t}:{type:"step",step:o}}var O=new Set(["verified","review_pending","not_verified"]),T=new Set([0,1,2,3]),D=new Set(["no_testers","tester_gate_not_used","tester_gate_missed"]);function d(e){return typeof e=="string"&&e!==""}function g(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){let o=O.has(e.displayStatus),t=o?e.displayStatus:"not_verified",n=t==="not_verified",s=e.sandbox?.reason;return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&T.has(e.level)?{level:e.level}:{},...d(e.assurance)?{assurance:e.assurance}:{},...n&&o&&d(e.reason)?{reason:e.reason}:{},...n&&o&&d(e.reasonCode)?{reasonCode:e.reasonCode}:{},...d(s)&&D.has(s)?{sandbox:{simulated:!0,reason:s}}:{}}}return{status:"failed",code:"unknown_error"}}function m(){if(!y)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return y}var f=!1,I=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function p(e){let o=S(e),t=m();if(f)throw new l("flow_in_progress");f=!0;let n=e.onEvent,s=n?t.onEvent(i=>{let r=k(i);r&&n(r)}):void 0;try{return g(await t.start(o))}catch(i){let r=i?.code;if(typeof r=="string"&&I.has(r))throw new l(r);return{status:"failed",code:"unknown_error"}}finally{s?.remove(),f=!1}}function F(){return m().nativeVersion()}import{useEffect as V,useRef as v}from"react";function L(e){let o=v(null),t=v(e);return t.current=e,V(()=>{if(o.current===e.clientToken)return;o.current=e.clientToken;let{onResult:n,onEvent:s,...i}=t.current;p({...i,onEvent:r=>t.current.onEvent?.(r)}).then(r=>t.current.onResult(r),r=>t.current.onResult({status:"failed",code:r instanceof l?r.code:"unknown_error"}))},[e.clientToken]),null}var M="0.1.0-rc.40";export{M as SDK_VERSION,l as SekyroError,L as SekyroFlow,F as nativeVersion,p as startSekyro};
1
+ import{TurboModuleRegistry as _}from"react-native";var f=_.get("SekyroReactNative");var l=class extends Error{code;constructor(o,t=o){super(t),this.name="SekyroError",this.code=o}};var E=500,R=new Set(["ar","fr","en","es","pt","de"]),N=["brand","brandFg","bg","surface","fg","fgMuted","border"],w=["danger","success","warning"],c=!1,b=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),x=/^#[0-9a-fA-F]{6}$/,C=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,a=e=>{throw new l("invalid_config",`invalid config: ${e}`)};function S(e){(typeof e!="object"||e===null)&&a("config");for(let n of Object.keys(e))b.has(n)||a(`unknown key "${n.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let o={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&C.test(e.apiOrigin))||a("apiOrigin"),o.apiOrigin=e.apiOrigin),e.locale!==void 0&&(R.has(e.locale)||a("locale"),o.locale=e.locale);let t=e.theme;if(t){if(t.colors){let n={};for(let[s,i]of Object.entries(t.colors))if(i!==void 0){if(w.includes(s)){__DEV__&&!c&&(c=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!N.includes(s)||typeof i!="string"||!x.test(i))&&a(`theme.colors.${s.slice(0,32)}`),n[s]=i}o.colors=n}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),o.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),o.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),o.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let n=e.strings[e.locale]??{},s={},i=Object.entries(n).filter(([,r])=>r!==void 0);i.length>E&&a("strings (too many overrides)");for(let[r,u]of i)/^[a-zA-Z0-9_.]{1,96}$/.test(r)||a("strings key"),(typeof u!="string"||u.length>2e3)&&a(`strings.${r}`),s[r]=u;o.strings=s}return o}var h=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait","proof_of_address","form"]);function k(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!h.has(e.step))return null;let o=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:o,retryReason:t}:{type:"step",step:o}}var O=new Set(["verified","review_pending","not_verified"]),T=new Set([0,1,2,3]);function d(e){return typeof e=="string"&&e!==""}function I(e){if(typeof e!="object"||e===null)return;let{mode:o,testerName:t}=e;if(o==="simulated")return{mode:o};if(o==="tester")return d(t)&&t.trim()!==""?{mode:o,testerName:t.trim()}:{mode:o}}function g(e){if(e.status==="cancelled")return{status:"cancelled"};if(e.status==="failed")return{status:"failed",code:e.code||"unknown_error"};if(e.status==="finished"&&e.sessionId){let o=O.has(e.displayStatus),t=o?e.displayStatus:"not_verified",n=t==="not_verified",s=I(e.sandbox);return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&T.has(e.level)?{level:e.level}:{},...d(e.assurance)?{assurance:e.assurance}:{},...n&&o&&d(e.reason)?{reason:e.reason}:{},...n&&o&&d(e.reasonCode)?{reasonCode:e.reasonCode}:{},...s!==void 0?{sandbox:s}:{}}}return{status:"failed",code:"unknown_error"}}function m(){if(!f)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return f}var y=!1,D=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function p(e){let o=S(e),t=m();if(y)throw new l("flow_in_progress");y=!0;let n=e.onEvent,s=n?t.onEvent(i=>{let r=k(i);r&&n(r)}):void 0;try{return g(await t.start(o))}catch(i){let r=i?.code;if(typeof r=="string"&&D.has(r))throw new l(r);return{status:"failed",code:"unknown_error"}}finally{s?.remove(),y=!1}}function F(){return m().nativeVersion()}import{useEffect as V,useRef as v}from"react";function M(e){let o=v(null),t=v(e);return t.current=e,V(()=>{if(o.current===e.clientToken)return;o.current=e.clientToken;let{onResult:n,onEvent:s,...i}=t.current;p({...i,onEvent:r=>t.current.onEvent?.(r)}).then(r=>t.current.onResult(r),r=>t.current.onResult({status:"failed",code:r instanceof l?r.code:"unknown_error"}))},[e.clientToken]),null}var L="0.1.0-rc.42";export{L as SDK_VERSION,l as SekyroError,M as SekyroFlow,F as nativeVersion,p as startSekyro};
@@ -54,7 +54,7 @@ public final class SekyroRNBridge: NSObject {
54
54
 
55
55
  /// The native SDK's own wire form (`SekyroWire.dictionary`): status, session id, display status (`verified`,
56
56
  /// `review_pending`, `not_verified`), `reason` and `reasonCode` on `not_verified`, `level` and `assurance` when known,
57
- /// `sandbox` (`{ simulated: true, reason }`) when a Sandbox session ran on simulated test data,
57
+ /// `sandbox` (`{ mode, testerName? }`) once a Sandbox session's mode is set,
58
58
  /// and the failure code, without matching the result's associated values here.
59
59
  static func wire(_ result: SekyroResult) -> NSDictionary {
60
60
  SekyroWire.dictionary(result) as NSDictionary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/react-native",
3
- "version": "0.1.0-rc.40",
3
+ "version": "0.1.0-rc.42",
4
4
  "private": false,
5
5
  "description": "Sekyro AI eKYC for React Native — glue over the binary Android and iOS SDKs (New Architecture)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -99,7 +99,7 @@
99
99
  }
100
100
  },
101
101
  "sekyro": {
102
- "android": "0.1.0-rc.32",
103
- "ios": "0.1.0-rc.32"
102
+ "android": "0.1.0-rc.35",
103
+ "ios": "0.1.0-rc.35"
104
104
  }
105
105
  }
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "application",
98
98
  "name": "react-native",
99
99
  "group": "@sekyro",
100
- "version": "0.1.0-rc.40",
101
- "bom-ref": "@sekyro/react-native@0.1.0-rc.40",
100
+ "version": "0.1.0-rc.42",
101
+ "bom-ref": "@sekyro/react-native@0.1.0-rc.42",
102
102
  "description": "Sekyro AI eKYC for React Native — glue over the binary Android and iOS SDKs (New Architecture)",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40sekyro/react-native@0.1.0-rc.40?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23sekyro-mobile%2Freact-native",
111
+ "purl": "pkg:npm/%40sekyro/react-native@0.1.0-rc.42?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23sekyro-mobile%2Freact-native",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
@@ -147,7 +147,7 @@
147
147
  "components": [],
148
148
  "dependencies": [
149
149
  {
150
- "ref": "@sekyro/react-native@0.1.0-rc.40"
150
+ "ref": "@sekyro/react-native@0.1.0-rc.42"
151
151
  }
152
152
  ]
153
153
  }
@@ -31,7 +31,7 @@ export type NativeConfig = {
31
31
  strings?: UnsafeObject;
32
32
  };
33
33
 
34
- export type NativeSandbox = { simulated?: boolean; reason?: string };
34
+ export type NativeSandbox = { mode?: string; testerName?: string };
35
35
 
36
36
  export type NativeResult = {
37
37
  status: string;