@incodetech/core 2.0.0-alpha.11 → 2.0.0-alpha.13

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.
Files changed (34) hide show
  1. package/dist/{OpenViduLogger-5b7KqNTo.esm.js → OpenViduLogger-CRbRNZA7.esm.js} +1 -1
  2. package/dist/OpenViduLogger-Dy5P806a.esm.js +3 -0
  3. package/dist/{warmup-Cijuyvoc.d.ts → StateMachine-pi8byl8C.d.ts} +4 -1
  4. package/dist/{addEvent-s2Za-pK3.esm.js → addEvent-BGKc_lHF.esm.js} +1 -1
  5. package/dist/{deepsightLoader-Bn2D0REl.esm.js → deepsightLoader-B36_XZ7r.esm.js} +3 -3
  6. package/dist/{recordingsRepository-CTjaf-ER.esm.js → deepsightService-BWxcc4OC.esm.js} +2 -33
  7. package/dist/email.d.ts +1 -1
  8. package/dist/email.esm.js +3 -3
  9. package/dist/{endpoints-B0ltwtb5.esm.js → endpoints-D9TGnxRK.esm.js} +336 -21
  10. package/dist/flow.d.ts +4 -303
  11. package/dist/flow.esm.js +4 -5
  12. package/dist/id-DHVSW_wJ.esm.js +1825 -0
  13. package/dist/id.d.ts +6 -0
  14. package/dist/id.esm.js +8 -0
  15. package/dist/index-CbF_uI-x.d.ts +618 -0
  16. package/dist/index.d.ts +8 -3
  17. package/dist/index.esm.js +7 -4
  18. package/dist/{lib-CykGFCEr.esm.js → lib-BJoLTN_W.esm.js} +2 -2
  19. package/dist/phone.d.ts +1 -1
  20. package/dist/phone.esm.js +3 -3
  21. package/dist/recordingsRepository-D5MURoVB.esm.js +40 -0
  22. package/dist/selfie.d.ts +22 -324
  23. package/dist/selfie.esm.js +34 -23
  24. package/dist/{permissionServices-BhD0KxsO.esm.js → streamingEvents-B3hNanPl.esm.js} +34 -3
  25. package/dist/types-BpCrZLU6.d.ts +302 -0
  26. package/dist/types-DZbrbPgj.d.ts +335 -0
  27. package/package.json +6 -2
  28. package/dist/OpenViduLogger-20ZYS-mT.esm.js +0 -3
  29. package/dist/StateMachine-BqPpBhOz.d.ts +0 -2
  30. package/dist/getBrowser-CLEzz0Hi.esm.js +0 -8
  31. package/dist/types-Dif6MQmX.d.ts +0 -5
  32. /package/dist/{Manager-Cy9-TMC9.d.ts → Manager-BZUZTRPx.d.ts} +0 -0
  33. /package/dist/{chunk-C_Yo44FK.esm.js → chunk-FbsBJI8u.esm.js} +0 -0
  34. /package/dist/{xstate.esm-2T5fOCTq.esm.js → xstate.esm-2hDiAXvZ.esm.js} +0 -0
