@sekyro/react-native 0.1.0-rc.14 → 0.1.0-rc.16
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 +6 -1
- package/android/src/main/java/ai/sekyro/reactnative/ConfigMapper.kt +7 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +22 -9
- package/dist/index.d.ts +22 -9
- package/dist/index.js +1 -1
- package/ios/SekyroRNBridge.swift +3 -2
- package/package.json +3 -3
- package/sbom.cdx.json +4 -4
- package/src/specs/NativeSekyroReactNative.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @sekyro/react-native
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6128176: Breaking: the finished result's `displayStatus` is `verified`, `review_pending` or `not_verified` (was `approved`, `review_pending`, `rejected`, `expired`). On `not_verified` the result carries `reason` (`rejected`, `inconclusive`, `unavailable`, `abandoned`, `not_opened`, `policy`, `cancelled` or `superseded`) and `reasonCode` when there is one. A session that expired is `not_verified` with its reason; a superseded session is `not_verified` with `reason: 'superseded'`. A display status this version does not know reads as `not_verified`, never `review_pending`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 66f490f: Pins the native SDKs 0.1.0-rc.15: the session outcome model on the native screens (verified, under review or not verified, with the reason), screen ramp v2 (the full-screen liveness colour flash), the clip frame count on each liveness video, a face match that asks for another try records a new liveness video, and retake screens that teach the fix for their own reason.
|
|
12
|
+
|
|
13
|
+
## 0.1.0-rc.15
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 06a272a: Pins the native SDKs 0.1.0-rc.14: in a Sandbox simulation the code screens show the code to enter and the capture screens offer "Skip with test data"; the document country list starts with the person's own country; back from the portrait camera returns to its instructions; the ID photo check accepts one eye that is always less open and a relaxed narrow mouth.
|
|
18
|
+
|
|
3
19
|
## 0.1.0-rc.14
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -58,9 +58,14 @@ 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 } | { status: 'cancelled' } | { status: 'failed', code }
|
|
61
|
+
// { status: 'finished', sessionId, displayStatus, reason?, reasonCode? } | { status: 'cancelled' } | { status: 'failed', code }
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
`displayStatus` is what the person was shown: `verified`, `review_pending` or `not_verified`. On `not_verified`,
|
|
65
|
+
`reason` says why (`rejected`, `inconclusive`, `unavailable`, `abandoned`, `not_opened`, `policy`, `cancelled` or
|
|
66
|
+
`superseded`) and `reasonCode` gives the code behind it when there is one. Read the decision itself server-side
|
|
67
|
+
(webhooks or `sessions.get`).
|
|
68
|
+
|
|
64
69
|
Or declaratively: `<SekyroFlow clientToken={token} onResult={setResult} />` (renders nothing).
|
|
65
70
|
|
|
66
71
|
Never log the `clientToken`; it is a one-time bearer credential.
|
|
@@ -5,7 +5,6 @@ import ai.sekyro.SekyroLocale
|
|
|
5
5
|
import ai.sekyro.SekyroResult
|
|
6
6
|
import ai.sekyro.SekyroTheme
|
|
7
7
|
import ai.sekyro.SekyroWire
|
|
8
|
-
import ai.sekyro.core.DisplayStatus
|
|
9
8
|
import com.facebook.react.bridge.Arguments
|
|
10
9
|
import com.facebook.react.bridge.ReadableMap
|
|
11
10
|
import com.facebook.react.bridge.ReadableType
|
|
@@ -65,16 +64,15 @@ internal object ConfigMapper {
|
|
|
65
64
|
when (r) {
|
|
66
65
|
is SekyroResult.Finished -> {
|
|
67
66
|
putString("status", "finished"); putString("sessionId", r.sessionId)
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
DisplayStatus.REJECTED -> "rejected"; DisplayStatus.EXPIRED -> "expired"
|
|
72
|
-
})
|
|
73
|
-
// The level and how it was proved when the native SDK reports them (rc.13 on), read from its own wire
|
|
74
|
-
// form (so the glue builds against an older pin too).
|
|
67
|
+
// Everything else from the native SDK's own wire form (SekyroWire.result), so the JS side reads the same
|
|
68
|
+
// strings as Flutter: displayStatus verified | review_pending | not_verified, reason and reasonCode on
|
|
69
|
+
// not_verified, level and assurance once decided. Each key only when known: JS reads absent as "none".
|
|
75
70
|
val wire = SekyroWire.result(r)
|
|
71
|
+
(wire["displayStatus"] as? String)?.let { putString("displayStatus", it) }
|
|
76
72
|
(wire["level"] as? Int)?.takeIf { it in 0..3 }?.let { putInt("level", it) }
|
|
77
|
-
|
|
73
|
+
for (key in listOf("assurance", "reason", "reasonCode")) {
|
|
74
|
+
(wire[key] as? String)?.takeIf { it.isNotEmpty() }?.let { putString(key, it) }
|
|
75
|
+
}
|
|
78
76
|
}
|
|
79
77
|
SekyroResult.Cancelled -> putString("status", "cancelled")
|
|
80
78
|
is SekyroResult.Failed -> { putString("status", "failed"); putString("code", r.code) }
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var b=(e,r)=>{for(var t in r)d(e,t,{get:r[t],enumerable:!0})},x=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of h(r))!O.call(e,s)&&s!==t&&d(e,s,{get:()=>r[s],enumerable:!(n=C(r,s))||n.enumerable});return e};var T=e=>x(d({},"__esModule",{value:!0}),e);var Y={};b(Y,{SDK_VERSION:()=>w,SekyroError:()=>l,SekyroFlow:()=>N,nativeVersion:()=>R,startSekyro:()=>y});module.exports=T(Y);var k=require("react-native"),p=k.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};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,L=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),M=/^#[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 v(e){(typeof e!="object"||e===null)&&a("config");for(let n of Object.keys(e))L.has(n)||a(`unknown key "${n.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&a("clientToken");let r={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"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(D.has(e.locale)||a("locale"),r.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(V.includes(s)){__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(s)||typeof i!="string"||!M.test(i))&&a(`theme.colors.${s.slice(0,32)}`),n[s]=i}r.colors=n}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&a("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&a("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||a("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||a("strings need locale");let n=e.strings[e.locale]??{},s={},i=Object.entries(n).filter(([,o])=>o!==void 0);i.length>I&&a("strings (too many overrides)");for(let[o,f]of i)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||a("strings key"),(typeof f!="string"||f.length>2e3)&&a(`strings.${o}`),s[o]=f;r.strings=s}return r}var A=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function m(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!A.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var P=new Set(["verified","review_pending","not_verified"]),j=new Set([0,1,2,3]);function c(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 r=P.has(e.displayStatus),t=r?e.displayStatus:"not_verified",n=t==="not_verified";return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&j.has(e.level)?{level:e.level}:{},...c(e.assurance)?{assurance:e.assurance}:{},...n&&r&&c(e.reason)?{reason:e.reason}:{},...n&&r&&c(e.reasonCode)?{reasonCode:e.reasonCode}:{}}}return{status:"failed",code:"unknown_error"}}function E(){if(!p)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return p}var S=!1,K=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function y(e){let r=v(e),t=E();if(S)throw new l("flow_in_progress");S=!0;let n=e.onEvent,s=n?t.onEvent(i=>{let o=m(i);o&&n(o)}):void 0;try{return _(await t.start(r))}catch(i){let o=i?.code;if(typeof o=="string"&&K.has(o))throw new l(o);return{status:"failed",code:"unknown_error"}}finally{s?.remove(),S=!1}}function R(){return E().nativeVersion()}var u=require("react");function N(e){let r=(0,u.useRef)(null),t=(0,u.useRef)(e);return t.current=e,(0,u.useEffect)(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:n,onEvent:s,...i}=t.current;y({...i,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof l?o.code:"unknown_error"}))},[e.clientToken]),null}var w="0.1.0-rc.16";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
|
package/dist/index.d.cts
CHANGED
|
@@ -46,7 +46,7 @@ type SekyroEvent = {
|
|
|
46
46
|
interface SekyroConfig {
|
|
47
47
|
/** One-time session token from your backend (`sessions.create`). Never logged. */
|
|
48
48
|
clientToken: string;
|
|
49
|
-
/**
|
|
49
|
+
/** Leave unset: the default, `https://api.sekyro.ai`, serves Sandbox and Live sessions. */
|
|
50
50
|
apiOrigin?: string;
|
|
51
51
|
/**
|
|
52
52
|
* UI language of the flow; required when `strings` is set. Without it, the device language when it is one of the
|
|
@@ -61,11 +61,17 @@ interface SekyroConfig {
|
|
|
61
61
|
onEvent?: (event: SekyroEvent) => void;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* What the end user was shown; not the decision. `
|
|
65
|
-
* asked to start again from your app), as on the native SDKs. @public
|
|
64
|
+
* What the end user was shown; not the decision. `not_verified` comes with a {@link SekyroSessionReason}. @public
|
|
66
65
|
*/
|
|
67
|
-
type SekyroDisplayStatus = '
|
|
68
|
-
/**
|
|
66
|
+
type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
67
|
+
/**
|
|
68
|
+
* Why a session ended `not_verified`: `rejected` (a check failed), `inconclusive` (no verdict could be reached),
|
|
69
|
+
* `unavailable` (a check could not run), `abandoned` (the person left before a result), `not_opened` (nobody opened the
|
|
70
|
+
* link), `policy` (a flow rule stopped it), `cancelled` (your organization cancelled it) or `superseded` (a newer session
|
|
71
|
+
* of the same person took over). A newer server may add one; it is passed through as its string. @public
|
|
72
|
+
*/
|
|
73
|
+
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
74
|
+
/** The verification level a finished session proved (0 = not verified). @public */
|
|
69
75
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
70
76
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
71
77
|
type SekyroResult = {
|
|
@@ -73,8 +79,8 @@ type SekyroResult = {
|
|
|
73
79
|
sessionId: string;
|
|
74
80
|
displayStatus: SekyroDisplayStatus;
|
|
75
81
|
/**
|
|
76
|
-
* What the session proved (0 to 3, 0 =
|
|
77
|
-
*
|
|
82
|
+
* What the session proved (0 to 3, 0 = not verified), when the native SDK reports it. Absent when the session
|
|
83
|
+
* closed without one (for example a link nobody opened).
|
|
78
84
|
*/
|
|
79
85
|
level?: SekyroLevel;
|
|
80
86
|
/**
|
|
@@ -82,6 +88,13 @@ type SekyroResult = {
|
|
|
82
88
|
* `supplied_biometric` or `eid_authenticated` (a newer server may add one). Absent when the server reports none.
|
|
83
89
|
*/
|
|
84
90
|
assurance?: string;
|
|
91
|
+
/**
|
|
92
|
+
* `not_verified` only: why, when the native SDK reports it. Absent on `verified` and `review_pending`, and when the
|
|
93
|
+
* session did not say.
|
|
94
|
+
*/
|
|
95
|
+
reason?: SekyroSessionReason | (string & {});
|
|
96
|
+
/** `not_verified` only: the machine-readable code behind `reason` (for example `device_cooldown`), when there is one. */
|
|
97
|
+
reasonCode?: string;
|
|
85
98
|
} | {
|
|
86
99
|
status: 'cancelled';
|
|
87
100
|
} | {
|
|
@@ -96,7 +109,7 @@ type SekyroResult = {
|
|
|
96
109
|
*/
|
|
97
110
|
declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
|
|
98
111
|
/**
|
|
99
|
-
* Version of the bundled native core: `'android 0.1.0-rc.
|
|
112
|
+
* Version of the bundled native core: `'android 0.1.0-rc.15'` / `'ios 0.1.0-rc.15'`.
|
|
100
113
|
* @public
|
|
101
114
|
*/
|
|
102
115
|
declare function nativeVersion(): string;
|
|
@@ -128,4 +141,4 @@ declare class SekyroError extends Error {
|
|
|
128
141
|
*/
|
|
129
142
|
declare const SDK_VERSION: string;
|
|
130
143
|
|
|
131
|
-
export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
|
|
144
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ type SekyroEvent = {
|
|
|
46
46
|
interface SekyroConfig {
|
|
47
47
|
/** One-time session token from your backend (`sessions.create`). Never logged. */
|
|
48
48
|
clientToken: string;
|
|
49
|
-
/**
|
|
49
|
+
/** Leave unset: the default, `https://api.sekyro.ai`, serves Sandbox and Live sessions. */
|
|
50
50
|
apiOrigin?: string;
|
|
51
51
|
/**
|
|
52
52
|
* UI language of the flow; required when `strings` is set. Without it, the device language when it is one of the
|
|
@@ -61,11 +61,17 @@ interface SekyroConfig {
|
|
|
61
61
|
onEvent?: (event: SekyroEvent) => void;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* What the end user was shown; not the decision. `
|
|
65
|
-
* asked to start again from your app), as on the native SDKs. @public
|
|
64
|
+
* What the end user was shown; not the decision. `not_verified` comes with a {@link SekyroSessionReason}. @public
|
|
66
65
|
*/
|
|
67
|
-
type SekyroDisplayStatus = '
|
|
68
|
-
/**
|
|
66
|
+
type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
67
|
+
/**
|
|
68
|
+
* Why a session ended `not_verified`: `rejected` (a check failed), `inconclusive` (no verdict could be reached),
|
|
69
|
+
* `unavailable` (a check could not run), `abandoned` (the person left before a result), `not_opened` (nobody opened the
|
|
70
|
+
* link), `policy` (a flow rule stopped it), `cancelled` (your organization cancelled it) or `superseded` (a newer session
|
|
71
|
+
* of the same person took over). A newer server may add one; it is passed through as its string. @public
|
|
72
|
+
*/
|
|
73
|
+
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
74
|
+
/** The verification level a finished session proved (0 = not verified). @public */
|
|
69
75
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
70
76
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
71
77
|
type SekyroResult = {
|
|
@@ -73,8 +79,8 @@ type SekyroResult = {
|
|
|
73
79
|
sessionId: string;
|
|
74
80
|
displayStatus: SekyroDisplayStatus;
|
|
75
81
|
/**
|
|
76
|
-
* What the session proved (0 to 3, 0 =
|
|
77
|
-
*
|
|
82
|
+
* What the session proved (0 to 3, 0 = not verified), when the native SDK reports it. Absent when the session
|
|
83
|
+
* closed without one (for example a link nobody opened).
|
|
78
84
|
*/
|
|
79
85
|
level?: SekyroLevel;
|
|
80
86
|
/**
|
|
@@ -82,6 +88,13 @@ type SekyroResult = {
|
|
|
82
88
|
* `supplied_biometric` or `eid_authenticated` (a newer server may add one). Absent when the server reports none.
|
|
83
89
|
*/
|
|
84
90
|
assurance?: string;
|
|
91
|
+
/**
|
|
92
|
+
* `not_verified` only: why, when the native SDK reports it. Absent on `verified` and `review_pending`, and when the
|
|
93
|
+
* session did not say.
|
|
94
|
+
*/
|
|
95
|
+
reason?: SekyroSessionReason | (string & {});
|
|
96
|
+
/** `not_verified` only: the machine-readable code behind `reason` (for example `device_cooldown`), when there is one. */
|
|
97
|
+
reasonCode?: string;
|
|
85
98
|
} | {
|
|
86
99
|
status: 'cancelled';
|
|
87
100
|
} | {
|
|
@@ -96,7 +109,7 @@ type SekyroResult = {
|
|
|
96
109
|
*/
|
|
97
110
|
declare function startSekyro(config: SekyroConfig): Promise<SekyroResult>;
|
|
98
111
|
/**
|
|
99
|
-
* Version of the bundled native core: `'android 0.1.0-rc.
|
|
112
|
+
* Version of the bundled native core: `'android 0.1.0-rc.15'` / `'ios 0.1.0-rc.15'`.
|
|
100
113
|
* @public
|
|
101
114
|
*/
|
|
102
115
|
declare function nativeVersion(): string;
|
|
@@ -128,4 +141,4 @@ declare class SekyroError extends Error {
|
|
|
128
141
|
*/
|
|
129
142
|
declare const SDK_VERSION: string;
|
|
130
143
|
|
|
131
|
-
export { SDK_VERSION, type SekyroColorRole, type SekyroConfig, type SekyroDisplayStatus, SekyroError, type SekyroErrorCode, type SekyroEvent, SekyroFlow, type SekyroFlowProps, type SekyroLevel, type SekyroLocale, type SekyroResult, type SekyroStep, type SekyroTheme, nativeVersion, startSekyro };
|
|
144
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TurboModuleRegistry as
|
|
1
|
+
import{TurboModuleRegistry as _}from"react-native";var y=_.get("SekyroReactNative");var a=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};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,C=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),h=/^#[0-9a-fA-F]{6}$/,O=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,i=e=>{throw new a("invalid_config",`invalid config: ${e}`)};function S(e){(typeof e!="object"||e===null)&&i("config");for(let n of Object.keys(e))C.has(n)||i(`unknown key "${n.slice(0,32)}"`);(typeof e.clientToken!="string"||e.clientToken.length===0)&&i("clientToken");let r={clientToken:e.clientToken};e.apiOrigin!==void 0&&(typeof e.apiOrigin=="string"&&(/^https:\/\/[a-z0-9.-]+(:\d+)?$/i.test(e.apiOrigin)||__DEV__&&O.test(e.apiOrigin))||i("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(R.has(e.locale)||i("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let n={};for(let[l,s]of Object.entries(t.colors))if(s!==void 0){if(w.includes(l)){__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(l)||typeof s!="string"||!h.test(s))&&i(`theme.colors.${l.slice(0,32)}`),n[l]=s}r.colors=n}t.radius!==void 0&&((typeof t.radius!="number"||!Number.isFinite(t.radius)||t.radius<0||t.radius>32)&&i("theme.radius"),r.radius=t.radius),t.fontFamily!==void 0&&((typeof t.fontFamily!="string"||!/^[\w .-]{1,64}$/.test(t.fontFamily))&&i("theme.fontFamily"),r.fontFamily=t.fontFamily),t.darkMode!==void 0&&(["system","light","dark"].includes(t.darkMode)||i("theme.darkMode"),r.darkMode=t.darkMode)}if(e.strings){e.locale||i("strings need locale");let n=e.strings[e.locale]??{},l={},s=Object.entries(n).filter(([,o])=>o!==void 0);s.length>E&&i("strings (too many overrides)");for(let[o,u]of s)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||i("strings key"),(typeof u!="string"||u.length>2e3)&&i(`strings.${o}`),l[o]=u;r.strings=l}return r}var b=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function k(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!b.has(e.step))return null;let r=e.step,t=typeof e.retryReason=="string"&&/^[a-z0-9_]{1,64}$/.test(e.retryReason)?e.retryReason:void 0;return t?{type:"step",step:r,retryReason:t}:{type:"step",step:r}}var x=new Set(["verified","review_pending","not_verified"]),T=new Set([0,1,2,3]);function f(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 r=x.has(e.displayStatus),t=r?e.displayStatus:"not_verified",n=t==="not_verified";return{status:"finished",sessionId:e.sessionId,displayStatus:t,...typeof e.level=="number"&&T.has(e.level)?{level:e.level}:{},...f(e.assurance)?{assurance:e.assurance}:{},...n&&r&&f(e.reason)?{reason:e.reason}:{},...n&&r&&f(e.reasonCode)?{reasonCode:e.reasonCode}:{}}}return{status:"failed",code:"unknown_error"}}function v(){if(!y)throw new a("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return y}var d=!1,I=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function p(e){let r=S(e),t=v();if(d)throw new a("flow_in_progress");d=!0;let n=e.onEvent,l=n?t.onEvent(s=>{let o=k(s);o&&n(o)}):void 0;try{return g(await t.start(r))}catch(s){let o=s?.code;if(typeof o=="string"&&I.has(o))throw new a(o);return{status:"failed",code:"unknown_error"}}finally{l?.remove(),d=!1}}function D(){return v().nativeVersion()}import{useEffect as F,useRef as m}from"react";function V(e){let r=m(null),t=m(e);return t.current=e,F(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:n,onEvent:l,...s}=t.current;p({...s,onEvent:o=>t.current.onEvent?.(o)}).then(o=>t.current.onResult(o),o=>t.current.onResult({status:"failed",code:o instanceof a?o.code:"unknown_error"}))},[e.clientToken]),null}var L="0.1.0-rc.16";export{L as SDK_VERSION,a as SekyroError,V as SekyroFlow,D as nativeVersion,p as startSekyro};
|
package/ios/SekyroRNBridge.swift
CHANGED
|
@@ -52,8 +52,9 @@ public final class SekyroRNBridge: NSObject {
|
|
|
52
52
|
return SekyroConfig(clientToken: token, apiOrigin: origin, locale: locale, theme: theme)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/// The native SDK's own wire form (`SekyroWire.dictionary`): status, session id, display status
|
|
56
|
-
///
|
|
55
|
+
/// The native SDK's own wire form (`SekyroWire.dictionary`): status, session id, display status (`verified`,
|
|
56
|
+
/// `review_pending`, `not_verified`), `reason` and `reasonCode` on `not_verified`, `level` and `assurance` when known,
|
|
57
|
+
/// and the failure code, without matching the result's associated values here.
|
|
57
58
|
static func wire(_ result: SekyroResult) -> NSDictionary {
|
|
58
59
|
SekyroWire.dictionary(result) as NSDictionary
|
|
59
60
|
}
|
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.16",
|
|
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.15",
|
|
103
|
+
"ios": "0.1.0-rc.15"
|
|
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.16",
|
|
101
|
+
"bom-ref": "@sekyro/react-native@0.1.0-rc.16",
|
|
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.16?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.16"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|