@smileid/usesmileid 12.3.1-SNAPSHOT.49 → 12.3.1-SNAPSHOT.52
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.
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialises and scopes the native analyzer's `configure` / `close` calls: both are fire-and-forget and
|
|
3
|
-
* `close()` is keyed off a process-wide holder, so an out-of-order or superseded close tears down the live
|
|
4
|
-
* session and the preview goes black with "No camera frames received".
|
|
5
|
-
*/
|
|
6
1
|
interface ClosableAnalyzer {
|
|
7
2
|
configure(config: never): Promise<void>;
|
|
8
3
|
close(): Promise<void>;
|
|
9
4
|
}
|
|
10
|
-
/** Claims and configures the native analyzer;
|
|
11
|
-
export declare function claimAnalyzer(configure: () => Promise<void
|
|
5
|
+
/** Claims and configures the native analyzer; `onError` hears a failed configure while this claim still owns it. */
|
|
6
|
+
export declare function claimAnalyzer(configure: () => Promise<void>, onError?: (error: unknown) => void): number;
|
|
7
|
+
/** Whether a native configure failed because the build carries no analyzer under the requested key. */
|
|
8
|
+
export declare function isMissingAnalyzerError(error: unknown): boolean;
|
|
12
9
|
/** Closes the native analyzer only while `token` still owns it; a newer claim owns the session now. */
|
|
13
10
|
export declare function releaseAnalyzer(token: number, analyzer: Pick<ClosableAnalyzer, "close">): void;
|
|
14
11
|
/** Test seam: waits for every queued lifecycle call to settle. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";let n=Promise.resolve(),t=0;function
|
|
1
|
+
"use strict";import{UseSmileIDMLErrorCode as l}from"@smileid/usesmileid_bridge";let n=Promise.resolve(),t=0;function i(e){n=n.then(e,e).catch(()=>{})}export function claimAnalyzer(e,r){const o=++t;return i(()=>Promise.resolve().then(e).catch(c=>{o===t&&r?.(c)})),o}export function isMissingAnalyzerError(e){return typeof e=="object"&&e!==null&&e.code===l.AnalyzerNotFound}export function releaseAnalyzer(e,r){e===t&&(t++,i(()=>r.close()))}export async function flushAnalyzerLifecycleForTest(){await n}export async function resetAnalyzerLifecycleForTest(){t=0,await n,n=Promise.resolve()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{jsx as D}from"react/jsx-runtime";import{useEffect as j,useState as
|
|
1
|
+
"use strict";import{jsx as D}from"react/jsx-runtime";import{useEffect as j,useState as v}from"react";import{StyleSheet as J,View as Q}from"react-native";import{AnalyzerNotFoundException as W,CaptureReadyEventKind as E,UseSmileIDCrashReporting as $,DeviceIntegrityProvider as q,DocumentSide as a,ImageType as A}from"@smileid/usesmileid_bridge";import{CameraLens as X}from"../../../camera/camera_lens";import{KameraConfigFactory as Y}from"../../../camera/kamera_config_factory";import{CaptureType as c}from"../../../core/models/ml_config";import{defaultFrameAspectRatio as Z,documentFrameOrientation as N}from"../../../core/models/document_type";import{SmileExifTagger as T}from"@smileid/usesmileid_bridge/exif/smile_exif_tagger";import{resolveDeviceModel as M}from"../../../metadata/use_smile_id_metadata_factory";import{claimAnalyzer as R,isMissingAnalyzerError as ee,releaseAnalyzer as te}from"./helpers/analyzer_lifecycle";import{resolveFaceSessionConfig as oe}from"./helpers/face_session_config";import{useCaptureOrientationLock as re}from"../../screen/helpers/use_capture_orientation_lock";import{localizedDocumentName as ne}from"../../screen/helpers/instructions_screen_helpers";import{resolveJpegQuality as ie}from"../../../data/model/sdk_config_capture";import{AttributionResolver as se,flowShowAttribution as B}from"../config/attribution_resolver";import{UseSmileIDCaptureScreen as ce}from"../../screen/use_smile_id_capture_screen";import{cameraExceptionFromKameraError as ue}from"../../../camera/kamera_error_mapping";import{defaultLightTheme as le}from"../../theme/theme";import{UseSmileIDDocumentBackInstructions as ae}from"../../screen/use_smile_id_document_back_instructions";import{UseSmileIDInstructionsScreen as me}from"../../screen/use_smile_id_instructions_screen";import{DOCUMENT_HERO_VISA_ANIMATION as de,documentGuidelines as fe}from"../model/instructions_defaults";import{useUseSmileIDLocalizations as pe}from"../../../l10n/use_smile_id_localizations_provider";import{useFlowNavigation as ye}from"../flow_navigation_context";import{UseSmileIDOrchestratedScreenHost as Ce}from"./use_smile_id_orchestrated_screen_host";export function OrchestratedCaptureScreen({configuration:s}){const n=ye(),y=pe(),t=s.captureType,d=s.documentConfig,f=d?.documentType,S=n.supportingDocumentSide(),C=S!==void 0,P=d?.allowSkipBack??!1,z=n.documentPreviewFollowsCapture(),b=n.captured.frontDocumentPath!==void 0,[i,g]=v(C&&b&&S!==void 0?S:a.Front),[O,h]=v(C&&b),L=n.configuration.config?.exitOrientations,V=t===c.document&&!O?N(f,d?.resolvedAspectRatio):"Portrait",K=re(V,{...L!==void 0?{exitLock:L}:{}}),u=t===c.selfie?n.configuration.ml?.analyzers.selfie:n.configuration.ml?.analyzers.document;return j(()=>{if(!u)return;const e=o=>{if(!ee(o)){$.captureException(o instanceof Error?o:new Error(String(o)));return}n.exit({kind:"failed",error:new W({captureType:u.kind,cause:o,suggestedFix:"This build leaves that analyzer out. Pick from UseSmileIDMobileServices.linkedAnalyzers(), or keep the analyzer in this store's flavor."})})};let k=0;if(t===c.selfie&&u.kind==="face"){const o=n.configuration.ml?.analyzers.selfieConfig??{analyzerFactoryKey:u.key};k=R(()=>u.configure(oe(o,s.selfieConfig?.enableEnhancedLiveness??!1,n.resolvedSdkConfig)),e)}else if(t===c.document&&u.kind==="document"){const o=ie(n.resolvedSdkConfig?.document),w=Y.create(c.document,X.back).analysis,r=s.documentConfig?.documentType?.kind,l=s.documentConfig?.resolvedAspectRatio,F=l!==void 0&&Number.isFinite(l)&&l>0?l:void 0;k=R(()=>u.configure({documentSide:i,...o!==void 0?{documentJpegQuality:o}:{},...r!==void 0?{documentKind:r}:{},...F!==void 0?{knownAspectRatio:F}:{},sessionFrameWidth:w.targetWidth,sessionFrameHeight:w.targetHeight}),e)}return()=>{te(k,u)}},[u,t,n,s,i]),D(Ce,{content:({navigationManager:e,onBack:k,onNavigateNext:o})=>{if(!u)throw new Error(`OrchestratedCaptureScreen: no ${t} analyzer registered in the ML DSL`);if(t===c.document&&C&&O){const r=()=>{if(z){k();return}h(!1),g(a.Front)};return i===a.Visa?D(me,{titlePrefix:y.siInstructionsTitlePrefix,titleEmphasis:y.siInstructionsEmphasisVisa,heroSource:de,guidelinesSectionTitle:y.siInstructionsCaptureGuidelines,guidelines:fe(f),showAttribution:B(e.configuration),showHeroOval:!1,showHeroOvalProgress:!1,showCardBackground:!0,onContinue:()=>h(!1),onBack:r}):D(ae,{documentTypeDisplayName:f?ne(f,y):"",allowSkip:P,showAttribution:B(e.configuration),onCaptureBack:()=>h(!1),onSkip:()=>{e.skipDocumentBack(),o()},onBack:r})}const w=e.configuration.theme?.light??le;return K?D(ce,{captureType:t,analyzer:u,onAnalyticsEvent:r=>e.logAnalyticsEvent(r),theme:w,enableEnhancedLiveness:s.selfieConfig?.enableEnhancedLiveness??!1,allowAgentMode:s.selfieConfig?.allowAgentMode??!1,showAttribution:se.resolveForCapture({captureType:t,showAttribution:B(e.configuration)}),...t===c.document&&d?{knownIdAspectRatio:d.resolvedAspectRatio??Z(f?.orientation??"Landscape"),captureMode:d.captureMode,allowGalleryUpload:d.allowGalleryUpload,documentSide:i,...f?.kind?{documentTypeKind:f.kind}:{},onDocumentOrigin:r=>e.recordDocumentImageOrigin(i,r),onClose:()=>e.exit()}:{},...s.startButton!==void 0?{startButton:s.startButton}:{},onBack:()=>{if(t===c.document&&C&&i!==a.Front){h(!0);return}k()},onCameraError:(r,l)=>{e.exit({kind:"failed",error:ue(r,l)})},onCaptureComplete:(r,l,F,_)=>{const I=F??0,p=ke(r,t);if(!p)return;const H=e.partnerId,G=t===c.selfie?A.Selfie:i===a.Visa?A.DocumentVisa:i===a.Back?A.DocumentBack:A.DocumentFront,x=r.filter(m=>m.kind===E.Liveness).map(m=>m.url),U=M();q.signals().then(({fingerprint:m})=>T.setContext({partnerId:H,...U?{deviceModel:U}:{},...m?{fingerprint:m}:{}})).then(async()=>{await T.finalize(p,G),await Promise.all(x.map(m=>T.finalize(m,A.Liveness)))}).catch(()=>{}).finally(async()=>{if(t===c.selfie){e.setCapturedSelfie(p,x),e.recordSelfieCaptureGeometry(_),e.recordSelfieCaptureTelemetry(l),o();return}if(e.recordDocumentCaptureTelemetry(i,l),C&&S!==void 0&&i===a.Front){e.setCapturedFrontDocument(p,I),z?o():(g(S),h(!0));return}if(i===a.Visa){e.setCapturedVisaDocument(p,I),o();return}if(C&&i===a.Back){e.setCapturedBackDocument(p,I),o();return}e.setCapturedFrontDocument(p,I),o()})}},t===c.document?`document-capture-${i}`:"capture"):D(Q,{style:[J.absoluteFill,{backgroundColor:w.colors.offBlack}],testID:"si_capture_orientation_pending"})}})}function ke(s,n){const y=n===c.selfie?E.Selfie:E.Document;return s.find(t=>t.kind===y)?.url}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smileid/usesmileid",
|
|
3
|
-
"version": "12.3.1-SNAPSHOT.
|
|
3
|
+
"version": "12.3.1-SNAPSHOT.52",
|
|
4
4
|
"description": "Official Smile ID React Native (Expo) SDK for identity verification: selfie capture, liveness checks, and document verification powered by on-device ML.",
|
|
5
5
|
"homepage": "https://usesmileid.com",
|
|
6
6
|
"repository": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@smileid/njia": "0.0.1-SNAPSHOT.3",
|
|
53
53
|
"axios": "^1.20.0",
|
|
54
54
|
"zod": "^4.6.5",
|
|
55
|
-
"@smileid/usesmileid_bridge": "12.3.1-SNAPSHOT.
|
|
56
|
-
"@smileid/usesmileid_platform_interface": "12.3.1-SNAPSHOT.
|
|
55
|
+
"@smileid/usesmileid_bridge": "12.3.1-SNAPSHOT.52",
|
|
56
|
+
"@smileid/usesmileid_platform_interface": "12.3.1-SNAPSHOT.52"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@react-native-async-storage/async-storage": ">=1.21.0",
|