@sekyro/react-native 0.1.0-rc.8 → 0.1.0-rc.9
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 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +1 -1
- package/ios/SekyroRNBridge.swift +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.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 244e4e1: Status colours are standard. `theme.colors.danger`, `success` and `warning` are deprecated and ignored (one warning in development builds); they are no longer passed to the native SDKs and will be removed in 1.0.
|
|
8
|
+
|
|
3
9
|
## 0.1.0-rc.8
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -39,8 +39,8 @@ internal object ConfigMapper {
|
|
|
39
39
|
"light" -> SekyroTheme.DarkMode.LIGHT; "dark" -> SekyroTheme.DarkMode.DARK; else -> SekyroTheme.DarkMode.SYSTEM
|
|
40
40
|
},
|
|
41
41
|
bg = color(colors, "bg"), surface = color(colors, "surface"), fg = color(colors, "fg"),
|
|
42
|
-
fgMuted = color(colors, "fgMuted"),
|
|
43
|
-
|
|
42
|
+
fgMuted = color(colors, "fgMuted"),
|
|
43
|
+
// danger / success / warning are not read: status colours are standard (deprecated no-ops, removed in 1.0).
|
|
44
44
|
border = color(colors, "border"), fontFamily = fontFamily,
|
|
45
45
|
)
|
|
46
46
|
val strings = if (m.hasKey("strings") && !m.isNull("strings")) {
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var O=(e,r)=>{for(var t in r)f(e,t,{get:r[t],enumerable:!0})},x=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of h(r))!C.call(e,n)&&n!==t&&f(e,n,{get:()=>r[n],enumerable:!(i=w(r,n))||i.enumerable});return e};var b=e=>x(f({},"__esModule",{value:!0}),e);var L={};O(L,{SDK_VERSION:()=>N,SekyroError:()=>l,SekyroFlow:()=>R,nativeVersion:()=>E,startSekyro:()=>u});module.exports=b(L);var S=require("react-native"),d=S.TurboModuleRegistry.get("SekyroReactNative");var l=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var T=500,I=new Set(["ar","fr","en","es","pt","de"]),D=["brand","brandFg","bg","surface","fg","fgMuted","border"],F=["danger","success","warning"],k=!1,V=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 g(e){(typeof e!="object"||e===null)&&a("config");for(let i of Object.keys(e))V.has(i)||a(`unknown key "${i.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&&(I.has(e.locale)||a("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let i={};for(let[n,s]of Object.entries(t.colors))if(s!==void 0){if(F.includes(n)){__DEV__&&!k&&(k=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!D.includes(n)||typeof s!="string"||!M.test(s))&&a(`theme.colors.${n.slice(0,32)}`),i[n]=s}r.colors=i}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 i=e.strings[e.locale]??{},n={},s=Object.entries(i).filter(([,o])=>o!==void 0);s.length>T&&a("strings (too many overrides)");for(let[o,y]of s)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||a("strings key"),(typeof y!="string"||y.length>2e3)&&a(`strings.${o}`),n[o]=y;r.strings=n}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(["approved","review_pending","rejected","expired"]);function v(e){return e.status==="cancelled"?{status:"cancelled"}:e.status==="failed"?{status:"failed",code:e.code||"unknown_error"}:e.status==="finished"&&e.sessionId&&P.has(e.displayStatus)?{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}:{status:"failed",code:"unknown_error"}}function _(){if(!d)throw new l("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return d}var c=!1,j=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function u(e){let r=g(e),t=_();if(c)throw new l("flow_in_progress");c=!0;let i=e.onEvent,n=i?t.onEvent(s=>{let o=m(s);o&&i(o)}):void 0;try{return v(await t.start(r))}catch(s){let o=s?.code;if(typeof o=="string"&&j.has(o))throw new l(o);return{status:"failed",code:"unknown_error"}}finally{n?.remove(),c=!1}}function E(){return _().nativeVersion()}var p=require("react");function R(e){let r=(0,p.useRef)(null),t=(0,p.useRef)(e);return t.current=e,(0,p.useEffect)(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:i,onEvent:n,...s}=t.current;u({...s,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 N="0.1.0-rc.9";0&&(module.exports={SDK_VERSION,SekyroError,SekyroFlow,nativeVersion,startSekyro});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/** UI language of the native flow. es, pt and de carry the Human copy set and fall back to English elsewhere (spec 2026-10-29 §9). @public */
|
|
2
2
|
type SekyroLocale = 'ar' | 'fr' | 'en' | 'es' | 'pt' | 'de';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Themeable colour roles, shared by the Android and iOS cores. `danger`, `success` and `warning` are deprecated: status
|
|
5
|
+
* colours are standard since 0.1.0-rc.9, the SDK ignores them and they will be removed in 1.0. @public
|
|
6
|
+
*/
|
|
4
7
|
type SekyroColorRole = 'brand' | 'brandFg' | 'bg' | 'surface' | 'fg' | 'fgMuted' | 'border' | 'danger' | 'success' | 'warning';
|
|
5
8
|
/** Runtime theme applied over the native defaults. @public */
|
|
6
9
|
interface SekyroTheme {
|
|
7
10
|
/** `'#RRGGBB'` per role. */
|
|
8
|
-
colors?: Partial<Record<SekyroColorRole, string
|
|
11
|
+
colors?: Partial<Record<Exclude<SekyroColorRole, 'danger' | 'success' | 'warning'>, string>> & {
|
|
12
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
13
|
+
danger?: string;
|
|
14
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
15
|
+
success?: string;
|
|
16
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
17
|
+
warning?: string;
|
|
18
|
+
};
|
|
9
19
|
/** Corner radius in dp / pt, 0–32. */
|
|
10
20
|
radius?: number;
|
|
11
21
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/** UI language of the native flow. es, pt and de carry the Human copy set and fall back to English elsewhere (spec 2026-10-29 §9). @public */
|
|
2
2
|
type SekyroLocale = 'ar' | 'fr' | 'en' | 'es' | 'pt' | 'de';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Themeable colour roles, shared by the Android and iOS cores. `danger`, `success` and `warning` are deprecated: status
|
|
5
|
+
* colours are standard since 0.1.0-rc.9, the SDK ignores them and they will be removed in 1.0. @public
|
|
6
|
+
*/
|
|
4
7
|
type SekyroColorRole = 'brand' | 'brandFg' | 'bg' | 'surface' | 'fg' | 'fgMuted' | 'border' | 'danger' | 'success' | 'warning';
|
|
5
8
|
/** Runtime theme applied over the native defaults. @public */
|
|
6
9
|
interface SekyroTheme {
|
|
7
10
|
/** `'#RRGGBB'` per role. */
|
|
8
|
-
colors?: Partial<Record<SekyroColorRole, string
|
|
11
|
+
colors?: Partial<Record<Exclude<SekyroColorRole, 'danger' | 'success' | 'warning'>, string>> & {
|
|
12
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
13
|
+
danger?: string;
|
|
14
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
15
|
+
success?: string;
|
|
16
|
+
/** @deprecated Status colours are standard since 0.1.0-rc.9; this key is ignored and will be removed in 1.0. */
|
|
17
|
+
warning?: string;
|
|
18
|
+
};
|
|
9
19
|
/** Corner radius in dp / pt, 0–32. */
|
|
10
20
|
radius?: number;
|
|
11
21
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TurboModuleRegistry as
|
|
1
|
+
import{TurboModuleRegistry as v}from"react-native";var u=v.get("SekyroReactNative");var a=class extends Error{code;constructor(r,t=r){super(t),this.name="SekyroError",this.code=r}};var _=500,E=new Set(["ar","fr","en","es","pt","de"]),R=["brand","brandFg","bg","surface","fg","fgMuted","border"],N=["danger","success","warning"],d=!1,w=new Set(["clientToken","apiOrigin","locale","theme","strings","onEvent"]),h=/^#[0-9a-fA-F]{6}$/,C=/^http:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)(:\d+)?$/,i=e=>{throw new a("invalid_config",`invalid config: ${e}`)};function c(e){(typeof e!="object"||e===null)&&i("config");for(let s of Object.keys(e))w.has(s)||i(`unknown key "${s.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__&&C.test(e.apiOrigin))||i("apiOrigin"),r.apiOrigin=e.apiOrigin),e.locale!==void 0&&(E.has(e.locale)||i("locale"),r.locale=e.locale);let t=e.theme;if(t){if(t.colors){let s={};for(let[l,n]of Object.entries(t.colors))if(n!==void 0){if(N.includes(l)){__DEV__&&!d&&(d=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));continue}(!R.includes(l)||typeof n!="string"||!h.test(n))&&i(`theme.colors.${l.slice(0,32)}`),s[l]=n}r.colors=s}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 s=e.strings[e.locale]??{},l={},n=Object.entries(s).filter(([,o])=>o!==void 0);n.length>_&&i("strings (too many overrides)");for(let[o,p]of n)/^[a-zA-Z0-9_.]{1,96}$/.test(o)||i("strings key"),(typeof p!="string"||p.length>2e3)&&i(`strings.${o}`),l[o]=p;r.strings=l}return r}var O=new Set(["method","phone_otp","email_otp","registry","document","nfc","liveness","processing","result","update_required","eid","contact_choice","identity_summary","portrait"]);function S(e){if(e.type==="waiting_for_network")return{type:"waiting_for_network"};if(e.type!=="step"||!O.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(["approved","review_pending","rejected","expired"]);function k(e){return e.status==="cancelled"?{status:"cancelled"}:e.status==="failed"?{status:"failed",code:e.code||"unknown_error"}:e.status==="finished"&&e.sessionId&&x.has(e.displayStatus)?{status:"finished",sessionId:e.sessionId,displayStatus:e.displayStatus}:{status:"failed",code:"unknown_error"}}function g(){if(!u)throw new a("unsupported_platform","the SekyroReactNative native module is not linked (New Architecture app, pod install / Gradle sync)");return u}var y=!1,b=new Set(["no_activity","unsupported_platform","flow_in_progress","invalid_config"]);async function f(e){let r=c(e),t=g();if(y)throw new a("flow_in_progress");y=!0;let s=e.onEvent,l=s?t.onEvent(n=>{let o=S(n);o&&s(o)}):void 0;try{return k(await t.start(r))}catch(n){let o=n?.code;if(typeof o=="string"&&b.has(o))throw new a(o);return{status:"failed",code:"unknown_error"}}finally{l?.remove(),y=!1}}function T(){return g().nativeVersion()}import{useEffect as I,useRef as m}from"react";function D(e){let r=m(null),t=m(e);return t.current=e,I(()=>{if(r.current===e.clientToken)return;r.current=e.clientToken;let{onResult:s,onEvent:l,...n}=t.current;f({...n,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 F="0.1.0-rc.9";export{F as SDK_VERSION,a as SekyroError,D as SekyroFlow,T as nativeVersion,f as startSekyro};
|
package/ios/SekyroRNBridge.swift
CHANGED
|
@@ -48,7 +48,7 @@ public final class SekyroRNBridge: NSObject {
|
|
|
48
48
|
let theme = SekyroTheme(
|
|
49
49
|
brand: try color("brand"), brandFg: try color("brandFg"), background: try color("bg"), surface: try color("surface"),
|
|
50
50
|
foreground: try color("fg"), foregroundMuted: try color("fgMuted"), border: try color("border"),
|
|
51
|
-
danger
|
|
51
|
+
// danger / success / warning are not read: status colours are standard (deprecated no-ops, removed in 1.0).
|
|
52
52
|
cornerRadius: radius, fontFamily: d["fontFamily"] as? String, darkMode: mode, strings: strings)
|
|
53
53
|
return SekyroConfig(clientToken: token, apiOrigin: origin, locale: locale, theme: theme)
|
|
54
54
|
}
|
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.9",
|
|
101
|
+
"bom-ref": "@sekyro/react-native@0.1.0-rc.9",
|
|
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.9?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.9"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|