@incodetech/core 2.0.0-alpha.5 → 2.0.0-alpha.7
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/dist/{addEvent-9v4w5iO-.esm.js → addEvent-W0ORK0jT.esm.js} +2 -2
- package/dist/email.d.ts +4 -4
- package/dist/email.esm.js +6 -6
- package/dist/{endpoints-Dn1t57hJ.esm.js → endpoints-BSTFaHYo.esm.js} +2 -2
- package/dist/flow.d.ts +9 -9
- package/dist/flow.esm.js +10 -10
- package/dist/index.d.ts +6 -6
- package/dist/index.esm.js +3 -3
- package/dist/{permissionServices-CCpxd8le.esm.js → permissionServices-I6vX6DBy.esm.js} +4 -4
- package/dist/phone.d.ts +4 -4
- package/dist/phone.esm.js +6 -6
- package/dist/selfie.d.ts +5 -5
- package/dist/selfie.esm.js +12 -12
- package/dist/{types-kWlqshfM.d.ts → types-iZi2rawo.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as api, t as endpoints } from "./endpoints-
|
|
1
|
+
import { n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
|
|
2
2
|
|
|
3
|
-
//#region src/events/addEvent.ts
|
|
3
|
+
//#region src/internal/events/addEvent.ts
|
|
4
4
|
function addEvent(event) {
|
|
5
5
|
const { code, module, screen, clientTimestamp, payload = {} } = event;
|
|
6
6
|
return api.post(endpoints.events, [{
|
package/dist/email.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Manager } from "./Manager-BGfxEmyv.js";
|
|
2
2
|
|
|
3
|
-
//#region src/email/types.d.ts
|
|
3
|
+
//#region src/modules/email/types.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for email verification.
|
|
@@ -48,16 +48,16 @@ type EmailConfig = {
|
|
|
48
48
|
maxOtpAttempts?: number;
|
|
49
49
|
};
|
|
50
50
|
//#endregion
|
|
51
|
-
//#region src/email/emailStateMachine.d.ts
|
|
51
|
+
//#region src/modules/email/emailStateMachine.d.ts
|
|
52
52
|
|
|
53
53
|
declare const emailMachine: any;
|
|
54
54
|
//#endregion
|
|
55
|
-
//#region src/email/emailActor.d.ts
|
|
55
|
+
//#region src/modules/email/emailActor.d.ts
|
|
56
56
|
type CreateEmailActorOptions = {
|
|
57
57
|
config: EmailConfig;
|
|
58
58
|
};
|
|
59
59
|
//#endregion
|
|
60
|
-
//#region src/email/emailManager.d.ts
|
|
60
|
+
//#region src/modules/email/emailManager.d.ts
|
|
61
61
|
/** Email manager is in initial state, waiting for `load()` to be called */
|
|
62
62
|
type EmailIdleState = {
|
|
63
63
|
status: 'idle';
|
package/dist/email.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as createManager, n as api, t as endpoints } from "./endpoints-
|
|
1
|
+
import { g as createManager, n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
|
|
2
2
|
import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B_rda9yU.esm.js";
|
|
3
|
-
import { t as addEvent } from "./addEvent-
|
|
3
|
+
import { t as addEvent } from "./addEvent-W0ORK0jT.esm.js";
|
|
4
4
|
|
|
5
|
-
//#region src/email/emailServices.ts
|
|
5
|
+
//#region src/modules/email/emailServices.ts
|
|
6
6
|
async function fetchEmail(signal) {
|
|
7
7
|
const res = await api.get(endpoints.getEmail, { signal });
|
|
8
8
|
if (!res.ok) throw new Error(`GET ${endpoints.getEmail} failed: ${res.status} ${res.statusText}`);
|
|
@@ -24,7 +24,7 @@ async function verifyEmailOtp(code, signal) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region src/email/emailStateMachine.ts
|
|
27
|
+
//#region src/modules/email/emailStateMachine.ts
|
|
28
28
|
const RESEND_TIMER_SECONDS = 30;
|
|
29
29
|
const emailMachine = setup({
|
|
30
30
|
types: {
|
|
@@ -264,13 +264,13 @@ const emailMachine = setup({
|
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
//#endregion
|
|
267
|
-
//#region src/email/emailActor.ts
|
|
267
|
+
//#region src/modules/email/emailActor.ts
|
|
268
268
|
function createEmailActor(options) {
|
|
269
269
|
return createActor(emailMachine, { input: { config: options.config } }).start();
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
//#endregion
|
|
273
|
-
//#region src/email/emailManager.ts
|
|
273
|
+
//#region src/modules/email/emailManager.ts
|
|
274
274
|
/**
|
|
275
275
|
* @module @incodetech/core/email
|
|
276
276
|
*
|
|
@@ -1637,7 +1637,7 @@ var WasmUtilProvider = class WasmUtilProvider extends BaseWasmProvider {
|
|
|
1637
1637
|
};
|
|
1638
1638
|
|
|
1639
1639
|
//#endregion
|
|
1640
|
-
//#region src/http/api.ts
|
|
1640
|
+
//#region src/internal/http/api.ts
|
|
1641
1641
|
let client = null;
|
|
1642
1642
|
let currentToken = null;
|
|
1643
1643
|
function setClient(httpClient) {
|
|
@@ -1683,7 +1683,7 @@ const api = {
|
|
|
1683
1683
|
};
|
|
1684
1684
|
|
|
1685
1685
|
//#endregion
|
|
1686
|
-
//#region src/http/endpoints.ts
|
|
1686
|
+
//#region src/internal/http/endpoints.ts
|
|
1687
1687
|
const endpoints = {
|
|
1688
1688
|
createSession: "/omni/start",
|
|
1689
1689
|
flow: "/omni/onboarding/flow",
|
package/dist/flow.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { t as WasmPipeline } from "./warmup-CEJTfxQr.js";
|
|
|
2
2
|
import { t as Manager } from "./Manager-BGfxEmyv.js";
|
|
3
3
|
import { t as AnyStateMachine } from "./StateMachine-DRE1oH2B.js";
|
|
4
4
|
|
|
5
|
-
//#region src/flow/types.d.ts
|
|
5
|
+
//#region src/modules/flow/types.d.ts
|
|
6
6
|
type EmptyConfig = Record<string, never>;
|
|
7
7
|
type RegulationTypes = 'US' | 'Worldwide' | 'Other' | 'US_Illinois' | 'US_Texas' | 'US_California' | 'US_Washington';
|
|
8
8
|
type TutorialIdConfig = {
|
|
@@ -302,7 +302,7 @@ type Flow = {
|
|
|
302
302
|
ds?: boolean;
|
|
303
303
|
};
|
|
304
304
|
//#endregion
|
|
305
|
-
//#region src/flow/flowAnalyzer.d.ts
|
|
305
|
+
//#region src/modules/flow/flowAnalyzer.d.ts
|
|
306
306
|
/**
|
|
307
307
|
* Analyzes a flow configuration and returns the WASM pipelines needed.
|
|
308
308
|
* Use this to conditionally warmup WASM only when required by the flow.
|
|
@@ -320,7 +320,7 @@ type Flow = {
|
|
|
320
320
|
*/
|
|
321
321
|
declare function getRequiredWasmPipelines(flow: Flow): WasmPipeline[];
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region src/flow/flowCompletionService.d.ts
|
|
323
|
+
//#region src/modules/flow/flowCompletionService.d.ts
|
|
324
324
|
type FinishStatus = {
|
|
325
325
|
redirectionUrl: string;
|
|
326
326
|
action: 'approved' | 'rejected' | 'none';
|
|
@@ -328,15 +328,15 @@ type FinishStatus = {
|
|
|
328
328
|
};
|
|
329
329
|
type GetFinishStatusFn = (flowId: string | undefined | null, signal?: AbortSignal) => Promise<FinishStatus>;
|
|
330
330
|
//#endregion
|
|
331
|
-
//#region src/flow/flowServices.d.ts
|
|
331
|
+
//#region src/modules/flow/flowServices.d.ts
|
|
332
332
|
type GetFlow = (signal: AbortSignal) => Promise<Flow>;
|
|
333
333
|
//#endregion
|
|
334
|
-
//#region src/flow/flowActor.d.ts
|
|
334
|
+
//#region src/modules/flow/flowActor.d.ts
|
|
335
335
|
type CreateFlowActorOptions = {
|
|
336
336
|
getFlow?: GetFlow;
|
|
337
337
|
};
|
|
338
338
|
//#endregion
|
|
339
|
-
//#region src/flow/flowManager.d.ts
|
|
339
|
+
//#region src/modules/flow/flowManager.d.ts
|
|
340
340
|
/** Flow manager is waiting to be started */
|
|
341
341
|
type FlowIdleState = {
|
|
342
342
|
status: 'idle';
|
|
@@ -453,7 +453,7 @@ declare function createFlowManager(options?: CreateFlowActorOptions): Manager<Fl
|
|
|
453
453
|
isModuleEnabled: (moduleKey: string) => boolean;
|
|
454
454
|
};
|
|
455
455
|
//#endregion
|
|
456
|
-
//#region src/flow/moduleLoader.d.ts
|
|
456
|
+
//#region src/modules/flow/moduleLoader.d.ts
|
|
457
457
|
type LazyModule<T$1> = () => Promise<T$1>;
|
|
458
458
|
type ModuleLoaderRegistry = {
|
|
459
459
|
[key: string]: LazyModule<{
|
|
@@ -467,7 +467,7 @@ interface ModuleLoader {
|
|
|
467
467
|
}
|
|
468
468
|
declare function createModuleLoader(registry: ModuleLoaderRegistry): ModuleLoader;
|
|
469
469
|
//#endregion
|
|
470
|
-
//#region src/flow/orchestratedFlowStateMachine.d.ts
|
|
470
|
+
//#region src/modules/flow/orchestratedFlowStateMachine.d.ts
|
|
471
471
|
type GetFlowFn = (signal: AbortSignal) => Promise<Flow>;
|
|
472
472
|
type ModuleRegistry = {
|
|
473
473
|
PHONE?: AnyStateMachine;
|
|
@@ -496,7 +496,7 @@ type OrchestratedFlowEvent = {
|
|
|
496
496
|
[key: string]: unknown;
|
|
497
497
|
};
|
|
498
498
|
//#endregion
|
|
499
|
-
//#region src/flow/orchestratedFlowManager.d.ts
|
|
499
|
+
//#region src/modules/flow/orchestratedFlowManager.d.ts
|
|
500
500
|
type OrchestratedFlowIdleState = {
|
|
501
501
|
status: 'idle';
|
|
502
502
|
};
|
package/dist/flow.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as createManager, n as api, t as endpoints } from "./endpoints-
|
|
1
|
+
import { g as createManager, n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
|
|
2
2
|
import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B_rda9yU.esm.js";
|
|
3
3
|
|
|
4
|
-
//#region src/flow/flowAnalyzer.ts
|
|
4
|
+
//#region src/modules/flow/flowAnalyzer.ts
|
|
5
5
|
const WASM_MODULE_PIPELINES = {
|
|
6
6
|
SELFIE: "selfie",
|
|
7
7
|
AUTHENTICATION: "selfie",
|
|
@@ -37,7 +37,7 @@ function getRequiredWasmPipelines(flow) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region src/flow/flowServices.ts
|
|
40
|
+
//#region src/modules/flow/flowServices.ts
|
|
41
41
|
const getFlow = async (signal) => {
|
|
42
42
|
const res = await api.get(endpoints.flow, { signal });
|
|
43
43
|
if (!res.ok) throw new Error(`GET /flow failed: ${res.status} ${res.statusText}`);
|
|
@@ -45,7 +45,7 @@ const getFlow = async (signal) => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region src/flow/flowStateMachine.ts
|
|
48
|
+
//#region src/modules/flow/flowStateMachine.ts
|
|
49
49
|
const flowMachine = setup({
|
|
50
50
|
types: {
|
|
51
51
|
context: {},
|
|
@@ -167,13 +167,13 @@ const flowMachine = setup({
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
//#endregion
|
|
170
|
-
//#region src/flow/flowActor.ts
|
|
170
|
+
//#region src/modules/flow/flowActor.ts
|
|
171
171
|
function createFlowActor(options) {
|
|
172
172
|
return createActor(flowMachine, { input: { getFlow: options?.getFlow ?? getFlow } }).start();
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
//#endregion
|
|
176
|
-
//#region src/flow/flowManager.ts
|
|
176
|
+
//#region src/modules/flow/flowManager.ts
|
|
177
177
|
function mapState$1(snapshot) {
|
|
178
178
|
const { value, context } = snapshot;
|
|
179
179
|
switch (value) {
|
|
@@ -279,7 +279,7 @@ function createFlowManager(options) {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region src/flow/moduleLoader.ts
|
|
282
|
+
//#region src/modules/flow/moduleLoader.ts
|
|
283
283
|
var ModuleLoaderImpl = class {
|
|
284
284
|
constructor(registry) {
|
|
285
285
|
this.registry = registry;
|
|
@@ -319,7 +319,7 @@ function createModuleLoader(registry) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
//#endregion
|
|
322
|
-
//#region src/flow/flowCompletionService.ts
|
|
322
|
+
//#region src/modules/flow/flowCompletionService.ts
|
|
323
323
|
const getFinishStatus = async (flowId, signal) => {
|
|
324
324
|
const url = `/omni/finish-status${flowId ? `?flowId=${flowId}` : ""}`;
|
|
325
325
|
const res = await api.get(url, { signal });
|
|
@@ -328,7 +328,7 @@ const getFinishStatus = async (flowId, signal) => {
|
|
|
328
328
|
};
|
|
329
329
|
|
|
330
330
|
//#endregion
|
|
331
|
-
//#region src/flow/orchestratedFlowStateMachine.ts
|
|
331
|
+
//#region src/modules/flow/orchestratedFlowStateMachine.ts
|
|
332
332
|
const orchestratedFlowMachine = setup({
|
|
333
333
|
types: {
|
|
334
334
|
context: {},
|
|
@@ -530,7 +530,7 @@ const orchestratedFlowMachine = setup({
|
|
|
530
530
|
});
|
|
531
531
|
|
|
532
532
|
//#endregion
|
|
533
|
-
//#region src/flow/orchestratedFlowManager.ts
|
|
533
|
+
//#region src/modules/flow/orchestratedFlowManager.ts
|
|
534
534
|
function mapState(snapshot) {
|
|
535
535
|
const { value, context } = snapshot;
|
|
536
536
|
switch (value) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as warmupWasm, t as WasmPipeline } from "./warmup-CEJTfxQr.js";
|
|
2
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
2
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-iZi2rawo.js";
|
|
3
3
|
|
|
4
4
|
//#region ../infra/src/http/types.d.ts
|
|
5
5
|
type CreateApiConfig = {
|
|
@@ -45,15 +45,15 @@ type HttpClient = {
|
|
|
45
45
|
//#region ../infra/src/http/createApi.d.ts
|
|
46
46
|
declare const createApi: (config: CreateApiConfig) => HttpClient;
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region src/device/getBrowser.d.ts
|
|
48
|
+
//#region src/internal/device/getBrowser.d.ts
|
|
49
49
|
type Browser = 'chrome' | 'firefox' | 'safari' | 'edge' | 'other';
|
|
50
50
|
declare function getBrowser(): Browser;
|
|
51
51
|
//#endregion
|
|
52
|
-
//#region src/device/getDeviceClass.d.ts
|
|
52
|
+
//#region src/internal/device/getDeviceClass.d.ts
|
|
53
53
|
type DeviceClass = 'ios' | 'android' | 'desktop';
|
|
54
54
|
declare function getDeviceClass(): DeviceClass;
|
|
55
55
|
//#endregion
|
|
56
|
-
//#region src/http/api.d.ts
|
|
56
|
+
//#region src/internal/http/api.d.ts
|
|
57
57
|
type MethodConfig = {
|
|
58
58
|
headers?: Record<string, string>;
|
|
59
59
|
signal?: AbortSignal;
|
|
@@ -70,7 +70,7 @@ type ApiClient = {
|
|
|
70
70
|
declare function getApi(): HttpClient;
|
|
71
71
|
declare const api: ApiClient;
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region src/permissions/permissionServices.d.ts
|
|
73
|
+
//#region src/internal/permissions/permissionServices.d.ts
|
|
74
74
|
/**
|
|
75
75
|
* Checks the current camera permission state without prompting the user.
|
|
76
76
|
*/
|
|
@@ -81,7 +81,7 @@ declare function checkPermission(): Promise<PermissionResult>;
|
|
|
81
81
|
*/
|
|
82
82
|
declare function requestPermission(): Promise<PermissionResult>;
|
|
83
83
|
//#endregion
|
|
84
|
-
//#region src/session/sessionService.d.ts
|
|
84
|
+
//#region src/internal/session/sessionService.d.ts
|
|
85
85
|
type CreateSessionOptions = {
|
|
86
86
|
/** The configuration/flow ID from the Incode dashboard */
|
|
87
87
|
configurationId: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as getBrowser, n as requestPermission, r as getDeviceClass, t as checkPermission } from "./permissionServices-
|
|
2
|
-
import { _ as createApi_default, a as setClient, i as resetApi, l as warmupWasm, n as api, o as setToken, r as getApi, s as WasmUtilProvider, t as endpoints } from "./endpoints-
|
|
1
|
+
import { i as getBrowser, n as requestPermission, r as getDeviceClass, t as checkPermission } from "./permissionServices-I6vX6DBy.esm.js";
|
|
2
|
+
import { _ as createApi_default, a as setClient, i as resetApi, l as warmupWasm, n as api, o as setToken, r as getApi, s as WasmUtilProvider, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
|
|
3
3
|
|
|
4
|
-
//#region src/session/sessionService.ts
|
|
4
|
+
//#region src/internal/session/sessionService.ts
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new onboarding session.
|
|
7
7
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as stopCameraStream, m as requestCameraAccess, p as queryCameraPermission } from "./endpoints-
|
|
1
|
+
import { h as stopCameraStream, m as requestCameraAccess, p as queryCameraPermission } from "./endpoints-BSTFaHYo.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region ../infra/src/device/getBrowser.ts
|
|
4
4
|
function getUserAgent() {
|
|
@@ -22,7 +22,7 @@ function getDeviceInfo() {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region src/device/getBrowser.ts
|
|
25
|
+
//#region src/internal/device/getBrowser.ts
|
|
26
26
|
function getBrowser() {
|
|
27
27
|
const userAgent = getUserAgent();
|
|
28
28
|
if (!userAgent) return "other";
|
|
@@ -35,7 +35,7 @@ function getBrowser() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
//#endregion
|
|
38
|
-
//#region src/device/getDeviceClass.ts
|
|
38
|
+
//#region src/internal/device/getDeviceClass.ts
|
|
39
39
|
function getDeviceClass() {
|
|
40
40
|
const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
|
|
41
41
|
if (!userAgent) return "desktop";
|
|
@@ -46,7 +46,7 @@ function getDeviceClass() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
//#endregion
|
|
49
|
-
//#region src/permissions/permissionServices.ts
|
|
49
|
+
//#region src/internal/permissions/permissionServices.ts
|
|
50
50
|
/**
|
|
51
51
|
* Checks the current camera permission state without prompting the user.
|
|
52
52
|
*/
|
package/dist/phone.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Manager } from "./Manager-BGfxEmyv.js";
|
|
2
2
|
|
|
3
|
-
//#region src/phone/types.d.ts
|
|
3
|
+
//#region src/modules/phone/types.d.ts
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for phone verification.
|
|
@@ -62,16 +62,16 @@ type PhoneConfig = {
|
|
|
62
62
|
maxOtpAttempts?: number;
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region src/phone/phoneStateMachine.d.ts
|
|
65
|
+
//#region src/modules/phone/phoneStateMachine.d.ts
|
|
66
66
|
|
|
67
67
|
declare const phoneMachine: any;
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region src/phone/phoneActor.d.ts
|
|
69
|
+
//#region src/modules/phone/phoneActor.d.ts
|
|
70
70
|
type CreatePhoneActorOptions = {
|
|
71
71
|
config: PhoneConfig;
|
|
72
72
|
};
|
|
73
73
|
//#endregion
|
|
74
|
-
//#region src/phone/phoneManager.d.ts
|
|
74
|
+
//#region src/modules/phone/phoneManager.d.ts
|
|
75
75
|
/** Phone manager is in initial state, waiting for `load()` to be called */
|
|
76
76
|
type PhoneIdleState = {
|
|
77
77
|
status: 'idle';
|
package/dist/phone.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as createManager, n as api, t as endpoints } from "./endpoints-
|
|
1
|
+
import { g as createManager, n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
|
|
2
2
|
import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B_rda9yU.esm.js";
|
|
3
|
-
import { t as addEvent } from "./addEvent-
|
|
3
|
+
import { t as addEvent } from "./addEvent-W0ORK0jT.esm.js";
|
|
4
4
|
|
|
5
|
-
//#region src/phone/phoneServices.ts
|
|
5
|
+
//#region src/modules/phone/phoneServices.ts
|
|
6
6
|
async function fetchPhone(signal) {
|
|
7
7
|
const res = await api.get(endpoints.getPhone, { signal });
|
|
8
8
|
if (!res.ok) throw new Error(`GET ${endpoints.getPhone} failed: ${res.status} ${res.statusText}`);
|
|
@@ -40,7 +40,7 @@ async function verifyOtp(code, signal) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region src/phone/phoneStateMachine.ts
|
|
43
|
+
//#region src/modules/phone/phoneStateMachine.ts
|
|
44
44
|
const RESEND_TIMER_SECONDS = 30;
|
|
45
45
|
const phoneMachine = setup({
|
|
46
46
|
types: {
|
|
@@ -318,13 +318,13 @@ const phoneMachine = setup({
|
|
|
318
318
|
});
|
|
319
319
|
|
|
320
320
|
//#endregion
|
|
321
|
-
//#region src/phone/phoneActor.ts
|
|
321
|
+
//#region src/modules/phone/phoneActor.ts
|
|
322
322
|
function createPhoneActor(options) {
|
|
323
323
|
return createActor(phoneMachine, { input: { config: options.config } }).start();
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
//#endregion
|
|
327
|
-
//#region src/phone/phoneManager.ts
|
|
327
|
+
//#region src/modules/phone/phoneManager.ts
|
|
328
328
|
/**
|
|
329
329
|
* @module @incodetech/core/phone
|
|
330
330
|
*
|
package/dist/selfie.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as WasmPipeline } from "./warmup-CEJTfxQr.js";
|
|
2
2
|
import { t as Manager } from "./Manager-BGfxEmyv.js";
|
|
3
3
|
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-DRE1oH2B.js";
|
|
4
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
4
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-iZi2rawo.js";
|
|
5
5
|
|
|
6
6
|
//#region ../infra/src/media/canvas.d.ts
|
|
7
7
|
/**
|
|
@@ -480,7 +480,7 @@ declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDet
|
|
|
480
480
|
private formatFaceCoordinates;
|
|
481
481
|
}
|
|
482
482
|
//#endregion
|
|
483
|
-
//#region src/selfie/types.d.ts
|
|
483
|
+
//#region src/modules/selfie/types.d.ts
|
|
484
484
|
type SelfieConfig = {
|
|
485
485
|
showTutorial: boolean;
|
|
486
486
|
showPreview: boolean;
|
|
@@ -551,7 +551,7 @@ type RecordingSession = {
|
|
|
551
551
|
hasAudio: boolean;
|
|
552
552
|
};
|
|
553
553
|
//#endregion
|
|
554
|
-
//#region src/selfie/selfieStateMachine.d.ts
|
|
554
|
+
//#region src/modules/selfie/selfieStateMachine.d.ts
|
|
555
555
|
type SelfieContext = {
|
|
556
556
|
config: SelfieConfig;
|
|
557
557
|
stream: CameraStream | undefined;
|
|
@@ -618,12 +618,12 @@ declare const selfieMachine: AnyStateMachine;
|
|
|
618
618
|
*/
|
|
619
619
|
type SelfieMachine = StateMachine<SelfieContext, SelfieEvent, any, any, any, any, any, any, any, SelfieInput, any, any, any, any>;
|
|
620
620
|
//#endregion
|
|
621
|
-
//#region src/selfie/selfieActor.d.ts
|
|
621
|
+
//#region src/modules/selfie/selfieActor.d.ts
|
|
622
622
|
type CreateSelfieActorOptions = {
|
|
623
623
|
config: SelfieConfig;
|
|
624
624
|
};
|
|
625
625
|
//#endregion
|
|
626
|
-
//#region src/selfie/selfieManager.d.ts
|
|
626
|
+
//#region src/modules/selfie/selfieManager.d.ts
|
|
627
627
|
type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
|
|
628
628
|
/** Selfie manager is waiting to be started */
|
|
629
629
|
type SelfieIdleState = {
|
package/dist/selfie.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as requestPermission, r as getDeviceClass, t as checkPermission } from "./permissionServices-
|
|
2
|
-
import { c as FaceDetectionProvider, d as StreamCanvasProcessingSession, f as StreamCanvasCapture, g as createManager, h as stopCameraStream, m as requestCameraAccess, n as api, s as WasmUtilProvider, t as endpoints, u as OpenViduRecordingProvider } from "./endpoints-
|
|
1
|
+
import { n as requestPermission, r as getDeviceClass, t as checkPermission } from "./permissionServices-I6vX6DBy.esm.js";
|
|
2
|
+
import { c as FaceDetectionProvider, d as StreamCanvasProcessingSession, f as StreamCanvasCapture, g as createManager, h as stopCameraStream, m as requestCameraAccess, n as api, s as WasmUtilProvider, t as endpoints, u as OpenViduRecordingProvider } from "./endpoints-BSTFaHYo.esm.js";
|
|
3
3
|
import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B_rda9yU.esm.js";
|
|
4
|
-
import { t as addEvent } from "./addEvent-
|
|
4
|
+
import { t as addEvent } from "./addEvent-W0ORK0jT.esm.js";
|
|
5
5
|
|
|
6
|
-
//#region src/selfie/types.ts
|
|
6
|
+
//#region src/modules/selfie/types.ts
|
|
7
7
|
const FACE_ERROR_CODES = {
|
|
8
8
|
FACE_OCCLUDED: "FACE_OCCLUDED",
|
|
9
9
|
LIVENESS: "LIVENESS_ERROR",
|
|
@@ -36,7 +36,7 @@ const FACE_ERROR_CODES = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region src/selfie/selfieErrorUtils.ts
|
|
39
|
+
//#region src/modules/selfie/selfieErrorUtils.ts
|
|
40
40
|
const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
|
|
41
41
|
const isFaceErrorCode = (value) => {
|
|
42
42
|
return FACE_ERROR_CODE_VALUES.includes(value);
|
|
@@ -56,7 +56,7 @@ const validateUploadResponse = ({ config, response }) => {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region src/recordings/recordingsRepository.ts
|
|
59
|
+
//#region src/internal/recordings/recordingsRepository.ts
|
|
60
60
|
async function createRecordingSession(type) {
|
|
61
61
|
return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
|
|
62
62
|
}
|
|
@@ -75,7 +75,7 @@ async function stopRecording$1(videoRecordingId) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
|
-
//#region src/recordings/streamingEvents.ts
|
|
78
|
+
//#region src/internal/recordings/streamingEvents.ts
|
|
79
79
|
const streamingEvents = {
|
|
80
80
|
strSessionDidConnect: "strSessionDidConnect",
|
|
81
81
|
strSessionDidDisconnect: "strSessionDidDisconnect",
|
|
@@ -88,7 +88,7 @@ const streamingEvents = {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region src/selfie/selfieUploadService.ts
|
|
91
|
+
//#region src/modules/selfie/selfieUploadService.ts
|
|
92
92
|
/**
|
|
93
93
|
* Uploads a selfie image to the backend.
|
|
94
94
|
*/
|
|
@@ -129,7 +129,7 @@ const getFaceErrorCodeFromHttpError = (error) => {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
//#endregion
|
|
132
|
-
//#region src/selfie/selfieServices.ts
|
|
132
|
+
//#region src/modules/selfie/selfieServices.ts
|
|
133
133
|
const CAMERA_CONSTRAINTS = {
|
|
134
134
|
video: {
|
|
135
135
|
facingMode: "user",
|
|
@@ -373,7 +373,7 @@ function stopRecording(session) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
//#endregion
|
|
376
|
-
//#region src/selfie/selfieStateMachine.ts
|
|
376
|
+
//#region src/modules/selfie/selfieStateMachine.ts
|
|
377
377
|
const _selfieMachine = setup({
|
|
378
378
|
types: {
|
|
379
379
|
context: {},
|
|
@@ -867,13 +867,13 @@ const _selfieMachine = setup({
|
|
|
867
867
|
const selfieMachine = _selfieMachine;
|
|
868
868
|
|
|
869
869
|
//#endregion
|
|
870
|
-
//#region src/selfie/selfieActor.ts
|
|
870
|
+
//#region src/modules/selfie/selfieActor.ts
|
|
871
871
|
function createSelfieActor(options) {
|
|
872
872
|
return createActor(selfieMachine, { input: { config: options.config } }).start();
|
|
873
873
|
}
|
|
874
874
|
|
|
875
875
|
//#endregion
|
|
876
|
-
//#region src/selfie/selfieManager.ts
|
|
876
|
+
//#region src/modules/selfie/selfieManager.ts
|
|
877
877
|
function getPermissionStatus(snapshot) {
|
|
878
878
|
if (!snapshot.matches("permissions")) return;
|
|
879
879
|
if (snapshot.matches({ permissions: "idle" })) return "idle";
|