@@ -0,0 +1,302 @@
1
+ //#region src/modules/flow/types.d.ts
2
+ type EmptyConfig = Record<string, never>;
3
+ type RegulationTypes = 'US' | 'Worldwide' | 'Other' | 'US_Illinois' | 'US_Texas' | 'US_California' | 'US_Washington';
4
+ type TutorialIdConfig = {
5
+ showTutorial: boolean;
6
+ enableId: boolean;
7
+ enablePassport: boolean;
8
+ onlyFront: boolean;
9
+ onlyBack: boolean;
10
+ barcodeCapture: boolean;
11
+ fetchAdditionalPage: boolean;
12
+ secondId: boolean;
13
+ thirdId: boolean;
14
+ autoCaptureTimeout: number;
15
+ deviceIdleTimeout: number;
16
+ captureAttempts: number;
17
+ manualUploadIdCapture: boolean;
18
+ digitalIdsUpload: boolean;
19
+ showDocumentChooserScreen: boolean;
20
+ enableIdRecording: boolean;
21
+ usSmartCapture: boolean;
22
+ showCaptureButtonInAuto?: boolean;
23
+ perCountryPerDocOverrides: Record<string, Record<string, {
24
+ onlyFront: boolean;
25
+ onlyBack: boolean;
26
+ fetchAdditionalPage: boolean;
27
+ }>>;
28
+ };
29
+ type FlowModuleConfig = {
30
+ AUTHENTICATION: {
31
+ showTutorial: boolean;
32
+ autoCaptureTimeout: number;
33
+ numberOfAttempts: number;
34
+ type: 'ONE_TO_ONE';
35
+ deepsightLiveness: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
36
+ validateClosedEyes: boolean;
37
+ validateFaceMask: boolean;
38
+ validateHeadCover: boolean;
39
+ validateLenses: boolean;
40
+ };
41
+ ADDRESS: {
42
+ disableSkipPoa: boolean;
43
+ title: string;
44
+ text: string;
45
+ };
46
+ AE_SIGNATURE: {
47
+ uploadDocument: boolean;
48
+ downloadDocument: boolean;
49
+ issuePermanentCertificate: boolean;
50
+ allowWithoutScoreValidation: boolean;
51
+ validationsToSkip: ('ID' | 'FACE_RECOGNITION' | 'OTP' | 'TOTAL_SCORE')[];
52
+ };
53
+ CURP_VALIDATION: {
54
+ curpDataMatch: boolean;
55
+ deceasedStatusVerification: boolean;
56
+ };
57
+ CUSTOM_FIELDS: {
58
+ title: string;
59
+ customFields: {
60
+ name: string;
61
+ alias: string;
62
+ type: 'INTEGER' | 'DOUBLE' | 'BOOLEAN' | 'STRING';
63
+ }[];
64
+ };
65
+ DOCUMENT_CAPTURE: {
66
+ processingType: 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
67
+ title: string;
68
+ text: string;
69
+ allowSkipDocumentCapture: boolean;
70
+ };
71
+ EKYB: {
72
+ checkBusinessName: boolean;
73
+ businessNameSource: 'userInput';
74
+ checkAddress: boolean;
75
+ address: 'userInput';
76
+ checkTaxId: boolean;
77
+ taxIdSource: 'userInput';
78
+ checkUniqueBeneficialOwner: boolean;
79
+ uniqueBeneficialOwnerSource: 'userInput';
80
+ };
81
+ EXTERNAL_VERIFICATION: {
82
+ source: 'US_DRIVERS_LICENSE_1' | 'US_TELCO_1' | 'US_TELCO_2' | 'US_CONSUMER_1' | 'US_CREDIT_BUREAU_1' | 'MX_CONSUMER_1' | 'BR_GOVT_1' | 'CA_RES_CREDIT' | 'UK_CREDIT_BUREAU_1' | 'ES_1' | 'CL_1' | 'AR_1' | 'GR_1' | 'GT_1' | 'BR_CPF_1';
83
+ checkName: boolean;
84
+ nameSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
85
+ checkEmail: boolean;
86
+ emailSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
87
+ checkAddress: boolean;
88
+ addressSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
89
+ checkPhone: boolean;
90
+ phoneSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
91
+ checkSsn: boolean;
92
+ ssnSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
93
+ checkDob: boolean;
94
+ dobSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
95
+ checkNationality: boolean;
96
+ nationalitySource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
97
+ checkDlNumber: boolean;
98
+ dlNumberSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
99
+ checkDlState: boolean;
100
+ dlStateSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
101
+ checkDlExpireAt: boolean;
102
+ dlExpireAtSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
103
+ checkLast4SSN: boolean;
104
+ last4SSNSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
105
+ checkIdNum: boolean;
106
+ idNumSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
107
+ checkIdNum1: boolean;
108
+ idNum1Source: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
109
+ checkGender: boolean;
110
+ genderSource: 'userInput' | 'document' | 'poa' | 'phoneModuleInput' | 'emailModuleInput';
111
+ };
112
+ EMAIL: {
113
+ otpVerification: boolean;
114
+ otpExpirationInMinutes: number;
115
+ prefill?: boolean;
116
+ };
117
+ FACE_MATCH: {
118
+ matchingType: 'selfieVsId' | 'selfieVsNfc' | 'idVsNfc' | 'nfc3Way';
119
+ disableFaceMatchAnimation: boolean;
120
+ };
121
+ FINISH_GPT: {
122
+ finishgptCompanyName: string;
123
+ };
124
+ GEOLOCATION: {
125
+ allowUserToSkipGeolocation: boolean;
126
+ };
127
+ INE_VALIDATION: {
128
+ facialValidation: boolean;
129
+ alternativeFacialValidation: boolean;
130
+ fallbackEnabled: boolean;
131
+ scrapingMethod: boolean;
132
+ scrapingV2: boolean;
133
+ scrapingV3: boolean;
134
+ failUnsupportedId: boolean;
135
+ dataValidation: boolean;
136
+ backgroundExecution: boolean;
137
+ mockConnectionError: boolean;
138
+ mockUserNotFoundError: boolean;
139
+ mockOK: boolean;
140
+ };
141
+ GOVT_VALIDATION_PROVISIONING: {
142
+ validationCountries: string[];
143
+ facialValidation: boolean;
144
+ dataValidation: boolean;
145
+ faceAndDataValidation: boolean;
146
+ addressValidation: boolean;
147
+ backgroundExecution: boolean;
148
+ faceMatchOverrideDataScore: boolean;
149
+ useCroppedIdFacePhoto: boolean;
150
+ };
151
+ TUTORIAL_ID: TutorialIdConfig;
152
+ ID: TutorialIdConfig;
153
+ SECOND_ID: TutorialIdConfig;
154
+ THIRD_ID: TutorialIdConfig;
155
+ ID_OCR: {
156
+ editableOcr: boolean;
157
+ };
158
+ INCODE_WATCHLIST: {
159
+ failIfFaceOnBlocklist: boolean;
160
+ addSuspectedFraudAutomatically: boolean;
161
+ autoExecution: boolean;
162
+ };
163
+ INSTANT_BAV: {
164
+ bavVendorCountry: 'US' | 'CA' | 'AU' | 'NZ' | 'BR' | 'MX' | 'CO' | 'UK' | 'EU';
165
+ bavNumberOfRetries: number;
166
+ };
167
+ ML_CONSENT: {
168
+ consentType: RegulationTypes;
169
+ };
170
+ NFC_SCAN: {
171
+ nfcAvailability: boolean;
172
+ nfcValidation: boolean;
173
+ showInitialDataConfirmationScreen: boolean;
174
+ };
175
+ PHONE: {
176
+ otpVerification: boolean;
177
+ otpExpirationInMinutes: number;
178
+ prefill: boolean;
179
+ };
180
+ SELFIE: {
181
+ showTutorial: boolean;
182
+ showPreview: boolean;
183
+ assistedOnboarding: boolean;
184
+ enableFaceRecording: boolean;
185
+ autoCaptureTimeout: number;
186
+ captureAttempts: number;
187
+ validateLenses: boolean;
188
+ validateFaceMask: boolean;
189
+ validateHeadCover: boolean;
190
+ validateClosedEyes: boolean;
191
+ validateBrightness: boolean;
192
+ deepsightLiveness: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
193
+ };
194
+ SIGNATURE: {
195
+ title: string;
196
+ subTitle: string;
197
+ };
198
+ USER_CONSENT: {
199
+ title: string;
200
+ text: string;
201
+ };
202
+ CONFERENCE: {
203
+ enableConferenceOtp: boolean;
204
+ };
205
+ VIDEO_ONBOARDING: {
206
+ useAsSelfie: boolean;
207
+ showTutorials: boolean;
208
+ companyName: string;
209
+ checkLiveness: boolean;
210
+ checkIdScan: boolean;
211
+ checkDocumentScan: boolean;
212
+ compareIdEnabled: boolean;
213
+ compareOcrEnabled: boolean;
214
+ compareBackIdEnabled: boolean;
215
+ compareBackOcrEnabled: boolean;
216
+ checkVoiceConsent: boolean;
217
+ voiceConsentQuestions: number;
218
+ selfieQualityAffectsScore: boolean;
219
+ maxWaitingVideoSelfieFile: number;
220
+ lastSecondsVideoQualityCheck: boolean;
221
+ lastSecondsVideoQualityCheckDuration: number;
222
+ validateClosedEyes: boolean;
223
+ validateFaceMask: boolean;
224
+ validateHeadCover: boolean;
225
+ validateLenses: boolean;
226
+ };
227
+ DYNAMIC_FORMS: {
228
+ screens: {
229
+ title: string;
230
+ hideTitle: boolean;
231
+ questions: {
232
+ questionId: string;
233
+ overrides: string | null;
234
+ isPredefined: boolean;
235
+ predefinedQuestionType: string | null;
236
+ question: string;
237
+ inputType: 'NUMBER' | 'CPF' | 'COUNTRY' | 'NATIONALITY' | 'DATE' | 'PHONE' | 'EMAIL' | 'TEXT' | 'MULTISELECT' | 'YESNO' | 'SELECT';
238
+ options: string[];
239
+ }[];
240
+ }[];
241
+ };
242
+ COMBINED_CONSENT: {
243
+ combinedConsents: string;
244
+ };
245
+ QE_SIGNATURE: {
246
+ uploadDocument: boolean;
247
+ downloadDocument: boolean;
248
+ };
249
+ CERTIFICATE_ISSUANCE: {
250
+ region: string;
251
+ type: 'ONE_TIME' | 'SHORT_TERM' | 'LONG_TERM';
252
+ };
253
+ ANTIFRAUD: EmptyConfig;
254
+ CHECKBOX_SIGNATURE: EmptyConfig;
255
+ CROSS_DOCUMENT_DATA_MATCH: EmptyConfig;
256
+ DEVICE_FINGERPRINT: EmptyConfig;
257
+ FACE_ONBOARDING: EmptyConfig;
258
+ FIELD_COMPARISON: EmptyConfig;
259
+ FISCAL_QR: EmptyConfig;
260
+ GENERATE_QR: EmptyConfig;
261
+ INSTANT_VERIFY: EmptyConfig;
262
+ IP_ADDRESS: EmptyConfig;
263
+ NAME_CAPTURE: EmptyConfig;
264
+ SHOW_RESULTS: EmptyConfig;
265
+ STADIUM_SELECTOR: EmptyConfig;
266
+ UNIVERSAL_IDENTITY: EmptyConfig;
267
+ WATCHLIST: EmptyConfig;
268
+ TRUST_GRAPH: EmptyConfig;
269
+ WATCHLIST_BUSINESS: EmptyConfig;
270
+ };
271
+ type FlowModule = { [K in keyof FlowModuleConfig]: {
272
+ key: K;
273
+ configuration: FlowModuleConfig[K];
274
+ } }[keyof FlowModuleConfig];
275
+ type Flow = {
276
+ flowId: string;
277
+ name: string;
278
+ autoApproveEnabled?: boolean;
279
+ autoApproveLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
280
+ checkTutorials?: boolean;
281
+ checkAuthorization?: boolean;
282
+ redirectDesktopToMobile?: boolean;
283
+ disableUnsupportedBrowserScreen?: boolean;
284
+ qrPhishingResistance?: boolean;
285
+ addContinueToDesktop?: boolean;
286
+ redirectOriginOnly?: boolean;
287
+ displayOnboardingResultOnDesktop?: boolean;
288
+ enableMultipleOnboardings?: boolean;
289
+ disableLaunchScreen?: boolean;
290
+ enableSardineRisk?: boolean;
291
+ mandatoryConsentCheck?: boolean;
292
+ disableSmsOption?: boolean;
293
+ mergeSessionRecordings?: boolean;
294
+ ageAssurance?: boolean;
295
+ flowModules: FlowModule[];
296
+ enforceCaptureAttemptLimits?: boolean;
297
+ enableFraudAi?: boolean;
298
+ getEnableIdOnlyIdentity?: boolean;
299
+ ds?: boolean;
300
+ };
301
+ //#endregion
302
+ export { TutorialIdConfig as i, FlowModule as n, FlowModuleConfig as r, Flow as t };
@@ -0,0 +1,335 @@
1
+ import { r as WasmPipeline } from "./StateMachine-pi8byl8C.js";
2
+
3
+ //#region ../infra/src/media/canvas.d.ts
4
+ /**
5
+ * Class representing a canvas element for image capture and manipulation.
6
+ */
7
+ declare class IncodeCanvas {
8
+ canvas: HTMLCanvasElement;
9
+ private base64Image;
10
+ private blobData;
11
+ /**
12
+ * Creates an {@link IncodeCanvas} from a raw {@link ImageData} frame.
13
+ * @param imageData - Frame pixels in RGBA format
14
+ * @returns An {@link IncodeCanvas} containing the provided pixels
15
+ */
16
+ static fromImageData(imageData: ImageData): IncodeCanvas;
17
+ /**
18
+ * Create a new canvas element.
19
+ * @param canvas_ - The canvas element to clone.
20
+ */
21
+ constructor(canvas_: HTMLCanvasElement);
22
+ /**
23
+ * Check if the current canvas is valid.
24
+ */
25
+ private checkCanvas;
26
+ /**
27
+ * Release the data stored by IncodeCanvas.
28
+ */
29
+ release(): void;
30
+ /**
31
+ * Get the width of the canvas.
32
+ */
33
+ width(): number | null;
34
+ /**
35
+ * Get the height of the canvas.
36
+ */
37
+ height(): number | null;
38
+ /**
39
+ * Set the width of the canvas.
40
+ */
41
+ setWidth(width: number): void;
42
+ /**
43
+ * Set the height of the canvas.
44
+ */
45
+ setHeight(height: number): void;
46
+ /**
47
+ * Clone the current canvas.
48
+ */
49
+ clone(): IncodeCanvas | null;
50
+ /**
51
+ * Deep clone the current IncodeCanvas including blob data.
52
+ */
53
+ deepClone(): Promise<IncodeCanvas | null>;
54
+ /**
55
+ * Returns the drawing context on the canvas.
56
+ */
57
+ getContext(contextId: '2d', contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
58
+ /**
59
+ * Retrieves the image data from the canvas.
60
+ */
61
+ getImageData(): ImageData | null;
62
+ /**
63
+ * Updates the base64 representation of the current canvas image.
64
+ */
65
+ updateBase64Image(jpegQuality?: number): void;
66
+ /**
67
+ * Converts the current canvas element to a base64 string.
68
+ */
69
+ getBase64Image(jpegQuality?: number, includeDataURLPrefix?: boolean): string | null;
70
+ /**
71
+ * Sets the base64 representation of the current canvas image.
72
+ */
73
+ setBase64Image(base64Image: string | null): void;
74
+ /**
75
+ * Updates the Blob representation of the current canvas image.
76
+ */
77
+ updateBlob(jpegQuality?: number, includeDataURLPrefix?: boolean): void;
78
+ /**
79
+ * Converts a base64 string to a Blob and creates a URL for it.
80
+ */
81
+ static base64ToBlob(base64: string): {
82
+ blob: Blob;
83
+ url: string;
84
+ } | null;
85
+ /**
86
+ * Retrieves the Blob data and its URL from the current canvas.
87
+ */
88
+ getBlobData(jpegQuality?: number, includeDataURLPrefix?: boolean): {
89
+ blob: Blob;
90
+ url: string;
91
+ } | null;
92
+ /**
93
+ * Sets the Blob data of the current canvas image.
94
+ */
95
+ setBlobData(blobData: {
96
+ blob: Blob;
97
+ url: string;
98
+ }): Promise<void>;
99
+ /**
100
+ * Returns a resized canvas according to video element size.
101
+ */
102
+ getResizedCanvas(videoElementWidth: number, videoElementHeight: number): IncodeCanvas | null;
103
+ }
104
+ //#endregion
105
+ //#region ../infra/src/capabilities/IMLProviderCapability.d.ts
106
+ /**
107
+ * Base configuration shared by all ML provider capabilities.
108
+ */
109
+ interface MLProviderConfig {
110
+ /** Path to the WASM binary */
111
+ wasmPath?: string;
112
+ /** Path to the SIMD-optimized WASM binary (optional) */
113
+ wasmSimdPath?: string;
114
+ /** Path to the WASM glue code */
115
+ glueCodePath?: string;
116
+ /** Whether to use SIMD optimizations (default: true) */
117
+ useSimd?: boolean;
118
+ /**
119
+ * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
120
+ * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
121
+ */
122
+ modelsBasePath?: string;
123
+ }
124
+ /**
125
+ * Base interface for ML provider capabilities.
126
+ * Provides common lifecycle and frame processing methods shared by
127
+ * FaceDetectionCapability and IdCaptureCapability.
128
+ */
129
+ interface IMLProviderCapability<TConfig extends MLProviderConfig> {
130
+ /**
131
+ * Whether the provider has been initialized and is ready to process frames.
132
+ */
133
+ readonly initialized: boolean;
134
+ /**
135
+ * Initializes the provider with the given configuration.
136
+ * If WASM was already warmed up via `setup()` or `warmupWasm()`, this returns almost instantly.
137
+ * @param config - Provider configuration including WASM paths
138
+ */
139
+ initialize(config: TConfig): Promise<void>;
140
+ /**
141
+ * Processes a frame through the ML pipeline.
142
+ * Callbacks set via `setCallbacks()` will be invoked based on the analysis results.
143
+ * @param image - Image data to process
144
+ * @throws Error if provider is not initialized
145
+ */
146
+ processFrame(image: ImageData): Promise<void>;
147
+ /**
148
+ * Resets the pipeline to its initial state.
149
+ * Safe to call even if not initialized (no-op in that case).
150
+ */
151
+ reset(): void;
152
+ /**
153
+ * Disposes of resources and resets initialization state.
154
+ * Safe to call even if not initialized.
155
+ */
156
+ dispose(): Promise<void>;
157
+ }
158
+ //#endregion
159
+ //#region ../infra/src/capabilities/IMotionSensorCapability.d.ts
160
+ type MotionStatus = 'PASS' | 'FAIL' | 'UNCLEAR';
161
+ type MotionPermissionState = 'granted' | 'denied' | 'not-required';
162
+ type IMotionSensorCapability = {
163
+ requestPermission(): Promise<MotionPermissionState>;
164
+ start(): Promise<void>;
165
+ stop(): void;
166
+ check(): MotionStatus;
167
+ readonly isRunning: boolean;
168
+ readonly hasPermission: boolean;
169
+ };
170
+ //#endregion
171
+ //#region ../infra/src/capabilities/IRecordingCapability.d.ts
172
+ type RecordingPublisher = {
173
+ getStreamId: () => string | undefined;
174
+ replaceVideoTrack: (track: MediaStreamTrack) => Promise<void>;
175
+ destroy: () => void;
176
+ };
177
+ type RecordingConnection = {
178
+ sessionId: string | undefined;
179
+ publisher: RecordingPublisher;
180
+ disconnect: () => Promise<void>;
181
+ };
182
+ type RecordingConnectionEvents = {
183
+ onSessionConnected?: (sessionId: string | undefined) => void;
184
+ onSessionDisconnected?: (sessionId: string | undefined) => void;
185
+ onSessionException?: (params: {
186
+ name?: string;
187
+ message?: string;
188
+ sessionId?: string;
189
+ }) => void;
190
+ onPublisherCreated?: (params: {
191
+ streamId?: string;
192
+ sessionId?: string;
193
+ }) => void;
194
+ onPublisherError?: (params: {
195
+ message?: string;
196
+ sessionId?: string;
197
+ streamId?: string;
198
+ }) => void;
199
+ };
200
+ type ConnectRecordingParams = {
201
+ sessionToken: string;
202
+ stream: MediaStream;
203
+ events?: RecordingConnectionEvents;
204
+ };
205
+ type IRecordingCapability = {
206
+ /**
207
+ * Connects to a recording session and publishes the provided media stream.
208
+ * Returns a connection handle that can be disconnected and used to manage the publisher.
209
+ */
210
+ connect: (params: ConnectRecordingParams) => Promise<RecordingConnection>;
211
+ };
212
+ //#endregion
213
+ //#region ../infra/src/media/camera.d.ts
214
+ type CameraStream = MediaStream;
215
+ //#endregion
216
+ //#region ../infra/src/media/StreamCanvasCapture.d.ts
217
+ type StreamCanvasCaptureOptions = {
218
+ fps?: number;
219
+ width?: number;
220
+ height?: number;
221
+ };
222
+ type StreamCanvasCaptureEventMap = {
223
+ frame: Event;
224
+ };
225
+ declare class StreamCanvasCapture {
226
+ private video;
227
+ private canvas;
228
+ private ctx;
229
+ private rafId;
230
+ private lastFrameTimeSeconds;
231
+ private lastTickTimeMs;
232
+ private hasFrame;
233
+ private disposed;
234
+ private eventTarget;
235
+ constructor(stream: CameraStream, options?: StreamCanvasCaptureOptions);
236
+ addEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
237
+ removeEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
238
+ /**
239
+ * Returns the latest cached frame as an {@link IncodeCanvas}.
240
+ */
241
+ getLatestCanvas(): IncodeCanvas | null;
242
+ /**
243
+ * Returns the latest cached frame as raw {@link ImageData}.
244
+ */
245
+ getLatestFrame(): ImageData | null;
246
+ /**
247
+ * Disposes internal resources and stops the capture loop.
248
+ */
249
+ dispose(): void;
250
+ private rafLoop;
251
+ private tick;
252
+ }
253
+ //#endregion
254
+ //#region ../infra/src/wasm/WasmPipelineType.d.ts
255
+ declare enum WasmPipelineType {
256
+ IdBlurGlarePipeline = 0,
257
+ IdBarcodeAndTextQualityPipeline = 1,
258
+ IdVideoSelfiePipeline = 2,
259
+ SelfieWithAggregationMetrics = 3,
260
+ SelfieWithQualityMetrics = 4,
261
+ IdFaceDetectionPipeline = 5,
262
+ }
263
+ //#endregion
264
+ //#region ../infra/src/providers/wasm/BaseWasmProvider.d.ts
265
+ /**
266
+ * Base configuration for WASM providers
267
+ */
268
+ interface BaseWasmConfig {
269
+ /** Path to the WASM binary */
270
+ wasmPath?: string;
271
+ /** Path to the SIMD-optimized WASM binary (optional) */
272
+ wasmSimdPath?: string;
273
+ /** Path to the WASM glue code */
274
+ glueCodePath?: string;
275
+ /** Whether to use SIMD optimizations (default: true) */
276
+ useSimd?: boolean;
277
+ /**
278
+ * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
279
+ * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
280
+ */
281
+ modelsBasePath?: string;
282
+ }
283
+ /**
284
+ * Base provider class that abstracts common WASM functionality.
285
+ * This serves as a foundation for specific ML capability providers
286
+ * like FaceDetectionProvider and IdCaptureProvider.
287
+ */
288
+ declare abstract class BaseWasmProvider {
289
+ private _isInitialized;
290
+ protected pipelineType: WasmPipelineType | undefined;
291
+ /**
292
+ * Creates a new BaseWasmProvider
293
+ * @param pipelineType - The WASM pipeline type this provider uses
294
+ */
295
+ constructor(pipelineType?: WasmPipelineType);
296
+ /**
297
+ * Returns whether this provider has been initialized.
298
+ */
299
+ get initialized(): boolean;
300
+ protected getPipelineType(): WasmPipelineType;
301
+ /**
302
+ * Initializes the provider by ensuring WASM is loaded
303
+ * @param config - Provider configuration
304
+ * @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
305
+ */
306
+ protected initializeBase(config: BaseWasmConfig, pipeline: WasmPipeline): Promise<void>;
307
+ /**
308
+ * Ensures the provider is initialized before performing operations.
309
+ * @throws Error if not initialized
310
+ */
311
+ protected ensureInitialized(): void;
312
+ /**
313
+ * Processes a frame through the WASM pipeline
314
+ * @param image - Image data to process
315
+ * @returns The pipeline result (type depends on pipeline - WASM returns any)
316
+ */
317
+ protected processFrameWasm(image: ImageData): Promise<any>;
318
+ abstract processFrame(image: ImageData): Promise<void>;
319
+ /**
320
+ * Resets the pipeline to its initial state.
321
+ * Safe to call even if not initialized (no-op in that case).
322
+ */
323
+ reset(): void;
324
+ /**
325
+ * Disposes of resources and resets initialization state.
326
+ * Safe to call even if not initialized.
327
+ */
328
+ dispose(): Promise<void>;
329
+ }
330
+ //#endregion
331
+ //#region src/internal/permissions/types.d.ts
332
+ type PermissionResult = 'granted' | 'denied' | 'prompt';
333
+ type PermissionStatus = 'idle' | 'requesting' | 'denied' | 'learnMore';
334
+ //#endregion
335
+ export { CameraStream as a, IMotionSensorCapability as c, IMLProviderCapability as d, MLProviderConfig as f, StreamCanvasCapture as i, MotionPermissionState as l, PermissionStatus as n, IRecordingCapability as o, IncodeCanvas as p, BaseWasmProvider as r, RecordingConnection as s, PermissionResult as t, MotionStatus as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "2.0.0-alpha.11",
3
+ "version": "2.0.0-alpha.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,6 +25,10 @@
25
25
  "types": "./dist/email.d.ts",
26
26
  "import": "./dist/email.esm.js"
27
27
  },
28
+ "./id": {
29
+ "types": "./dist/id.d.ts",
30
+ "import": "./dist/id.esm.js"
31
+ },
28
32
  "./camera": {
29
33
  "types": "./dist/camera.d.ts",
30
34
  "import": "./dist/camera.esm.js"
@@ -40,7 +44,7 @@
40
44
  "typescript": "^5.9.3",
41
45
  "vitest": "^4.0.13",
42
46
  "@incodetech/config": "1.0.0",
43
- "@incodetech/infra": "1.1.0-alpha.1"
47
+ "@incodetech/infra": "1.1.0-alpha.2"
44
48
  },
45
49
  "scripts": {
46
50
  "build": "tsdown -c tsdown.config.ts",
@@ -1,3 +0,0 @@
1
- import { t as require_OpenViduLogger } from "./OpenViduLogger-5b7KqNTo.esm.js";
2
-
3
- export default require_OpenViduLogger();
@@ -1,2 +0,0 @@
1
- import { AnyStateMachine, StateMachine } from "xstate";
2
- export { StateMachine as n, AnyStateMachine as t };
@@ -1,8 +0,0 @@
1
- //#region ../infra/src/device/getBrowser.ts
2
- function getUserAgent() {
3
- if (typeof navigator === "undefined") return "";
4
- return navigator.userAgent;
5
- }
6
-
7
- //#endregion
8
- export { getUserAgent as t };
@@ -1,5 +0,0 @@
1
- //#region src/internal/permissions/types.d.ts
2
- type PermissionResult = 'granted' | 'denied' | 'prompt';
3
- type PermissionStatus = 'idle' | 'requesting' | 'denied' | 'learnMore';
4
- //#endregion
5
- export { PermissionStatus as n, PermissionResult as t };