@arkyc/types 1.2.11 → 2.1.0
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/access.d.mts +12 -14
- package/dist/access.d.mts.map +1 -1
- package/dist/audit.d.mts +2 -4
- package/dist/audit.d.mts.map +1 -1
- package/dist/common.d.mts +8 -9
- package/dist/common.d.mts.map +1 -1
- package/dist/errors.d.mts +1 -2
- package/dist/errors.d.mts.map +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.mjs +6 -3
- package/dist/notifications.d.mts +41 -0
- package/dist/notifications.d.mts.map +1 -0
- package/dist/notifications.mjs +21 -0
- package/dist/notifications.mjs.map +1 -0
- package/dist/organization.d.mts +9 -8
- package/dist/organization.d.mts.map +1 -1
- package/dist/project.d.mts +22 -14
- package/dist/project.d.mts.map +1 -1
- package/dist/project.mjs +13 -0
- package/dist/project.mjs.map +1 -0
- package/dist/providers.d.mts +17 -18
- package/dist/providers.d.mts.map +1 -1
- package/dist/rbac.d.mts +13 -15
- package/dist/rbac.d.mts.map +1 -1
- package/dist/realtime.d.mts +20 -27
- package/dist/realtime.d.mts.map +1 -1
- package/dist/realtime.mjs +11 -29
- package/dist/realtime.mjs.map +1 -1
- package/dist/review.d.mts +3 -5
- package/dist/review.d.mts.map +1 -1
- package/dist/risk.d.mts +99 -0
- package/dist/risk.d.mts.map +1 -0
- package/dist/risk.mjs +53 -0
- package/dist/risk.mjs.map +1 -0
- package/dist/sdk.d.mts +3 -5
- package/dist/sdk.d.mts.map +1 -1
- package/dist/settings.d.mts +6 -19
- package/dist/settings.d.mts.map +1 -1
- package/dist/settings.mjs +0 -1
- package/dist/settings.mjs.map +1 -1
- package/dist/user.d.mts +2 -4
- package/dist/user.d.mts.map +1 -1
- package/dist/verification.d.mts +6 -8
- package/dist/verification.d.mts.map +1 -1
- package/dist/webhook.d.mts +18 -11
- package/dist/webhook.d.mts.map +1 -1
- package/dist/widget.d.mts +4 -6
- package/dist/widget.d.mts.map +1 -1
- package/dist/workflow.d.mts +30 -22
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +17 -2
- package/dist/workflow.mjs.map +1 -1
- package/package.json +1 -1
package/dist/sdk.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Metadata } from "./common.mjs";
|
|
2
2
|
import { VerificationDecision, VerificationStatus } from "./verification.mjs";
|
|
3
3
|
import { ExtractedData } from "./access.mjs";
|
|
4
|
-
|
|
5
4
|
//#region src/sdk.d.ts
|
|
6
5
|
/** Options for constructing the server SDK client (`new Arkyc(...)`). */
|
|
7
|
-
interface SdkOptions {
|
|
6
|
+
export interface SdkOptions {
|
|
8
7
|
/** Project secret key, e.g. `sk_live_…`. */
|
|
9
8
|
secretKey: string;
|
|
10
9
|
/** API base URL; defaults to the hosted Arkyc API. */
|
|
@@ -13,14 +12,14 @@ interface SdkOptions {
|
|
|
13
12
|
timeoutMs?: number;
|
|
14
13
|
}
|
|
15
14
|
/** Parameters for creating a verification session from a backend. */
|
|
16
|
-
interface CreateSessionParams {
|
|
15
|
+
export interface CreateSessionParams {
|
|
17
16
|
userReference?: string;
|
|
18
17
|
metadata?: Metadata;
|
|
19
18
|
/** Optional override for how long the session/client token stays valid. */
|
|
20
19
|
expiresInSeconds?: number;
|
|
21
20
|
}
|
|
22
21
|
/** The session representation returned by the SDK/public API. */
|
|
23
|
-
interface SessionResource {
|
|
22
|
+
export interface SessionResource {
|
|
24
23
|
id: string;
|
|
25
24
|
status: VerificationStatus;
|
|
26
25
|
user_reference: string | null;
|
|
@@ -33,5 +32,4 @@ interface SessionResource {
|
|
|
33
32
|
created_at: string;
|
|
34
33
|
}
|
|
35
34
|
//#endregion
|
|
36
|
-
export { CreateSessionParams, SdkOptions, SessionResource };
|
|
37
35
|
//# sourceMappingURL=sdk.d.mts.map
|
package/dist/sdk.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.mts","names":[],"sources":["../src/sdk.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sdk.d.mts","names":[],"sources":["../src/sdk.ts"],"mappings":";;;;;iBAKiB;;EAEf;;EAEA;;EAEA;;;iBAIe;EACf;EACA,WAAW;;EAEX;;;iBAIe;EACf;EACA,QAAQ;EACR;EACA,UAAU;;EAEV;;EAEA,YAAY;EACZ;EACA"}
|
package/dist/settings.d.mts
CHANGED
|
@@ -1,36 +1,24 @@
|
|
|
1
1
|
import { Entity } from "./common.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/settings.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Realtime transport for verification events (Phase 16). `pusher` covers both
|
|
6
|
-
* hosted Pusher Channels (default, via a cluster) and self-hosted soketi (opt-in,
|
|
7
|
-
* via a host) — they share the Pusher protocol. `polling` carries no push
|
|
8
|
-
* transport: clients poll the session endpoint instead (a universal fallback that
|
|
9
|
-
* needs no infrastructure). `off` disables live updates entirely.
|
|
10
|
-
*/
|
|
11
|
-
type RealtimeTransport = 'pusher' | 'firebase' | 'polling' | 'off';
|
|
12
3
|
/**
|
|
13
4
|
* Which capture/liveness flow the widget offers (Phase 17). `passive` = the
|
|
14
5
|
* current selfie flow; `active` = guided active-liveness challenges; `both` =
|
|
15
6
|
* offer active, falling back to passive on failure/unsupported devices.
|
|
16
7
|
*/
|
|
17
|
-
type CaptureModel = 'passive' | 'active' | 'both';
|
|
8
|
+
export type CaptureModel = 'passive' | 'active' | 'both';
|
|
18
9
|
/**
|
|
19
10
|
* Platform-wide settings, managed by platform admins on the `/admin` surface and
|
|
20
11
|
* read by the app at runtime. A single typed record (see {@link GlobalSetting}),
|
|
21
12
|
* always merged over {@link DEFAULT_GLOBAL_SETTINGS} so every key is present.
|
|
22
13
|
*/
|
|
23
|
-
interface GlobalSettings {
|
|
14
|
+
export interface GlobalSettings {
|
|
24
15
|
/** Branding/basics for the whole platform. */
|
|
25
16
|
platform: {
|
|
26
17
|
name: string;
|
|
27
|
-
support_email: string | null;
|
|
18
|
+
support_email: string | null;
|
|
19
|
+
/** Whether new organization sign-ups are accepted. */
|
|
28
20
|
signups_enabled: boolean;
|
|
29
21
|
};
|
|
30
|
-
/** Realtime delivery configuration (consumed in Phase 16). */
|
|
31
|
-
realtime: {
|
|
32
|
-
transport: RealtimeTransport;
|
|
33
|
-
};
|
|
34
22
|
/** Default capture/liveness flow offered to widgets (Phase 17). */
|
|
35
23
|
capture: {
|
|
36
24
|
model: CaptureModel;
|
|
@@ -46,11 +34,10 @@ interface GlobalSettings {
|
|
|
46
34
|
};
|
|
47
35
|
}
|
|
48
36
|
/** The persisted singleton row backing {@link GlobalSettings}. */
|
|
49
|
-
interface GlobalSetting extends Entity {
|
|
37
|
+
export interface GlobalSetting extends Entity {
|
|
50
38
|
settings: GlobalSettings;
|
|
51
39
|
}
|
|
52
40
|
/** Defaults applied when a settings key is unset. */
|
|
53
|
-
declare const DEFAULT_GLOBAL_SETTINGS: GlobalSettings;
|
|
41
|
+
export declare const DEFAULT_GLOBAL_SETTINGS: GlobalSettings;
|
|
54
42
|
//#endregion
|
|
55
|
-
export { CaptureModel, DEFAULT_GLOBAL_SETTINGS, GlobalSetting, GlobalSettings, RealtimeTransport };
|
|
56
43
|
//# sourceMappingURL=settings.d.mts.map
|
package/dist/settings.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.mts","names":[],"sources":["../src/settings.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.mts","names":[],"sources":["../src/settings.ts"],"mappings":";;;;;;;YAOY;;;;;;iBAOK;;EAEf;IACE;IACA;;IAEA;;;EAGF;IACE,OAAO;;;EAGT;;;;;;IAME;;;;iBAKa,sBAAsB;EACrC,UAAU;;;qBAIC,yBAAyB"}
|
package/dist/settings.mjs
CHANGED
package/dist/settings.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.mjs","names":[],"sources":["../src/settings.ts"],"sourcesContent":["import type { Entity } from './common'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"settings.mjs","names":[],"sources":["../src/settings.ts"],"sourcesContent":["import type { Entity } from './common'\n\n/**\n * Which capture/liveness flow the widget offers (Phase 17). `passive` = the\n * current selfie flow; `active` = guided active-liveness challenges; `both` =\n * offer active, falling back to passive on failure/unsupported devices.\n */\nexport type CaptureModel = 'passive' | 'active' | 'both'\n\n/**\n * Platform-wide settings, managed by platform admins on the `/admin` surface and\n * read by the app at runtime. A single typed record (see {@link GlobalSetting}),\n * always merged over {@link DEFAULT_GLOBAL_SETTINGS} so every key is present.\n */\nexport interface GlobalSettings {\n /** Branding/basics for the whole platform. */\n platform: {\n name: string\n support_email: string | null\n /** Whether new organization sign-ups are accepted. */\n signups_enabled: boolean\n }\n /** Default capture/liveness flow offered to widgets (Phase 17). */\n capture: {\n model: CaptureModel\n }\n /** Signed session-asset links (captured document/selfie images). */\n assets: {\n /**\n * How long a signed asset URL stays valid, in seconds. The link embeds its\n * own expiry, so a change only affects newly minted URLs; existing links\n * keep their original window. Bounded to [60, 86400] (1 minute to 24 hours).\n */\n url_ttl_seconds: number\n }\n}\n\n/** The persisted singleton row backing {@link GlobalSettings}. */\nexport interface GlobalSetting extends Entity {\n settings: GlobalSettings\n}\n\n/** Defaults applied when a settings key is unset. */\nexport const DEFAULT_GLOBAL_SETTINGS: GlobalSettings = {\n platform: {\n name: 'Arkyc',\n support_email: null,\n signups_enabled: true,\n },\n capture: {\n model: 'passive',\n },\n assets: {\n url_ttl_seconds: 1800,\n },\n}\n"],"mappings":";;AA2CA,MAAa,0BAA0C;CACrD,UAAU;EACR,MAAM;EACN,eAAe;EACf,iBAAiB;CACnB;CACA,SAAS,EACP,OAAO,UACT;CACA,QAAQ,EACN,iBAAiB,KACnB;AACF"}
|
package/dist/user.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Entity, IsoDateTime } from "./common.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/user.d.ts
|
|
4
3
|
/** A platform user account. Users belong to one or more organizations via membership. */
|
|
5
|
-
interface User extends Entity {
|
|
4
|
+
export interface User extends Entity {
|
|
6
5
|
name: string;
|
|
7
6
|
email: string;
|
|
8
7
|
/** Never serialised to clients; present on the DB row only. */
|
|
@@ -11,7 +10,6 @@ interface User extends Entity {
|
|
|
11
10
|
last_login_at: IsoDateTime | null;
|
|
12
11
|
}
|
|
13
12
|
/** A user shape safe to expose to clients (no credential material). */
|
|
14
|
-
type PublicUser = Omit<User, 'password_hash'>;
|
|
13
|
+
export type PublicUser = Omit<User, 'password_hash'>;
|
|
15
14
|
//#endregion
|
|
16
|
-
export { PublicUser, User };
|
|
17
15
|
//# sourceMappingURL=user.d.mts.map
|
package/dist/user.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.mts","names":[],"sources":["../src/user.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.d.mts","names":[],"sources":["../src/user.ts"],"mappings":";;;iBAGiB,aAAa;EAC5B;EACA;;EAEA;EACA;EACA,eAAe;;;YAIL,aAAa,KAAK"}
|
package/dist/verification.d.mts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { Entity, Id, IsoDateTime, Metadata, ProjectScoped } from "./common.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/verification.d.ts
|
|
4
3
|
/** The lifecycle state of a verification session. */
|
|
5
|
-
type VerificationStatus = 'pending' | 'started' | 'document_submitted' | 'address_submitted' | 'liveness_submitted' | 'processing' | 'requires_review' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
4
|
+
export type VerificationStatus = 'pending' | 'started' | 'document_submitted' | 'address_submitted' | 'liveness_submitted' | 'processing' | 'requires_review' | 'approved' | 'rejected' | 'expired' | 'cancelled';
|
|
6
5
|
/** The outcome of the decision engine (or a manual review). */
|
|
7
|
-
type VerificationDecision = 'approved' | 'requires_review' | 'rejected';
|
|
6
|
+
export type VerificationDecision = 'approved' | 'requires_review' | 'rejected';
|
|
8
7
|
/** Whether liveness is checked passively (a selfie) or actively (a challenge video). */
|
|
9
|
-
type LivenessMode = 'passive' | 'active';
|
|
8
|
+
export type LivenessMode = 'passive' | 'active';
|
|
10
9
|
/**
|
|
11
10
|
* A single active-liveness challenge the user is prompted to perform. The server
|
|
12
11
|
* issues a randomized sequence per session; the widget records the user doing
|
|
13
12
|
* them and submits the sequence it performed for the driver to validate.
|
|
14
13
|
*/
|
|
15
|
-
type LivenessChallenge = 'turn_left' | 'turn_right' | 'blink' | 'smile' | 'nod' | 'move_closer';
|
|
14
|
+
export type LivenessChallenge = 'turn_left' | 'turn_right' | 'blink' | 'smile' | 'nod' | 'move_closer';
|
|
16
15
|
/** Why a session reached its decision. */
|
|
17
|
-
type DecisionReason = 'AUTO_APPROVED' | 'LOW_DOCUMENT_QUALITY' | 'OCR_LOW_CONFIDENCE' | 'DOCUMENT_EXPIRED' | 'LIVENESS_FAILED' | 'LIVENESS_LOW_CONFIDENCE' | 'FACE_MATCH_FAILED' | 'FACE_MATCH_LOW_CONFIDENCE' | 'MULTIPLE_FACES_DETECTED' | 'ADDRESS_VERIFICATION_FAILED' | 'ADDRESS_LOW_CONFIDENCE' | 'MANUAL_APPROVAL' | 'MANUAL_REJECTION' | 'RETRY_REQUESTED';
|
|
16
|
+
export type DecisionReason = 'AUTO_APPROVED' | 'LOW_DOCUMENT_QUALITY' | 'OCR_LOW_CONFIDENCE' | 'DOCUMENT_EXPIRED' | 'LIVENESS_FAILED' | 'LIVENESS_LOW_CONFIDENCE' | 'FACE_MATCH_FAILED' | 'FACE_MATCH_LOW_CONFIDENCE' | 'MULTIPLE_FACES_DETECTED' | 'ADDRESS_VERIFICATION_FAILED' | 'ADDRESS_LOW_CONFIDENCE' | 'MANUAL_APPROVAL' | 'MANUAL_REJECTION' | 'RETRY_REQUESTED' | 'DUPLICATE_DOCUMENT' | 'DUPLICATE_IDENTITY' | 'DUPLICATE_FACE' | 'DOCUMENT_TAMPERING' | 'SANCTIONS_MATCH' | 'PEP_MATCH' | 'ADVERSE_MEDIA_MATCH' | 'HIGH_RISK_DEVICE' | 'VELOCITY_EXCEEDED' | 'UNDERAGE';
|
|
18
17
|
/**
|
|
19
18
|
* A verification session: the full lifecycle of one verification flow, owned by
|
|
20
19
|
* a project (and organization). Created from an integrator's backend, driven by the
|
|
21
20
|
* widget, decided automatically and/or by a human reviewer.
|
|
22
21
|
*/
|
|
23
|
-
interface VerificationSession extends Entity, ProjectScoped {
|
|
22
|
+
export interface VerificationSession extends Entity, ProjectScoped {
|
|
24
23
|
/** Integrator's own reference for the end user being verified. */
|
|
25
24
|
user_reference: string | null;
|
|
26
25
|
/** Person's name extracted from the document (OCR), when available. */
|
|
@@ -40,5 +39,4 @@ interface VerificationSession extends Entity, ProjectScoped {
|
|
|
40
39
|
metadata: Metadata;
|
|
41
40
|
}
|
|
42
41
|
//#endregion
|
|
43
|
-
export { DecisionReason, LivenessChallenge, LivenessMode, VerificationDecision, VerificationSession, VerificationStatus };
|
|
44
42
|
//# sourceMappingURL=verification.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.d.mts","names":[],"sources":["../src/verification.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification.d.mts","names":[],"sources":["../src/verification.ts"],"mappings":";;;YAGY;;YAcA;;YAGA;;;;;;YAOA;;YAGA;;;;;;iBA+BK,4BAA4B,QAAQ;;EAEnD;;EAEA;EACA,QAAQ;EACR,eAAe;EACf,gBAAgB;EAChB,iBAAiB;;EAEjB;;EAEA;EACA,YAAY;EACZ,cAAc;EACd,aAAa;EACb,aAAa;EACb,UAAU"}
|
package/dist/webhook.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Entity, Id, IsoDateTime, ProjectScoped } from "./common.mjs";
|
|
2
2
|
import { DecisionReason, VerificationStatus } from "./verification.mjs";
|
|
3
|
-
|
|
3
|
+
import { ScreeningHit, WebhookRiskCheck } from "./risk.mjs";
|
|
4
4
|
//#region src/webhook.d.ts
|
|
5
5
|
/** The set of webhook event names Arkyc can deliver. */
|
|
6
|
-
type WebhookEventName = 'verification.started' | 'verification.document_submitted' | 'verification.address_submitted' | 'verification.processing' | 'verification.requires_review' | 'verification.approved' | 'verification.rejected' | 'verification.completed' | 'verification.expired' | 'verification.cancelled';
|
|
6
|
+
export type WebhookEventName = 'verification.started' | 'verification.document_submitted' | 'verification.address_submitted' | 'verification.processing' | 'verification.requires_review' | 'verification.approved' | 'verification.rejected' | 'verification.completed' | 'verification.expired' | 'verification.cancelled' | 'verification.screening_alert';
|
|
7
7
|
/** Per-check summary included in a webhook payload. */
|
|
8
|
-
interface WebhookChecks {
|
|
8
|
+
export interface WebhookChecks {
|
|
9
9
|
document?: {
|
|
10
10
|
quality_score: number;
|
|
11
11
|
ocr_confidence: number;
|
|
12
|
-
expired: boolean;
|
|
12
|
+
expired: boolean;
|
|
13
|
+
/** Which parser produced the OCR fields: the MRZ, a custom parser, or the generic scraper. */
|
|
13
14
|
ocr_parse_stage?: 'mrz' | 'custom' | 'generic';
|
|
14
15
|
};
|
|
15
16
|
liveness?: {
|
|
@@ -22,12 +23,19 @@ interface WebhookChecks {
|
|
|
22
23
|
};
|
|
23
24
|
address?: {
|
|
24
25
|
passed: boolean;
|
|
25
|
-
score: number;
|
|
26
|
+
score: number;
|
|
27
|
+
/** Which corroboration methods ran. */
|
|
26
28
|
methods: string[];
|
|
27
29
|
};
|
|
30
|
+
/** Risk signals raised against the session and the aggregate score. */
|
|
31
|
+
risk?: WebhookRiskCheck;
|
|
32
|
+
/** Watchlist screening, when the workflow runs it. */
|
|
33
|
+
screening?: {
|
|
34
|
+
hits: ScreeningHit[];
|
|
35
|
+
};
|
|
28
36
|
}
|
|
29
37
|
/** The JSON body delivered to a webhook endpoint. */
|
|
30
|
-
interface WebhookEvent {
|
|
38
|
+
export interface WebhookEvent {
|
|
31
39
|
event: WebhookEventName;
|
|
32
40
|
session_id: Id;
|
|
33
41
|
organization_id: Id;
|
|
@@ -41,9 +49,9 @@ interface WebhookEvent {
|
|
|
41
49
|
created_at: IsoDateTime;
|
|
42
50
|
}
|
|
43
51
|
/** Webhook endpoint lifecycle status. */
|
|
44
|
-
type WebhookEndpointStatus = 'active' | 'disabled';
|
|
52
|
+
export type WebhookEndpointStatus = 'active' | 'disabled';
|
|
45
53
|
/** A configured webhook endpoint for a project. */
|
|
46
|
-
interface WebhookEndpoint extends Entity, ProjectScoped {
|
|
54
|
+
export interface WebhookEndpoint extends Entity, ProjectScoped {
|
|
47
55
|
url: string;
|
|
48
56
|
/** Hash of the signing secret; the raw secret is shown once at creation. */
|
|
49
57
|
secret_hash: string;
|
|
@@ -51,9 +59,9 @@ interface WebhookEndpoint extends Entity, ProjectScoped {
|
|
|
51
59
|
status: WebhookEndpointStatus;
|
|
52
60
|
}
|
|
53
61
|
/** Delivery attempt state for a webhook. */
|
|
54
|
-
type WebhookDeliveryStatus = 'pending' | 'delivered' | 'failed';
|
|
62
|
+
export type WebhookDeliveryStatus = 'pending' | 'delivered' | 'failed';
|
|
55
63
|
/** A record of a webhook delivery (and its retries). */
|
|
56
|
-
interface WebhookDelivery extends Entity, ProjectScoped {
|
|
64
|
+
export interface WebhookDelivery extends Entity, ProjectScoped {
|
|
57
65
|
webhook_endpoint_id: Id;
|
|
58
66
|
event: WebhookEventName;
|
|
59
67
|
payload: WebhookEvent;
|
|
@@ -64,5 +72,4 @@ interface WebhookDelivery extends Entity, ProjectScoped {
|
|
|
64
72
|
next_retry_at: IsoDateTime | null;
|
|
65
73
|
}
|
|
66
74
|
//#endregion
|
|
67
|
-
export { WebhookChecks, WebhookDelivery, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointStatus, WebhookEvent, WebhookEventName };
|
|
68
75
|
//# sourceMappingURL=webhook.d.mts.map
|
package/dist/webhook.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.mts","names":[],"sources":["../src/webhook.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"webhook.d.mts","names":[],"sources":["../src/webhook.ts"],"mappings":";;;;;YAKY;;iBAcK;EACf;IACE;IACA;IACA;;IAEA;;EAEF;IACE;IACA;;EAEF;IACE;IACA;;EAEF;IACE;IACA;;IAEA;;;EAGF,OAAO;;EAEP;IACE,MAAM;;;;iBAKO;EACf,OAAO;EACP,YAAY;EACZ,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR,QAAQ;EACR,iBAAiB;;EAEjB,QAAQ;EACR,YAAY;;;YAIF;;iBAGK,wBAAwB,QAAQ;EAC/C;;EAEA;EACA,QAAQ;EACR,QAAQ;;;YAIE;;iBAGK,wBAAwB,QAAQ;EAC/C,qBAAqB;EACrB,OAAO;EACP,SAAS;EACT,QAAQ;EACR;EACA;EACA;EACA,eAAe"}
|
package/dist/widget.d.mts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { VerificationDecision, VerificationStatus } from "./verification.mjs";
|
|
2
2
|
import { ProjectBranding } from "./project.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/widget.d.ts
|
|
5
4
|
/** How the widget mounts into the host page. */
|
|
6
|
-
type WidgetMode = 'overlay' | 'inline' | 'hosted';
|
|
5
|
+
export type WidgetMode = 'overlay' | 'inline' | 'hosted';
|
|
7
6
|
/** The screens of the widget verification flow, in order. */
|
|
8
|
-
type WidgetStep = 'welcome' | 'document_selection' | 'front_capture' | 'back_capture' | 'ocr_processing' | 'address_entry' | 'address_processing' | 'active_liveness' | 'selfie_capture' | 'passive_liveness' | 'face_match' | 'processing' | 'result';
|
|
7
|
+
export type WidgetStep = 'welcome' | 'document_selection' | 'front_capture' | 'back_capture' | 'ocr_processing' | 'address_entry' | 'address_processing' | 'active_liveness' | 'selfie_capture' | 'passive_liveness' | 'face_match' | 'processing' | 'result';
|
|
9
8
|
/** The result handed to the widget's `onComplete` callback. */
|
|
10
|
-
interface WidgetResult {
|
|
9
|
+
export interface WidgetResult {
|
|
11
10
|
status: VerificationStatus;
|
|
12
11
|
decision: VerificationDecision | null;
|
|
13
12
|
}
|
|
14
13
|
/** Options for launching/mounting the embeddable widget. */
|
|
15
|
-
interface WidgetOptions {
|
|
14
|
+
export interface WidgetOptions {
|
|
16
15
|
/** Short-lived client token minted by the backend for this session. */
|
|
17
16
|
token: string;
|
|
18
17
|
mode?: WidgetMode;
|
|
@@ -25,5 +24,4 @@ interface WidgetOptions {
|
|
|
25
24
|
onClose?: () => void;
|
|
26
25
|
}
|
|
27
26
|
//#endregion
|
|
28
|
-
export { WidgetMode, WidgetOptions, WidgetResult, WidgetStep };
|
|
29
27
|
//# sourceMappingURL=widget.d.mts.map
|
package/dist/widget.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.mts","names":[],"sources":["../src/widget.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"widget.d.mts","names":[],"sources":["../src/widget.ts"],"mappings":";;;;YAIY;;YAGA;;iBAgBK;EACf,QAAQ;EACR,UAAU;;;iBAIK;;EAEf;EACA,OAAO;;EAEP,qBAAqB;EACrB,WAAW;EACX;EACA,cAAc,QAAQ;EACtB,WAAW,OAAO;EAClB"}
|
package/dist/workflow.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Id, IsoDateTime } from "./common.mjs";
|
|
2
|
-
|
|
2
|
+
import { RiskPolicyConfig, ScreeningStepConfig } from "./risk.mjs";
|
|
3
3
|
//#region src/workflow.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Workflows (Phase 19).
|
|
@@ -12,27 +12,27 @@ import { Id, IsoDateTime } from "./common.mjs";
|
|
|
12
12
|
* disturbs sessions already in flight.
|
|
13
13
|
*/
|
|
14
14
|
/** A coarse verification stage a workflow can order and toggle. */
|
|
15
|
-
type WorkflowStepKey = 'document' | 'address' | 'liveness' | 'face_match';
|
|
15
|
+
export type WorkflowStepKey = 'document' | 'screening' | 'address' | 'liveness' | 'face_match';
|
|
16
16
|
/**
|
|
17
17
|
* The default pipeline's stages, in canonical order — what runs when a session
|
|
18
18
|
* has no workflow. `address` is deliberately NOT here: it's an opt-in stage,
|
|
19
19
|
* available only on custom workflows.
|
|
20
20
|
*/
|
|
21
|
-
declare const WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[];
|
|
21
|
+
export declare const WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[];
|
|
22
22
|
/**
|
|
23
23
|
* Every stage a custom workflow may include, in canonical order. Used by the
|
|
24
24
|
* workflow editor and to validate/normalise stored steps — a superset of
|
|
25
|
-
* {@link WORKFLOW_STEP_KEYS} that adds the opt-in `address`
|
|
25
|
+
* {@link WORKFLOW_STEP_KEYS} that adds the opt-in `screening` and `address` stages.
|
|
26
26
|
*/
|
|
27
|
-
declare const AVAILABLE_WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[];
|
|
27
|
+
export declare const AVAILABLE_WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[];
|
|
28
28
|
/** A method the address stage uses to corroborate the user's address. */
|
|
29
|
-
type AddressMethod = 'poa_document' | 'device_location' | 'geocode_lookup';
|
|
29
|
+
export type AddressMethod = 'poa_document' | 'device_location' | 'geocode_lookup';
|
|
30
30
|
/** Every selectable address-verification method, in display order. */
|
|
31
|
-
declare const ADDRESS_METHODS: readonly AddressMethod[];
|
|
31
|
+
export declare const ADDRESS_METHODS: readonly AddressMethod[];
|
|
32
32
|
/** What a failed/low-confidence address result does to the session. */
|
|
33
|
-
type AddressOnFail = 'review' | 'reject';
|
|
33
|
+
export type AddressOnFail = 'review' | 'reject';
|
|
34
34
|
/** Configuration for the `address` stage, carried on its {@link WorkflowStep}. */
|
|
35
|
-
interface AddressStepConfig {
|
|
35
|
+
export interface AddressStepConfig {
|
|
36
36
|
/** Methods to run; at least one when the stage is enabled. */
|
|
37
37
|
methods: AddressMethod[];
|
|
38
38
|
/**
|
|
@@ -48,30 +48,34 @@ interface AddressStepConfig {
|
|
|
48
48
|
auto_approve_threshold?: number;
|
|
49
49
|
}
|
|
50
50
|
/** The default address config applied when the stage is enabled without one. */
|
|
51
|
-
declare const DEFAULT_ADDRESS_CONFIG: AddressStepConfig;
|
|
51
|
+
export declare const DEFAULT_ADDRESS_CONFIG: AddressStepConfig;
|
|
52
52
|
/** One stage within a workflow, in pipeline order, on or off. */
|
|
53
|
-
interface WorkflowStep {
|
|
53
|
+
export interface WorkflowStep {
|
|
54
54
|
key: WorkflowStepKey;
|
|
55
55
|
enabled: boolean;
|
|
56
|
-
/** Stage-specific configuration
|
|
57
|
-
config?: AddressStepConfig;
|
|
56
|
+
/** Stage-specific configuration, used by the `address` and `screening` stages. */
|
|
57
|
+
config?: AddressStepConfig | ScreeningStepConfig;
|
|
58
58
|
}
|
|
59
59
|
/** Workflow-wide toggles. */
|
|
60
|
-
interface WorkflowOptions {
|
|
60
|
+
export interface WorkflowOptions {
|
|
61
61
|
/**
|
|
62
62
|
* Skip OCR parsing — capture the document image but don't extract fields.
|
|
63
63
|
* Useful when Arkyc is only used for data capture and the assets are handed
|
|
64
64
|
* to a third party. Disables the document portrait too, so face match can't run.
|
|
65
65
|
*/
|
|
66
66
|
skip_ocr: boolean;
|
|
67
|
+
/** Minimum age in years, from the extracted date of birth (`UNDERAGE`). */
|
|
68
|
+
min_age?: number;
|
|
69
|
+
/** How each risk signal affects the decision. Unlisted signals route to review. */
|
|
70
|
+
risk_policy?: RiskPolicyConfig;
|
|
67
71
|
}
|
|
68
72
|
/** The portable config of a workflow: ordered stages + options. */
|
|
69
|
-
interface WorkflowConfig {
|
|
73
|
+
export interface WorkflowConfig {
|
|
70
74
|
steps: WorkflowStep[];
|
|
71
75
|
options: WorkflowOptions;
|
|
72
76
|
}
|
|
73
77
|
/** A saved, organization-scoped workflow. */
|
|
74
|
-
interface Workflow extends WorkflowConfig {
|
|
78
|
+
export interface Workflow extends WorkflowConfig {
|
|
75
79
|
id: Id;
|
|
76
80
|
organization_id: Id;
|
|
77
81
|
name: string;
|
|
@@ -79,22 +83,26 @@ interface Workflow extends WorkflowConfig {
|
|
|
79
83
|
updated_at: IsoDateTime;
|
|
80
84
|
}
|
|
81
85
|
/** The default pipeline applied when a session has no workflow. */
|
|
82
|
-
declare const DEFAULT_WORKFLOW_CONFIG: WorkflowConfig;
|
|
86
|
+
export declare const DEFAULT_WORKFLOW_CONFIG: WorkflowConfig;
|
|
83
87
|
/**
|
|
84
88
|
* Whether a stage runs under a config. A `null` config means "no workflow" — the
|
|
85
89
|
* default pipeline, where every stage runs. Within a real config, a stage that is
|
|
86
90
|
* absent or `enabled: false` does not run.
|
|
87
91
|
*/
|
|
88
|
-
declare function workflowEnables(config: WorkflowConfig | null | undefined, key: WorkflowStepKey): boolean;
|
|
92
|
+
export declare function workflowEnables(config: WorkflowConfig | null | undefined, key: WorkflowStepKey): boolean;
|
|
89
93
|
/**
|
|
90
94
|
* The resolved address config for a session's workflow, or `null` when the
|
|
91
95
|
* address stage isn't enabled. Missing fields fall back to {@link DEFAULT_ADDRESS_CONFIG}.
|
|
92
96
|
*/
|
|
93
|
-
declare function workflowAddressConfig(config: WorkflowConfig | null | undefined): AddressStepConfig | null;
|
|
97
|
+
export declare function workflowAddressConfig(config: WorkflowConfig | null | undefined): AddressStepConfig | null;
|
|
98
|
+
/**
|
|
99
|
+
* The resolved screening config for a session's workflow, or `null` when the
|
|
100
|
+
* screening stage isn't enabled. Screening needs OCR fields to screen.
|
|
101
|
+
*/
|
|
102
|
+
export declare function workflowScreeningConfig(config: WorkflowConfig | null | undefined): ScreeningStepConfig | null;
|
|
94
103
|
/** Whether OCR parsing should run: the document stage is on and `skip_ocr` is off. */
|
|
95
|
-
declare function workflowRunsOcr(config: WorkflowConfig | null | undefined): boolean;
|
|
104
|
+
export declare function workflowRunsOcr(config: WorkflowConfig | null | undefined): boolean;
|
|
96
105
|
/** The enabled stages in pipeline order (used by the widget to sequence its steps). */
|
|
97
|
-
declare function workflowEnabledSteps(config: WorkflowConfig | null | undefined): WorkflowStepKey[];
|
|
106
|
+
export declare function workflowEnabledSteps(config: WorkflowConfig | null | undefined): WorkflowStepKey[];
|
|
98
107
|
//#endregion
|
|
99
|
-
export { ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, AddressMethod, AddressOnFail, AddressStepConfig, DEFAULT_ADDRESS_CONFIG, DEFAULT_WORKFLOW_CONFIG, WORKFLOW_STEP_KEYS, Workflow, WorkflowConfig, WorkflowOptions, WorkflowStep, WorkflowStepKey, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr };
|
|
100
108
|
//# sourceMappingURL=workflow.d.mts.map
|
package/dist/workflow.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.mts","names":[],"sources":["../src/workflow.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow.d.mts","names":[],"sources":["../src/workflow.ts"],"mappings":";;;;;;;;;;;;;;YAeY;;;;;;qBAOC,6BAA6B;;;;;;qBAO7B,uCAAuC;;YASxC;;qBAGC,0BAA0B;;YAG3B;;iBAGK;;EAEf,SAAS;;;;;EAKT,SAAS;;;;;;EAMT;;;qBAIW,wBAAwB;;iBAMpB;EACf,KAAK;EACL;;EAEA,SAAS,oBAAoB;;;iBAId;;;;;;EAMf;;EAEA;;EAEA,cAAc;;;iBAIC;EACf,OAAO;EACP,SAAS;;;iBAIM,iBAAiB;EAChC,IAAI;EACJ,iBAAiB;EACjB;EACA,YAAY;EACZ,YAAY;;;qBAID,yBAAyB;;;;;;wBActB,gBAAgB,QAAQ,mCAAmC,KAAK;;;;;wBAYhE,sBAAsB,QAAQ,oCAAoC;;;;;wBAYlE,wBAAwB,QAAQ,oCAAoC;;wBASpE,gBAAgB,QAAQ;;wBAOxB,qBAAqB,QAAQ,oCAAoC"}
|
package/dist/workflow.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_SCREENING_CONFIG } from "./risk.mjs";
|
|
1
2
|
//#region src/workflow.ts
|
|
2
3
|
/**
|
|
3
4
|
* The default pipeline's stages, in canonical order — what runs when a session
|
|
@@ -12,10 +13,11 @@ const WORKFLOW_STEP_KEYS = [
|
|
|
12
13
|
/**
|
|
13
14
|
* Every stage a custom workflow may include, in canonical order. Used by the
|
|
14
15
|
* workflow editor and to validate/normalise stored steps — a superset of
|
|
15
|
-
* {@link WORKFLOW_STEP_KEYS} that adds the opt-in `address`
|
|
16
|
+
* {@link WORKFLOW_STEP_KEYS} that adds the opt-in `screening` and `address` stages.
|
|
16
17
|
*/
|
|
17
18
|
const AVAILABLE_WORKFLOW_STEP_KEYS = [
|
|
18
19
|
"document",
|
|
20
|
+
"screening",
|
|
19
21
|
"address",
|
|
20
22
|
"liveness",
|
|
21
23
|
"face_match"
|
|
@@ -71,6 +73,19 @@ function workflowAddressConfig(config) {
|
|
|
71
73
|
...step.config ?? {}
|
|
72
74
|
};
|
|
73
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The resolved screening config for a session's workflow, or `null` when the
|
|
78
|
+
* screening stage isn't enabled. Screening needs OCR fields to screen.
|
|
79
|
+
*/
|
|
80
|
+
function workflowScreeningConfig(config) {
|
|
81
|
+
if (!config || !workflowRunsOcr(config)) return null;
|
|
82
|
+
const step = config.steps.find((s) => s.key === "screening" && s.enabled);
|
|
83
|
+
if (!step) return null;
|
|
84
|
+
return {
|
|
85
|
+
...DEFAULT_SCREENING_CONFIG,
|
|
86
|
+
...step.config ?? {}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
74
89
|
/** Whether OCR parsing should run: the document stage is on and `skip_ocr` is off. */
|
|
75
90
|
function workflowRunsOcr(config) {
|
|
76
91
|
if (!config) return true;
|
|
@@ -82,6 +97,6 @@ function workflowEnabledSteps(config) {
|
|
|
82
97
|
return config.steps.filter((step) => step.enabled).map((step) => step.key);
|
|
83
98
|
}
|
|
84
99
|
//#endregion
|
|
85
|
-
export { ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_WORKFLOW_CONFIG, WORKFLOW_STEP_KEYS, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr };
|
|
100
|
+
export { ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_WORKFLOW_CONFIG, WORKFLOW_STEP_KEYS, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr, workflowScreeningConfig };
|
|
86
101
|
|
|
87
102
|
//# sourceMappingURL=workflow.mjs.map
|
package/dist/workflow.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.mjs","names":[],"sources":["../src/workflow.ts"],"sourcesContent":["import type { Id, IsoDateTime } from './common'\n\n/**\n * Workflows (Phase 19).\n *\n * An organization-scoped, reusable recipe that determines the order of the\n * coarse verification stages, lets each be turned off, and can skip OCR parsing\n * (capture-only). Workflows are optional: a session created without one runs the\n * default pipeline (document → liveness → face match, OCR on). A workflow's\n * config is snapshotted onto each session at creation, so editing it never\n * disturbs sessions already in flight.\n */\n\n/** A coarse verification stage a workflow can order and toggle. */\nexport type WorkflowStepKey = 'document' | 'address' | 'liveness' | 'face_match'\n\n/**\n * The default pipeline's stages, in canonical order — what runs when a session\n * has no workflow. `address` is deliberately NOT here: it's an opt-in stage,\n * available only on custom workflows.\n */\nexport const WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[] = ['document', 'liveness', 'face_match']\n\n/**\n * Every stage a custom workflow may include, in canonical order. Used by the\n * workflow editor and to validate/normalise stored steps — a superset of\n * {@link WORKFLOW_STEP_KEYS} that adds the opt-in `address`
|
|
1
|
+
{"version":3,"file":"workflow.mjs","names":[],"sources":["../src/workflow.ts"],"sourcesContent":["import type { Id, IsoDateTime } from './common'\nimport { DEFAULT_SCREENING_CONFIG, type RiskPolicyConfig, type ScreeningStepConfig } from './risk'\n\n/**\n * Workflows (Phase 19).\n *\n * An organization-scoped, reusable recipe that determines the order of the\n * coarse verification stages, lets each be turned off, and can skip OCR parsing\n * (capture-only). Workflows are optional: a session created without one runs the\n * default pipeline (document → liveness → face match, OCR on). A workflow's\n * config is snapshotted onto each session at creation, so editing it never\n * disturbs sessions already in flight.\n */\n\n/** A coarse verification stage a workflow can order and toggle. */\nexport type WorkflowStepKey = 'document' | 'screening' | 'address' | 'liveness' | 'face_match'\n\n/**\n * The default pipeline's stages, in canonical order — what runs when a session\n * has no workflow. `address` is deliberately NOT here: it's an opt-in stage,\n * available only on custom workflows.\n */\nexport const WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[] = ['document', 'liveness', 'face_match']\n\n/**\n * Every stage a custom workflow may include, in canonical order. Used by the\n * workflow editor and to validate/normalise stored steps — a superset of\n * {@link WORKFLOW_STEP_KEYS} that adds the opt-in `screening` and `address` stages.\n */\nexport const AVAILABLE_WORKFLOW_STEP_KEYS: readonly WorkflowStepKey[] = [\n 'document',\n 'screening',\n 'address',\n 'liveness',\n 'face_match',\n]\n\n/** A method the address stage uses to corroborate the user's address. */\nexport type AddressMethod = 'poa_document' | 'device_location' | 'geocode_lookup'\n\n/** Every selectable address-verification method, in display order. */\nexport const ADDRESS_METHODS: readonly AddressMethod[] = ['poa_document', 'device_location', 'geocode_lookup']\n\n/** What a failed/low-confidence address result does to the session. */\nexport type AddressOnFail = 'review' | 'reject'\n\n/** Configuration for the `address` stage, carried on its {@link WorkflowStep}. */\nexport interface AddressStepConfig {\n /** Methods to run; at least one when the stage is enabled. */\n methods: AddressMethod[]\n /**\n * What a failed or low-confidence result does. `review` (default) flags the\n * session for a human; `reject` fails it outright.\n */\n on_fail: AddressOnFail\n /**\n * Minimum address-verification confidence in [0, 1] to auto-verify the address.\n * A passed address scoring below this is routed to manual review (the gate is\n * never a rejection). Omitted falls back to the project `addressThreshold`.\n */\n auto_approve_threshold?: number\n}\n\n/** The default address config applied when the stage is enabled without one. */\nexport const DEFAULT_ADDRESS_CONFIG: AddressStepConfig = {\n methods: ['geocode_lookup'],\n on_fail: 'review',\n}\n\n/** One stage within a workflow, in pipeline order, on or off. */\nexport interface WorkflowStep {\n key: WorkflowStepKey\n enabled: boolean\n /** Stage-specific configuration, used by the `address` and `screening` stages. */\n config?: AddressStepConfig | ScreeningStepConfig\n}\n\n/** Workflow-wide toggles. */\nexport interface WorkflowOptions {\n /**\n * Skip OCR parsing — capture the document image but don't extract fields.\n * Useful when Arkyc is only used for data capture and the assets are handed\n * to a third party. Disables the document portrait too, so face match can't run.\n */\n skip_ocr: boolean\n /** Minimum age in years, from the extracted date of birth (`UNDERAGE`). */\n min_age?: number\n /** How each risk signal affects the decision. Unlisted signals route to review. */\n risk_policy?: RiskPolicyConfig\n}\n\n/** The portable config of a workflow: ordered stages + options. */\nexport interface WorkflowConfig {\n steps: WorkflowStep[]\n options: WorkflowOptions\n}\n\n/** A saved, organization-scoped workflow. */\nexport interface Workflow extends WorkflowConfig {\n id: Id\n organization_id: Id\n name: string\n created_at: IsoDateTime\n updated_at: IsoDateTime\n}\n\n/** The default pipeline applied when a session has no workflow. */\nexport const DEFAULT_WORKFLOW_CONFIG: WorkflowConfig = {\n steps: [\n { key: 'document', enabled: true },\n { key: 'liveness', enabled: true },\n { key: 'face_match', enabled: true },\n ],\n options: { skip_ocr: false },\n}\n\n/**\n * Whether a stage runs under a config. A `null` config means \"no workflow\" — the\n * default pipeline, where every stage runs. Within a real config, a stage that is\n * absent or `enabled: false` does not run.\n */\nexport function workflowEnables(config: WorkflowConfig | null | undefined, key: WorkflowStepKey): boolean {\n // No workflow runs the default pipeline only — opt-in stages (`screening`, `address`) are\n // off unless a custom workflow turns them on.\n if (!config) return WORKFLOW_STEP_KEYS.includes(key)\n\n return config.steps.some((step) => step.key === key && step.enabled)\n}\n\n/**\n * The resolved address config for a session's workflow, or `null` when the\n * address stage isn't enabled. Missing fields fall back to {@link DEFAULT_ADDRESS_CONFIG}.\n */\nexport function workflowAddressConfig(config: WorkflowConfig | null | undefined): AddressStepConfig | null {\n if (!config) return null\n const step = config.steps.find((s) => s.key === 'address' && s.enabled)\n if (!step) return null\n\n return { ...DEFAULT_ADDRESS_CONFIG, ...((step.config as AddressStepConfig | undefined) ?? {}) }\n}\n\n/**\n * The resolved screening config for a session's workflow, or `null` when the\n * screening stage isn't enabled. Screening needs OCR fields to screen.\n */\nexport function workflowScreeningConfig(config: WorkflowConfig | null | undefined): ScreeningStepConfig | null {\n if (!config || !workflowRunsOcr(config)) return null\n const step = config.steps.find((s) => s.key === 'screening' && s.enabled)\n if (!step) return null\n\n return { ...DEFAULT_SCREENING_CONFIG, ...((step.config as ScreeningStepConfig | undefined) ?? {}) }\n}\n\n/** Whether OCR parsing should run: the document stage is on and `skip_ocr` is off. */\nexport function workflowRunsOcr(config: WorkflowConfig | null | undefined): boolean {\n if (!config) return true\n\n return workflowEnables(config, 'document') && !config.options.skip_ocr\n}\n\n/** The enabled stages in pipeline order (used by the widget to sequence its steps). */\nexport function workflowEnabledSteps(config: WorkflowConfig | null | undefined): WorkflowStepKey[] {\n if (!config) return [...WORKFLOW_STEP_KEYS]\n\n return config.steps.filter((step) => step.enabled).map((step) => step.key)\n}\n"],"mappings":";;;;;;;AAsBA,MAAa,qBAAiD;CAAC;CAAY;CAAY;AAAY;;;;;;AAOnG,MAAa,+BAA2D;CACtE;CACA;CACA;CACA;CACA;AACF;;AAMA,MAAa,kBAA4C;CAAC;CAAgB;CAAmB;AAAgB;;AAuB7G,MAAa,yBAA4C;CACvD,SAAS,CAAC,gBAAgB;CAC1B,SAAS;AACX;;AAwCA,MAAa,0BAA0C;CACrD,OAAO;EACL;GAAE,KAAK;GAAY,SAAS;EAAK;EACjC;GAAE,KAAK;GAAY,SAAS;EAAK;EACjC;GAAE,KAAK;GAAc,SAAS;EAAK;CACrC;CACA,SAAS,EAAE,UAAU,MAAM;AAC7B;;;;;;AAOA,SAAgB,gBAAgB,QAA2C,KAA+B;CAGxG,IAAI,CAAC,QAAQ,OAAO,mBAAmB,SAAS,GAAG;CAEnD,OAAO,OAAO,MAAM,MAAM,SAAS,KAAK,QAAQ,OAAO,KAAK,OAAO;AACrE;;;;;AAMA,SAAgB,sBAAsB,QAAqE;CACzG,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,OAAO,OAAO,MAAM,MAAM,MAAM,EAAE,QAAQ,aAAa,EAAE,OAAO;CACtE,IAAI,CAAC,MAAM,OAAO;CAElB,OAAO;EAAE,GAAG;EAAwB,GAAK,KAAK,UAA4C,CAAC;CAAG;AAChG;;;;;AAMA,SAAgB,wBAAwB,QAAuE;CAC7G,IAAI,CAAC,UAAU,CAAC,gBAAgB,MAAM,GAAG,OAAO;CAChD,MAAM,OAAO,OAAO,MAAM,MAAM,MAAM,EAAE,QAAQ,eAAe,EAAE,OAAO;CACxE,IAAI,CAAC,MAAM,OAAO;CAElB,OAAO;EAAE,GAAG;EAA0B,GAAK,KAAK,UAA8C,CAAC;CAAG;AACpG;;AAGA,SAAgB,gBAAgB,QAAoD;CAClF,IAAI,CAAC,QAAQ,OAAO;CAEpB,OAAO,gBAAgB,QAAQ,UAAU,KAAK,CAAC,OAAO,QAAQ;AAChE;;AAGA,SAAgB,qBAAqB,QAA8D;CACjG,IAAI,CAAC,QAAQ,OAAO,CAAC,GAAG,kBAAkB;CAE1C,OAAO,OAAO,MAAM,QAAQ,SAAS,KAAK,OAAO,CAAC,CAAC,KAAK,SAAS,KAAK,GAAG;AAC3E"}
|