@sekyro/react-native 0.1.0-rc.21 → 0.1.0-rc.23
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 +16 -0
- package/README.md +7 -1
- package/android/src/main/java/ai/sekyro/reactnative/ConfigMapper.kt +18 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +1 -1
- package/ios/SekyroRNBridge.swift +1 -0
- package/package.json +3 -3
- package/sbom.cdx.json +4 -4
- package/src/specs/NativeSekyroReactNative.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @sekyro/react-native
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3e254cf: Pins the native SDKs 0.1.0-rc.20: `sandbox` on the finished result and the "This was a simulation" notice on the result screen, the display kept awake while the liveness camera is up, the result screen's "Continue" button and copy for a person who is still in your app, a verified title that says what the session proved, and the verified mark drawn in again. No change of its own.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-rc.22
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 14faf9e: The finished result says when a Sandbox session ran on simulated test data. `sandbox` is `{ simulated: true, reason }`, where `reason` is `no_testers` (your organization has no active Sandbox tester), `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester check ran and recognized nobody). No real check ran on such a session, so its outcome says nothing about the person. The field is absent in Live and on a Sandbox session an enrolled tester ran. The new types `SekyroSandboxSimulation` and `SekyroSandboxSimulatedReason` are exported. The result screen shows the same notice. The field arrives with the next native SDK release: until the package pins it, `sandbox` is always absent.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 5379d91: A level 1 result that is not exactly one phone code or one email code (for example both confirmed, or a contact your organization supplied) is now titled "Your details are confirmed" instead of "You're verified". Level 2 and a result with no level keep "You're verified". The same on Android, iOS and Flutter. All six languages. New string key you can override through `strings`: `session.result.verified.titleContact`.
|
|
18
|
+
|
|
3
19
|
## 0.1.0-rc.21
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ const result = await startSekyro({
|
|
|
58
58
|
theme: { colors: { brand: '#0F68B1' }, radius: 12 },
|
|
59
59
|
onEvent: (e) => console.log(e.type), // step telemetry, no personal data
|
|
60
60
|
});
|
|
61
|
-
// { status: 'finished', sessionId, displayStatus, reason?, reasonCode? } | { status: 'cancelled' } | { status: 'failed', code }
|
|
61
|
+
// { status: 'finished', sessionId, displayStatus, reason?, reasonCode?, sandbox? } | { status: 'cancelled' } | { status: 'failed', code }
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
`displayStatus` is what the person was shown: `verified`, `review_pending` or `not_verified`. On `not_verified`,
|
|
@@ -66,6 +66,12 @@ 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.
|
|
74
|
+
|
|
69
75
|
Or declaratively: `<SekyroFlow clientToken={token} onResult={setResult} />` (renders nothing).
|
|
70
76
|
|
|
71
77
|
Never log the `clientToken`; it is a one-time bearer credential.
|
|
@@ -59,24 +59,39 @@ internal object ConfigMapper {
|
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
|
|
62
|
+
/**
|
|
63
|
+
* [into] and [newMap] (the nested `sandbox` map) are injectable so JVM tests can use a JavaOnlyMap
|
|
64
|
+
* (Arguments.createMap() needs the RN native libs).
|
|
65
|
+
*/
|
|
66
|
+
fun toWire(
|
|
67
|
+
r: SekyroResult,
|
|
68
|
+
into: WritableMap = Arguments.createMap(),
|
|
69
|
+
newMap: () -> WritableMap = { Arguments.createMap() },
|
|
70
|
+
): WritableMap = into.apply {
|
|
64
71
|
when (r) {
|
|
65
72
|
is SekyroResult.Finished -> {
|
|
66
73
|
putString("status", "finished"); putString("sessionId", r.sessionId)
|
|
67
74
|
// Everything else from the native SDK's own wire form (SekyroWire.result), so the JS side reads the same
|
|
68
75
|
// strings as Flutter: displayStatus verified | review_pending | not_verified, reason and reasonCode on
|
|
69
76
|
// not_verified, level (1 Contact, 2 Human, 3 Identity, 0 nothing proven) and assurance once decided. Each
|
|
70
|
-
// key only when known: JS reads absent as "none".
|
|
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.
|
|
71
79
|
val wire = SekyroWire.result(r)
|
|
72
80
|
(wire["displayStatus"] as? String)?.let { putString("displayStatus", it) }
|
|
73
81
|
(wire["level"] as? Int)?.takeIf { it in 0..3 }?.let { putInt("level", it) }
|
|
74
82
|
for (key in listOf("assurance", "reason", "reasonCode")) {
|
|
75
83
|
(wire[key] as? String)?.takeIf { it.isNotEmpty() }?.let { putString(key, it) }
|
|
76
84
|
}
|
|
85
|
+
sandboxReason(wire)?.let { reason ->
|
|
86
|
+
putMap("sandbox", newMap().apply { putBoolean("simulated", true); putString("reason", reason) })
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
SekyroResult.Cancelled -> putString("status", "cancelled")
|
|
79
90
|
is SekyroResult.Failed -> { putString("status", "failed"); putString("code", r.code) }
|
|
80
91
|
}
|
|
81
92
|
}
|
|
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() }
|
|
82
97
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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"]);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.23";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
|
package/dist/index.d.cts
CHANGED
|
@@ -72,6 +72,22 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
|
72
72
|
* `cancelled` (your organization cancelled it) or `superseded` (a newer session of the same person took over). A newer server may add one; it is passed through as its string. @public
|
|
73
73
|
*/
|
|
74
74
|
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
75
|
+
/**
|
|
76
|
+
* Why a Sandbox session ran on simulated test data: `no_testers` (the organization has no active Sandbox tester),
|
|
77
|
+
* `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester
|
|
78
|
+
* check ran and recognized nobody). @public
|
|
79
|
+
*/
|
|
80
|
+
type SekyroSandboxSimulatedReason = 'no_testers' | 'tester_gate_not_used' | 'tester_gate_missed';
|
|
81
|
+
/**
|
|
82
|
+
* Set on the finished result of a Sandbox session that ran on simulated test data: no real check ran, so the outcome
|
|
83
|
+
* says nothing about the person. @public
|
|
84
|
+
*/
|
|
85
|
+
interface SekyroSandboxSimulation {
|
|
86
|
+
/** Always `true`. */
|
|
87
|
+
simulated: true;
|
|
88
|
+
/** Why the session ran on simulated test data. */
|
|
89
|
+
reason: SekyroSandboxSimulatedReason;
|
|
90
|
+
}
|
|
75
91
|
/** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
|
|
76
92
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
77
93
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
@@ -99,6 +115,11 @@ type SekyroResult = {
|
|
|
99
115
|
reason?: SekyroSessionReason | (string & {});
|
|
100
116
|
/** `not_verified` only: the machine-readable code behind `reason` (for example `device_cooldown`), when there is one. */
|
|
101
117
|
reasonCode?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Present when a Sandbox session ran on simulated test data, with why. Absent in Live, on a Sandbox session an
|
|
120
|
+
* enrolled tester ran, and when the native SDK does not report it.
|
|
121
|
+
*/
|
|
122
|
+
sandbox?: SekyroSandboxSimulation;
|
|
102
123
|
} | {
|
|
103
124
|
status: 'cancelled';
|
|
104
125
|
} | {
|
|
@@ -113,7 +134,7 @@ type SekyroResult = {
|
|
|
113
134
|
*/
|
|
114
135
|
declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
|
|
115
136
|
/**
|
|
116
|
-
* Version of the bundled native core: `'android 0.1.0-rc.
|
|
137
|
+
* Version of the bundled native core: `'android 0.1.0-rc.20'` / `'ios 0.1.0-rc.20'`.
|
|
117
138
|
* @public
|
|
118
139
|
*/
|
|
119
140
|
declare function nativeVersion(): string;
|
|
@@ -145,4 +166,4 @@ declare class SekyroError extends Error {
|
|
|
145
166
|
*/
|
|
146
167
|
declare const SDK_VERSION: string;
|
|
147
168
|
|
|
148
|
-
export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
|
|
169
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,22 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
|
72
72
|
* `cancelled` (your organization cancelled it) or `superseded` (a newer session of the same person took over). A newer server may add one; it is passed through as its string. @public
|
|
73
73
|
*/
|
|
74
74
|
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
75
|
+
/**
|
|
76
|
+
* Why a Sandbox session ran on simulated test data: `no_testers` (the organization has no active Sandbox tester),
|
|
77
|
+
* `tester_gate_not_used` (nobody ran the tester check at the start of the session) or `tester_gate_missed` (the tester
|
|
78
|
+
* check ran and recognized nobody). @public
|
|
79
|
+
*/
|
|
80
|
+
type SekyroSandboxSimulatedReason = 'no_testers' | 'tester_gate_not_used' | 'tester_gate_missed';
|
|
81
|
+
/**
|
|
82
|
+
* Set on the finished result of a Sandbox session that ran on simulated test data: no real check ran, so the outcome
|
|
83
|
+
* says nothing about the person. @public
|
|
84
|
+
*/
|
|
85
|
+
interface SekyroSandboxSimulation {
|
|
86
|
+
/** Always `true`. */
|
|
87
|
+
simulated: true;
|
|
88
|
+
/** Why the session ran on simulated test data. */
|
|
89
|
+
reason: SekyroSandboxSimulatedReason;
|
|
90
|
+
}
|
|
75
91
|
/** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
|
|
76
92
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
77
93
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
@@ -99,6 +115,11 @@ type SekyroResult = {
|
|
|
99
115
|
reason?: SekyroSessionReason | (string & {});
|
|
100
116
|
/** `not_verified` only: the machine-readable code behind `reason` (for example `device_cooldown`), when there is one. */
|
|
101
117
|
reasonCode?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Present when a Sandbox session ran on simulated test data, with why. Absent in Live, on a Sandbox session an
|
|
120
|
+
* enrolled tester ran, and when the native SDK does not report it.
|
|
121
|
+
*/
|
|
122
|
+
sandbox?: SekyroSandboxSimulation;
|
|
102
123
|
} | {
|
|
103
124
|
status: 'cancelled';
|
|
104
125
|
} | {
|
|
@@ -113,7 +134,7 @@ type SekyroResult = {
|
|
|
113
134
|
*/
|
|
114
135
|
declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
|
|
115
136
|
/**
|
|
116
|
-
* Version of the bundled native core: `'android 0.1.0-rc.
|
|
137
|
+
* Version of the bundled native core: `'android 0.1.0-rc.20'` / `'ios 0.1.0-rc.20'`.
|
|
117
138
|
* @public
|
|
118
139
|
*/
|
|
119
140
|
declare function nativeVersion(): string;
|
|
@@ -145,4 +166,4 @@ declare class SekyroError extends Error {
|
|
|
145
166
|
*/
|
|
146
167
|
declare const SDK_VERSION: string;
|
|
147
168
|
|
|
148
|
-
export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroSessionReason, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
|
|
169
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TurboModuleRegistry as _}from"react-native";var y=_.get("SekyroReactNative");var
|
|
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"]);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.23";export{M as SDK_VERSION,l as SekyroError,L as SekyroFlow,F as nativeVersion,p as startSekyro};
|
package/ios/SekyroRNBridge.swift
CHANGED
|
@@ -54,6 +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
58
|
/// and the failure code, without matching the result's associated values here.
|
|
58
59
|
static func wire(_ result: SekyroResult) -> NSDictionary {
|
|
59
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.
|
|
3
|
+
"version": "0.1.0-rc.23",
|
|
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.
|
|
103
|
-
"ios": "0.1.0-rc.
|
|
102
|
+
"android": "0.1.0-rc.20",
|
|
103
|
+
"ios": "0.1.0-rc.20"
|
|
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.
|
|
101
|
-
"bom-ref": "@sekyro/react-native@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.23",
|
|
101
|
+
"bom-ref": "@sekyro/react-native@0.1.0-rc.23",
|
|
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.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/react-native@0.1.0-rc.23?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.
|
|
150
|
+
"ref": "@sekyro/react-native@0.1.0-rc.23"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|
|
@@ -31,6 +31,8 @@ export type NativeConfig = {
|
|
|
31
31
|
strings?: UnsafeObject;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
export type NativeSandbox = { simulated?: boolean; reason?: string };
|
|
35
|
+
|
|
34
36
|
export type NativeResult = {
|
|
35
37
|
status: string;
|
|
36
38
|
sessionId?: string;
|
|
@@ -40,6 +42,7 @@ export type NativeResult = {
|
|
|
40
42
|
assurance?: string;
|
|
41
43
|
reason?: string;
|
|
42
44
|
reasonCode?: string;
|
|
45
|
+
sandbox?: NativeSandbox;
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export type NativeEvent = { type: string; step?: string; retryReason?: string; seq: Int32 };
|