@sekyro/react-native 0.1.0-rc.19 → 0.1.0-rc.20
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 +6 -0
- package/android/src/main/java/ai/sekyro/reactnative/ConfigMapper.kt +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sekyro/react-native
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.20
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fbd39ca: Levels v2: a finished result's `level` is `1` Contact, `2` Human, `3` Identity, `0` when nothing was proven, and `assurance` adds the level 1 values `device_only`, `contact_email`, `contact_phone` and `unbound_identity`. The bridge passes the native values through unchanged; no code change. A check for a real person is `level >= 2` and for identity `level >= 3`; to require a particular proof, compare `assurance` with a list on your server.
|
|
8
|
+
|
|
3
9
|
## 0.1.0-rc.19
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -66,7 +66,8 @@ internal object ConfigMapper {
|
|
|
66
66
|
putString("status", "finished"); putString("sessionId", r.sessionId)
|
|
67
67
|
// Everything else from the native SDK's own wire form (SekyroWire.result), so the JS side reads the same
|
|
68
68
|
// strings as Flutter: displayStatus verified | review_pending | not_verified, reason and reasonCode on
|
|
69
|
-
// not_verified, level
|
|
69
|
+
// 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".
|
|
70
71
|
val wire = SekyroWire.result(r)
|
|
71
72
|
(wire["displayStatus"] as? String)?.let { putString("displayStatus", it) }
|
|
72
73
|
(wire["level"] as? Int)?.takeIf { it in 0..3 }?.let { putInt("level", it) }
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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.
|
|
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","proof_of_address"]);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.20";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
|
package/dist/index.d.cts
CHANGED
|
@@ -30,10 +30,11 @@ interface SekyroTheme {
|
|
|
30
30
|
/**
|
|
31
31
|
* Screen of the native flow, as reported by step events (`eid`: the national eID sign-in, SDK spec §3.2).
|
|
32
32
|
* Flow model 2026-10-23: `contact_choice` (phone or email), `identity_summary` (check the details read — the event never
|
|
33
|
-
* carries them), `portrait` (the ICAO portrait on its own)
|
|
33
|
+
* carries them), `portrait` (the ICAO portrait on its own), `proof_of_address` (a recent document with the person's
|
|
34
|
+
* address, or the bill holder's letter; spec 2026-11-10). `consent` is never emitted (consent is one line on the first
|
|
34
35
|
* screen); it stays in the union only because the public API may only grow. @public
|
|
35
36
|
*/
|
|
36
|
-
type SekyroStep = 'consent' | 'method' | 'phone_otp' | 'email_otp' | 'registry' | 'document' | 'nfc' | 'liveness' | 'processing' | 'result' | 'update_required' | 'eid' | 'contact_choice' | 'identity_summary' | 'portrait';
|
|
37
|
+
type SekyroStep = 'consent' | 'method' | 'phone_otp' | 'email_otp' | 'registry' | 'document' | 'nfc' | 'liveness' | 'processing' | 'result' | 'update_required' | 'eid' | 'contact_choice' | 'identity_summary' | 'portrait' | 'proof_of_address';
|
|
37
38
|
/** Telemetry only; carries no personal data. @public */
|
|
38
39
|
type SekyroEvent = {
|
|
39
40
|
type: 'step';
|
|
@@ -71,7 +72,7 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
|
71
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
|
|
72
73
|
*/
|
|
73
74
|
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
74
|
-
/** The
|
|
75
|
+
/** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
|
|
75
76
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
76
77
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
77
78
|
type SekyroResult = {
|
|
@@ -79,13 +80,16 @@ type SekyroResult = {
|
|
|
79
80
|
sessionId: string;
|
|
80
81
|
displayStatus: SekyroDisplayStatus;
|
|
81
82
|
/**
|
|
82
|
-
* What the session proved (
|
|
83
|
-
* closed without one (for example a link nobody opened).
|
|
83
|
+
* What the session proved (1 Contact, 2 Human, 3 Identity; 0 when nothing was proven), when the native SDK
|
|
84
|
+
* reports it. Absent when the session closed without one (for example a link nobody opened). A display hint: a
|
|
85
|
+
* check for a real person is `level >= 2` and for identity `level >= 3`, on your server.
|
|
84
86
|
*/
|
|
85
87
|
level?: SekyroLevel;
|
|
86
88
|
/**
|
|
87
|
-
* How `level` was proved: `
|
|
88
|
-
* `
|
|
89
|
+
* How `level` was proved: `device_only`, `contact_email`, `contact_phone`, `unbound_identity` (level 1),
|
|
90
|
+
* `live_only`, `live_unique` (level 2), `supplied_biometric`, `document_biometric`, `eid_authenticated`,
|
|
91
|
+
* `chip_biometric` or `registry_biometric` (level 3); a newer server may add one. Absent when the server reports
|
|
92
|
+
* none. To require a particular proof, compare it with a list on your server.
|
|
89
93
|
*/
|
|
90
94
|
assurance?: string;
|
|
91
95
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -30,10 +30,11 @@ interface SekyroTheme {
|
|
|
30
30
|
/**
|
|
31
31
|
* Screen of the native flow, as reported by step events (`eid`: the national eID sign-in, SDK spec §3.2).
|
|
32
32
|
* Flow model 2026-10-23: `contact_choice` (phone or email), `identity_summary` (check the details read — the event never
|
|
33
|
-
* carries them), `portrait` (the ICAO portrait on its own)
|
|
33
|
+
* carries them), `portrait` (the ICAO portrait on its own), `proof_of_address` (a recent document with the person's
|
|
34
|
+
* address, or the bill holder's letter; spec 2026-11-10). `consent` is never emitted (consent is one line on the first
|
|
34
35
|
* screen); it stays in the union only because the public API may only grow. @public
|
|
35
36
|
*/
|
|
36
|
-
type SekyroStep = 'consent' | 'method' | 'phone_otp' | 'email_otp' | 'registry' | 'document' | 'nfc' | 'liveness' | 'processing' | 'result' | 'update_required' | 'eid' | 'contact_choice' | 'identity_summary' | 'portrait';
|
|
37
|
+
type SekyroStep = 'consent' | 'method' | 'phone_otp' | 'email_otp' | 'registry' | 'document' | 'nfc' | 'liveness' | 'processing' | 'result' | 'update_required' | 'eid' | 'contact_choice' | 'identity_summary' | 'portrait' | 'proof_of_address';
|
|
37
38
|
/** Telemetry only; carries no personal data. @public */
|
|
38
39
|
type SekyroEvent = {
|
|
39
40
|
type: 'step';
|
|
@@ -71,7 +72,7 @@ type SekyroDisplayStatus = 'verified' | 'review_pending' | 'not_verified';
|
|
|
71
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
|
|
72
73
|
*/
|
|
73
74
|
type SekyroSessionReason = 'rejected' | 'inconclusive' | 'unavailable' | 'abandoned' | 'not_opened' | 'policy' | 'cancelled' | 'superseded';
|
|
74
|
-
/** The
|
|
75
|
+
/** The level a finished session proved: 1 Contact, 2 Human, 3 Identity; 0 when nothing was proven. @public */
|
|
75
76
|
type SekyroLevel = 0 | 1 | 2 | 3;
|
|
76
77
|
/** Display-only outcome; read the decision server-side (webhooks / `sessions.get`). @public */
|
|
77
78
|
type SekyroResult = {
|
|
@@ -79,13 +80,16 @@ type SekyroResult = {
|
|
|
79
80
|
sessionId: string;
|
|
80
81
|
displayStatus: SekyroDisplayStatus;
|
|
81
82
|
/**
|
|
82
|
-
* What the session proved (
|
|
83
|
-
* closed without one (for example a link nobody opened).
|
|
83
|
+
* What the session proved (1 Contact, 2 Human, 3 Identity; 0 when nothing was proven), when the native SDK
|
|
84
|
+
* reports it. Absent when the session closed without one (for example a link nobody opened). A display hint: a
|
|
85
|
+
* check for a real person is `level >= 2` and for identity `level >= 3`, on your server.
|
|
84
86
|
*/
|
|
85
87
|
level?: SekyroLevel;
|
|
86
88
|
/**
|
|
87
|
-
* How `level` was proved: `
|
|
88
|
-
* `
|
|
89
|
+
* How `level` was proved: `device_only`, `contact_email`, `contact_phone`, `unbound_identity` (level 1),
|
|
90
|
+
* `live_only`, `live_unique` (level 2), `supplied_biometric`, `document_biometric`, `eid_authenticated`,
|
|
91
|
+
* `chip_biometric` or `registry_biometric` (level 3); a newer server may add one. Absent when the server reports
|
|
92
|
+
* none. To require a particular proof, compare it with a list on your server.
|
|
89
93
|
*/
|
|
90
94
|
assurance?: string;
|
|
91
95
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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.
|
|
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","proof_of_address"]);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.20";export{L as SDK_VERSION,a as SekyroError,V as SekyroFlow,D as nativeVersion,p as startSekyro};
|
package/package.json
CHANGED
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.20",
|
|
101
|
+
"bom-ref": "@sekyro/react-native@0.1.0-rc.20",
|
|
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.20?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.20"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|