@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.
Files changed (53) hide show
  1. package/dist/access.d.mts +12 -14
  2. package/dist/access.d.mts.map +1 -1
  3. package/dist/audit.d.mts +2 -4
  4. package/dist/audit.d.mts.map +1 -1
  5. package/dist/common.d.mts +8 -9
  6. package/dist/common.d.mts.map +1 -1
  7. package/dist/errors.d.mts +1 -2
  8. package/dist/errors.d.mts.map +1 -1
  9. package/dist/index.d.mts +8 -6
  10. package/dist/index.mjs +6 -3
  11. package/dist/notifications.d.mts +41 -0
  12. package/dist/notifications.d.mts.map +1 -0
  13. package/dist/notifications.mjs +21 -0
  14. package/dist/notifications.mjs.map +1 -0
  15. package/dist/organization.d.mts +9 -8
  16. package/dist/organization.d.mts.map +1 -1
  17. package/dist/project.d.mts +22 -14
  18. package/dist/project.d.mts.map +1 -1
  19. package/dist/project.mjs +13 -0
  20. package/dist/project.mjs.map +1 -0
  21. package/dist/providers.d.mts +17 -18
  22. package/dist/providers.d.mts.map +1 -1
  23. package/dist/rbac.d.mts +13 -15
  24. package/dist/rbac.d.mts.map +1 -1
  25. package/dist/realtime.d.mts +20 -27
  26. package/dist/realtime.d.mts.map +1 -1
  27. package/dist/realtime.mjs +11 -29
  28. package/dist/realtime.mjs.map +1 -1
  29. package/dist/review.d.mts +3 -5
  30. package/dist/review.d.mts.map +1 -1
  31. package/dist/risk.d.mts +99 -0
  32. package/dist/risk.d.mts.map +1 -0
  33. package/dist/risk.mjs +53 -0
  34. package/dist/risk.mjs.map +1 -0
  35. package/dist/sdk.d.mts +3 -5
  36. package/dist/sdk.d.mts.map +1 -1
  37. package/dist/settings.d.mts +6 -19
  38. package/dist/settings.d.mts.map +1 -1
  39. package/dist/settings.mjs +0 -1
  40. package/dist/settings.mjs.map +1 -1
  41. package/dist/user.d.mts +2 -4
  42. package/dist/user.d.mts.map +1 -1
  43. package/dist/verification.d.mts +6 -8
  44. package/dist/verification.d.mts.map +1 -1
  45. package/dist/webhook.d.mts +18 -11
  46. package/dist/webhook.d.mts.map +1 -1
  47. package/dist/widget.d.mts +4 -6
  48. package/dist/widget.d.mts.map +1 -1
  49. package/dist/workflow.d.mts +30 -22
  50. package/dist/workflow.d.mts.map +1 -1
  51. package/dist/workflow.mjs +17 -2
  52. package/dist/workflow.mjs.map +1 -1
  53. package/package.json +1 -1
package/dist/access.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Entity, Id, ProjectScoped } from "./common.mjs";
2
-
3
2
  //#region src/access.d.ts
4
3
  /**
5
4
  * A gated project capability. Extended access generalizes what used to be the
@@ -8,27 +7,27 @@ import { Entity, Id, ProjectScoped } from "./common.mjs";
8
7
  * runtime. New gated (and, later, paywalled) features are added here plus a row
9
8
  * in {@link ACCESS_CAPABILITIES}, not a new subsystem.
10
9
  */
11
- type AccessCapability = 'ai' | 'pii';
10
+ export type AccessCapability = 'ai' | 'pii';
12
11
  /**
13
12
  * The lifecycle of a capability grant. `none` is synthetic (no row yet) and only
14
13
  * appears in API/UI responses; it is never persisted.
15
14
  */
16
- type AccessGrantStatus = 'none' | 'pending' | 'granted' | 'revoked';
15
+ export type AccessGrantStatus = 'none' | 'pending' | 'granted' | 'revoked';
17
16
  /** Categories of personal data a project may request access to (PII capability). */
18
- type PiiCategory = 'identity' | 'address';
17
+ export type PiiCategory = 'identity' | 'address';
19
18
  /** When a project needs the PII: before the session is decided, or only after. */
20
- type PiiTiming = 'before' | 'after';
19
+ export type PiiTiming = 'before' | 'after';
21
20
  /**
22
21
  * Capability-specific request detail. Only meaningful for `pii`: what data the
23
22
  * project needs, when, and their justification for being able to protect it.
24
23
  */
25
- interface AccessGrantDetails {
24
+ export interface AccessGrantDetails {
26
25
  categories?: PiiCategory[];
27
26
  timing?: PiiTiming;
28
27
  justification?: string | null;
29
28
  }
30
29
  /** A per-`(project, capability)` entitlement with a request/review lifecycle. */
31
- interface AccessGrant extends Entity, ProjectScoped {
30
+ export interface AccessGrant extends Entity, ProjectScoped {
32
31
  capability: AccessCapability;
33
32
  status: AccessGrantStatus;
34
33
  details: AccessGrantDetails | null;
@@ -39,7 +38,7 @@ interface AccessGrant extends Entity, ProjectScoped {
39
38
  reviewed_at: string | null;
40
39
  }
41
40
  /** Registry metadata for one capability. */
42
- interface AccessCapabilityMeta {
41
+ export interface AccessCapabilityMeta {
43
42
  key: AccessCapability;
44
43
  label: string;
45
44
  /** Whether projects can self-request it (vs admin-only grant). */
@@ -52,13 +51,13 @@ interface AccessCapabilityMeta {
52
51
  * Enforcement and UIs iterate this rather than hard-coding capability names.
53
52
  * (Room is left here for future `plan`/`billable` metadata behind a paywall.)
54
53
  */
55
- declare const ACCESS_CAPABILITIES: Record<AccessCapability, AccessCapabilityMeta>;
54
+ export declare const ACCESS_CAPABILITIES: Record<AccessCapability, AccessCapabilityMeta>;
56
55
  /** All capability keys, in display order. */
57
- declare const ACCESS_CAPABILITY_KEYS: AccessCapability[];
56
+ export declare const ACCESS_CAPABILITY_KEYS: AccessCapability[];
58
57
  /**
59
58
  * Identity fields extracted from the document (the `identity` PII category).
60
59
  */
61
- interface ExtractedIdentity {
60
+ export interface ExtractedIdentity {
62
61
  first_name: string | null;
63
62
  last_name: string | null;
64
63
  full_name: string | null;
@@ -70,7 +69,7 @@ interface ExtractedIdentity {
70
69
  /**
71
70
  * Residential address fields (the `address` PII category).
72
71
  */
73
- interface ExtractedAddress {
72
+ export interface ExtractedAddress {
74
73
  line1: string | null;
75
74
  line2: string | null;
76
75
  city: string | null;
@@ -86,10 +85,9 @@ interface ExtractedAddress {
86
85
  * (for `after` timing) only once the session is decided. Absent entirely when
87
86
  * the project has no granted PII entitlement.
88
87
  */
89
- interface ExtractedData {
88
+ export interface ExtractedData {
90
89
  identity?: ExtractedIdentity;
91
90
  address?: ExtractedAddress;
92
91
  }
93
92
  //#endregion
94
- export { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, AccessCapability, AccessCapabilityMeta, AccessGrant, AccessGrantDetails, AccessGrantStatus, ExtractedAddress, ExtractedData, ExtractedIdentity, PiiCategory, PiiTiming };
95
93
  //# sourceMappingURL=access.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"access.d.mts","names":[],"sources":["../src/access.ts"],"mappings":";;;;;AASA;;;;AAA4B;KAAhB,gBAAA;;;;AAMiB;KAAjB,iBAAA;;KAGA,WAAA;;KAGA,SAAA;AAAZ;;;;AAAA,UAMiB,kBAAA;EACf,UAAA,GAAa,WAAA;EACb,MAAA,GAAS,SAAS;EAClB,aAAA;AAAA;;UAIe,WAAA,SAAoB,MAAA,EAAQ,aAAA;EAC3C,UAAA,EAAY,gBAAA;EACZ,MAAA,EAAQ,iBAAA;EACR,OAAA,EAAS,kBAAA;EACT,IAAA;EACA,YAAA,EAAc,EAAA;EACd,YAAA;EACA,WAAA,EAAa,EAAA;EACb,WAAA;AAAA;;UAIe,oBAAA;EACf,GAAA,EAAK,gBAAgB;EACrB,KAAA;EAdmC;EAgBnC,WAAA;EAhBwD;EAkBxD,eAAA;AAAA;;;;;;cAQW,mBAAA,EAAqB,MAAA,CAAO,gBAAA,EAAkB,oBAAA;;cAM9C,sBAAA,EAAwB,gBAAgB;;;;UAKpC,iBAAA;EACf,UAAA;EACA,SAAA;EACA,SAAA;EACA,aAAA;EACA,eAAA;EACA,WAAA;EACA,WAAA;AAAA;;;;UAMe,gBAAA;EACf,KAAA;EACA,KAAA;EACA,IAAA;EACA,MAAA;EACA,WAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AAAA;;;;;;;UASe,aAAA;EACf,QAAA,GAAW,iBAAA;EACX,OAAA,GAAU,gBAAgB;AAAA"}
1
+ {"version":3,"file":"access.d.mts","names":[],"sources":["../src/access.ts"],"mappings":";;;;;;;;;YASY;;;;;YAMA;;YAGA;;YAGA;;;;;iBAMK;EACf,aAAa;EACb,SAAS;EACT;;;iBAIe,oBAAoB,QAAQ;EAC3C,YAAY;EACZ,QAAQ;EACR,SAAS;EACT;EACA,cAAc;EACd;EACA,aAAa;EACb;;;iBAIe;EACf,KAAK;EACL;;EAEA;;EAEA;;;;;;;qBAQW,qBAAqB,OAAO,kBAAkB;;qBAM9C,wBAAwB;;;;iBAKpB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;iBAMe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;iBASe;EACf,WAAW;EACX,UAAU"}
package/dist/audit.d.mts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { Id, IsoDateTime, Metadata } from "./common.mjs";
2
-
3
2
  //#region src/audit.d.ts
4
3
  /** Who performed an audited action. */
5
- type ActorType = 'user' | 'api_key' | 'system';
4
+ export type ActorType = 'user' | 'api_key' | 'system';
6
5
  /**
7
6
  * An immutable audit log entry. Project scope is optional (some actions are
8
7
  * organization-level only). Audit rows are append-only and carry no `updated_at`.
9
8
  */
10
- interface AuditLog {
9
+ export interface AuditLog {
11
10
  id: Id;
12
11
  organization_id: Id;
13
12
  project_id: Id | null;
@@ -23,5 +22,4 @@ interface AuditLog {
23
22
  created_at: IsoDateTime;
24
23
  }
25
24
  //#endregion
26
- export { ActorType, AuditLog };
27
25
  //# sourceMappingURL=audit.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.mts","names":[],"sources":["../src/audit.ts"],"mappings":";;;;KAGY,SAAA;AAAZ;;;;AAAA,UAMiB,QAAA;EACf,EAAA,EAAI,EAAA;EACJ,eAAA,EAAiB,EAAA;EACjB,UAAA,EAAY,EAAA;EACZ,QAAA,EAAU,EAAA;EACV,UAAA,EAAY,SAAA;EAFA;EAIZ,MAAA;EACA,WAAA;EACA,SAAA,EAAW,EAAA;EACX,QAAA,EAAU,QAAA;EACV,UAAA;EACA,UAAA;EACA,UAAA,EAAY,WAAA;AAAA"}
1
+ {"version":3,"file":"audit.d.mts","names":[],"sources":["../src/audit.ts"],"mappings":";;;YAGY;;;;;iBAMK;EACf,IAAI;EACJ,iBAAiB;EACjB,YAAY;EACZ,UAAU;EACV,YAAY;;EAEZ;EACA;EACA,WAAW;EACX,UAAU;EACV;EACA;EACA,YAAY"}
package/dist/common.d.mts CHANGED
@@ -7,30 +7,29 @@
7
7
  * `kyc_sess_…`, `organization_…`, `project_…`); timestamps are ISO-8601 strings.
8
8
  */
9
9
  /** A unique identifier (typically a prefixed, URL-safe string). */
10
- type Id = string;
10
+ export type Id = string;
11
11
  /** An ISO-8601 date-time string, e.g. `2026-06-20T00:00:00.000Z`. */
12
- type IsoDateTime = string;
12
+ export type IsoDateTime = string;
13
13
  /** An ISO-8601 date string (no time component), e.g. `1990-05-21`. */
14
- type IsoDate = string;
14
+ export type IsoDate = string;
15
15
  /** Arbitrary, JSON-serialisable metadata attached to an entity. */
16
- type Metadata = Record<string, unknown>;
16
+ export type Metadata = Record<string, unknown>;
17
17
  /** Columns shared by every persisted entity. */
18
- interface Timestamps {
18
+ export interface Timestamps {
19
19
  created_at: IsoDateTime;
20
20
  updated_at: IsoDateTime;
21
21
  }
22
22
  /** A persisted entity: an `id` plus creation/update timestamps. */
23
- interface Entity extends Timestamps {
23
+ export interface Entity extends Timestamps {
24
24
  id: Id;
25
25
  }
26
26
  /** Scoping columns present on every organization-owned entity. */
27
- interface OrganizationScoped {
27
+ export interface OrganizationScoped {
28
28
  organization_id: Id;
29
29
  }
30
30
  /** Scoping columns present on every project-owned entity. */
31
- interface ProjectScoped extends OrganizationScoped {
31
+ export interface ProjectScoped extends OrganizationScoped {
32
32
  project_id: Id;
33
33
  }
34
34
  //#endregion
35
- export { Entity, Id, IsoDate, IsoDateTime, Metadata, OrganizationScoped, ProjectScoped, Timestamps };
36
35
  //# sourceMappingURL=common.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.mts","names":[],"sources":["../src/common.ts"],"mappings":";;AASA;;;;AAAc;AAGd;;KAHY,EAAA;;KAGA,WAAA;AAGZ;AAAA,KAAY,OAAA;;KAGA,QAAA,GAAW,MAAM;AAHV;AAAA,UAMF,UAAA;EACf,UAAA,EAAY,WAAA;EACZ,UAAA,EAAY,WAAW;AAAA;AALI;AAAA,UASZ,MAAA,SAAe,UAAU;EACxC,EAAA,EAAI,EAAA;AAAA;;UAIW,kBAAA;EACf,eAAA,EAAiB,EAAE;AAAA;;UAIJ,aAAA,SAAsB,kBAAkB;EACvD,UAAA,EAAY,EAAA;AAAA"}
1
+ {"version":3,"file":"common.d.mts","names":[],"sources":["../src/common.ts"],"mappings":";;;;;;;;;YASY;;YAGA;;YAGA;;YAGA,WAAW;;iBAGN;EACf,YAAY;EACZ,YAAY;;;iBAIG,eAAe;EAC9B,IAAI;;;iBAIW;EACf,iBAAiB;;;iBAIF,sBAAsB;EACrC,YAAY"}
package/dist/errors.d.mts CHANGED
@@ -10,7 +10,6 @@
10
10
  * The typed clients surface this as `ArkycApiError.error` (`@arkyc/sdk`) and
11
11
  * `WidgetApiError.error` (`@arkyc/widget`).
12
12
  */
13
- type ApiErrorKey = 'missing_client_token' | 'invalid_client_token' | 'session_expired' | 'missing_api_key' | 'invalid_api_key' | 'invalid_workflow' | 'invalid_webhook';
13
+ export type ApiErrorKey = 'missing_client_token' | 'invalid_client_token' | 'session_expired' | 'origin_not_allowed' | 'client_token_used' | 'handoff_disabled' | 'missing_api_key' | 'invalid_api_key' | 'invalid_workflow' | 'invalid_webhook';
14
14
  //#endregion
15
- export { ApiErrorKey };
16
15
  //# sourceMappingURL=errors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;AAWA;;;;AAAuB;;;;;;KAAX,WAAA"}
1
+ {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;;;;;;;YAWY"}
package/dist/index.d.mts CHANGED
@@ -1,12 +1,14 @@
1
1
  import { Entity, Id, IsoDate, IsoDateTime, Metadata, OrganizationScoped, ProjectScoped, Timestamps } from "./common.mjs";
2
2
  import { PublicUser, User } from "./user.mjs";
3
+ import { DecisionReason, LivenessChallenge, LivenessMode, VerificationDecision, VerificationSession, VerificationStatus } from "./verification.mjs";
4
+ import { DEFAULT_FACE_EMBEDDING_SETTINGS, DEFAULT_RISK_SIGNAL_POLICY, DEFAULT_SCREENING_CONFIG, DEFAULT_VELOCITY_SETTINGS, FaceEmbeddingSettings, REVIEW_ONLY_RISK_SIGNALS, RISK_SIGNAL_KEYS, RISK_SIGNAL_REASONS, RiskPolicyConfig, RiskSeverity, RiskSignal, RiskSignalKey, RiskSignalPolicy, ScreeningHit, ScreeningHitCategory, ScreeningOnHit, ScreeningStepConfig, SessionRiskSignal, VelocitySettings, WebhookRiskCheck } from "./risk.mjs";
3
5
  import { InvitationStatus, MembershipStatus, Organization, OrganizationInvitation, OrganizationMember, OrganizationSettings } from "./organization.mjs";
4
6
  import { AdminPermission, AdminPermissionGroup, AdminPermissionKey, AdminRoleSlug, AnyPermissionGroup, AnyPermissionKey, Permission, PermissionGroup, PermissionKey, Role, RolePermission, SystemRoleSlug, UserPermission } from "./rbac.mjs";
5
- import { CaptureModel, DEFAULT_GLOBAL_SETTINGS, GlobalSetting, GlobalSettings, RealtimeTransport } from "./settings.mjs";
6
- import { DecisionReason, LivenessChallenge, LivenessMode, VerificationDecision, VerificationSession, VerificationStatus } from "./verification.mjs";
7
- import { REALTIME_EVENT, RealtimeEventName, ReviewActionEvent, SessionTransitionEvent, parseRealtimeChannel, realtimeChannels } from "./realtime.mjs";
8
- import { ApiKey, ApiKeyWithSecret, Project, ProjectBranding, ProjectContext, ProjectEnvironment, ProjectHandoffSettings, ProjectMember, ProjectSettings, ProjectStatus, VerificationThresholds } from "./project.mjs";
9
- import { 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 } from "./workflow.mjs";
7
+ import { CaptureModel, DEFAULT_GLOBAL_SETTINGS, GlobalSetting, GlobalSettings } from "./settings.mjs";
8
+ import { REALTIME_EVENT, RealtimeEventName, ReviewActionEvent, SessionTransitionEvent, realtimeChannels } from "./realtime.mjs";
9
+ import { DEFAULT_NOTIFICATION_PREFERENCES, NOTIFICATION_TYPE, NotificationPreferences, NotificationType, PushPlatform, UserNotification } from "./notifications.mjs";
10
+ import { ApiKey, ApiKeyWithSecret, DEFAULT_VERIFICATION_THRESHOLDS, Project, ProjectBranding, ProjectContext, ProjectEnvironment, ProjectHandoffSettings, ProjectMember, ProjectSettings, ProjectStatus, VerificationThresholds } from "./project.mjs";
11
+ import { 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, workflowScreeningConfig } from "./workflow.mjs";
10
12
  import { AddressMethodResult, AddressResultData, AddressVerification, DocumentCapture, DocumentPortrait, DocumentType, FaceMatchCheck, FaceMatchResultData, LivenessCheck, LivenessResultData, OcrAuthenticity, OcrFields, OcrResult, OcrResultData, PostalAddress, SpoofSignals } from "./providers.mjs";
11
13
  import { Review, ReviewAction, ReviewNote } from "./review.mjs";
12
14
  import { WebhookChecks, WebhookDelivery, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointStatus, WebhookEvent, WebhookEventName } from "./webhook.mjs";
@@ -15,4 +17,4 @@ import { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, AccessCapability, AccessCa
15
17
  import { CreateSessionParams, SdkOptions, SessionResource } from "./sdk.mjs";
16
18
  import { WidgetMode, WidgetOptions, WidgetResult, WidgetStep } from "./widget.mjs";
17
19
  import { ApiErrorKey } from "./errors.mjs";
18
- export { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, AccessCapability, AccessCapabilityMeta, AccessGrant, AccessGrantDetails, AccessGrantStatus, ActorType, AddressMethod, AddressMethodResult, AddressOnFail, AddressResultData, AddressStepConfig, AddressVerification, AdminPermission, AdminPermissionGroup, AdminPermissionKey, AdminRoleSlug, AnyPermissionGroup, AnyPermissionKey, ApiErrorKey, ApiKey, ApiKeyWithSecret, AuditLog, CaptureModel, CreateSessionParams, DEFAULT_ADDRESS_CONFIG, DEFAULT_GLOBAL_SETTINGS, DEFAULT_WORKFLOW_CONFIG, DecisionReason, DocumentCapture, DocumentPortrait, DocumentType, Entity, ExtractedAddress, ExtractedData, ExtractedIdentity, FaceMatchCheck, FaceMatchResultData, GlobalSetting, GlobalSettings, Id, InvitationStatus, IsoDate, IsoDateTime, LivenessChallenge, LivenessCheck, LivenessMode, LivenessResultData, MembershipStatus, Metadata, OcrAuthenticity, OcrFields, OcrResult, OcrResultData, Organization, OrganizationInvitation, OrganizationMember, OrganizationScoped, OrganizationSettings, Permission, PermissionGroup, PermissionKey, PiiCategory, PiiTiming, PostalAddress, Project, ProjectBranding, ProjectContext, ProjectEnvironment, ProjectHandoffSettings, ProjectMember, ProjectScoped, ProjectSettings, ProjectStatus, PublicUser, REALTIME_EVENT, RealtimeEventName, RealtimeTransport, Review, ReviewAction, ReviewActionEvent, ReviewNote, Role, RolePermission, SdkOptions, SessionResource, SessionTransitionEvent, SpoofSignals, SystemRoleSlug, Timestamps, User, UserPermission, VerificationDecision, VerificationSession, VerificationStatus, VerificationThresholds, WORKFLOW_STEP_KEYS, WebhookChecks, WebhookDelivery, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointStatus, WebhookEvent, WebhookEventName, WidgetMode, WidgetOptions, WidgetResult, WidgetStep, Workflow, WorkflowConfig, WorkflowOptions, WorkflowStep, WorkflowStepKey, parseRealtimeChannel, realtimeChannels, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr };
20
+ export { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, AccessCapability, AccessCapabilityMeta, AccessGrant, AccessGrantDetails, AccessGrantStatus, ActorType, AddressMethod, AddressMethodResult, AddressOnFail, AddressResultData, AddressStepConfig, AddressVerification, AdminPermission, AdminPermissionGroup, AdminPermissionKey, AdminRoleSlug, AnyPermissionGroup, AnyPermissionKey, ApiErrorKey, ApiKey, ApiKeyWithSecret, AuditLog, CaptureModel, CreateSessionParams, DEFAULT_ADDRESS_CONFIG, DEFAULT_FACE_EMBEDDING_SETTINGS, DEFAULT_GLOBAL_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_RISK_SIGNAL_POLICY, DEFAULT_SCREENING_CONFIG, DEFAULT_VELOCITY_SETTINGS, DEFAULT_VERIFICATION_THRESHOLDS, DEFAULT_WORKFLOW_CONFIG, DecisionReason, DocumentCapture, DocumentPortrait, DocumentType, Entity, ExtractedAddress, ExtractedData, ExtractedIdentity, FaceEmbeddingSettings, FaceMatchCheck, FaceMatchResultData, GlobalSetting, GlobalSettings, Id, InvitationStatus, IsoDate, IsoDateTime, LivenessChallenge, LivenessCheck, LivenessMode, LivenessResultData, MembershipStatus, Metadata, NOTIFICATION_TYPE, NotificationPreferences, NotificationType, OcrAuthenticity, OcrFields, OcrResult, OcrResultData, Organization, OrganizationInvitation, OrganizationMember, OrganizationScoped, OrganizationSettings, Permission, PermissionGroup, PermissionKey, PiiCategory, PiiTiming, PostalAddress, Project, ProjectBranding, ProjectContext, ProjectEnvironment, ProjectHandoffSettings, ProjectMember, ProjectScoped, ProjectSettings, ProjectStatus, PublicUser, PushPlatform, REALTIME_EVENT, REVIEW_ONLY_RISK_SIGNALS, RISK_SIGNAL_KEYS, RISK_SIGNAL_REASONS, RealtimeEventName, Review, ReviewAction, ReviewActionEvent, ReviewNote, RiskPolicyConfig, RiskSeverity, RiskSignal, RiskSignalKey, RiskSignalPolicy, Role, RolePermission, ScreeningHit, ScreeningHitCategory, ScreeningOnHit, ScreeningStepConfig, SdkOptions, SessionResource, SessionRiskSignal, SessionTransitionEvent, SpoofSignals, SystemRoleSlug, Timestamps, User, UserNotification, UserPermission, VelocitySettings, VerificationDecision, VerificationSession, VerificationStatus, VerificationThresholds, WORKFLOW_STEP_KEYS, WebhookChecks, WebhookDelivery, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointStatus, WebhookEvent, WebhookEventName, WebhookRiskCheck, WidgetMode, WidgetOptions, WidgetResult, WidgetStep, Workflow, WorkflowConfig, WorkflowOptions, WorkflowStep, WorkflowStepKey, realtimeChannels, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr, workflowScreeningConfig };
package/dist/index.mjs CHANGED
@@ -1,5 +1,8 @@
1
1
  import { DEFAULT_GLOBAL_SETTINGS } from "./settings.mjs";
2
- import { REALTIME_EVENT, parseRealtimeChannel, realtimeChannels } from "./realtime.mjs";
3
- import { ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_WORKFLOW_CONFIG, WORKFLOW_STEP_KEYS, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr } from "./workflow.mjs";
2
+ import { REALTIME_EVENT, realtimeChannels } from "./realtime.mjs";
3
+ import { DEFAULT_NOTIFICATION_PREFERENCES, NOTIFICATION_TYPE } from "./notifications.mjs";
4
+ import { DEFAULT_VERIFICATION_THRESHOLDS } from "./project.mjs";
5
+ import { DEFAULT_FACE_EMBEDDING_SETTINGS, DEFAULT_RISK_SIGNAL_POLICY, DEFAULT_SCREENING_CONFIG, DEFAULT_VELOCITY_SETTINGS, REVIEW_ONLY_RISK_SIGNALS, RISK_SIGNAL_KEYS, RISK_SIGNAL_REASONS } from "./risk.mjs";
6
+ import { ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_WORKFLOW_CONFIG, WORKFLOW_STEP_KEYS, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr, workflowScreeningConfig } from "./workflow.mjs";
4
7
  import { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS } from "./access.mjs";
5
- export { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_GLOBAL_SETTINGS, DEFAULT_WORKFLOW_CONFIG, REALTIME_EVENT, WORKFLOW_STEP_KEYS, parseRealtimeChannel, realtimeChannels, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr };
8
+ export { ACCESS_CAPABILITIES, ACCESS_CAPABILITY_KEYS, ADDRESS_METHODS, AVAILABLE_WORKFLOW_STEP_KEYS, DEFAULT_ADDRESS_CONFIG, DEFAULT_FACE_EMBEDDING_SETTINGS, DEFAULT_GLOBAL_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_RISK_SIGNAL_POLICY, DEFAULT_SCREENING_CONFIG, DEFAULT_VELOCITY_SETTINGS, DEFAULT_VERIFICATION_THRESHOLDS, DEFAULT_WORKFLOW_CONFIG, NOTIFICATION_TYPE, REALTIME_EVENT, REVIEW_ONLY_RISK_SIGNALS, RISK_SIGNAL_KEYS, RISK_SIGNAL_REASONS, WORKFLOW_STEP_KEYS, realtimeChannels, workflowAddressConfig, workflowEnabledSteps, workflowEnables, workflowRunsOcr, workflowScreeningConfig };
@@ -0,0 +1,41 @@
1
+ import { Id } from "./common.mjs";
2
+ //#region src/notifications.d.ts
3
+ /** Kinds of in-app notification a user can receive. */
4
+ export declare const NOTIFICATION_TYPE: {
5
+ /** A verification session was assigned to you for review. */
6
+ readonly reviewAssigned: "review.assigned";
7
+ /** A verification session in a project you review needs a manual decision. */
8
+ readonly sessionNeedsReview: "session.requires_review";
9
+ /** Someone else approved or rejected a session assigned to you. */
10
+ readonly reviewDecided: "review.decided";
11
+ /** A webhook endpoint you maintain exhausted its delivery retries. */
12
+ readonly webhookFailing: "webhook.failing";
13
+ /** You were invited to join an organization. */
14
+ readonly invitationReceived: "invitation.received";
15
+ /** Watchlist screening matched a session in a project you review. */
16
+ readonly screeningHit: "screening.hit";
17
+ };
18
+ export type NotificationType = (typeof NOTIFICATION_TYPE)[keyof typeof NOTIFICATION_TYPE];
19
+ /** A user's notification delivery preferences. */
20
+ export interface NotificationPreferences {
21
+ /** Also push notifications to the user's registered devices. */
22
+ push: boolean;
23
+ }
24
+ export declare const DEFAULT_NOTIFICATION_PREFERENCES: NotificationPreferences;
25
+ /** Platforms a device push token can be registered for. */
26
+ export type PushPlatform = 'ios' | 'android' | 'web';
27
+ /** A stored in-app notification, as the API returns it. */
28
+ export interface UserNotification {
29
+ id: Id;
30
+ type: NotificationType | string | null;
31
+ title: string;
32
+ description: string;
33
+ action_text: string | null;
34
+ /** A dashboard path, e.g. `/o/acme/sessions/<id>`. */
35
+ action_link: string | null;
36
+ meta: Record<string, unknown> | null;
37
+ read_at: string | null;
38
+ created_at: string;
39
+ }
40
+ //#endregion
41
+ //# sourceMappingURL=notifications.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.mts","names":[],"sources":["../src/notifications.ts"],"mappings":";;;qBAGa;;;;;;;;;;;;;;YAeD,2BAA2B,gCAAgC;;iBAGtD;;EAEf;;qBAGW,kCAAkC;;YAKnC;;iBAGK;EACf,IAAI;EACJ,MAAM;EACN;EACA;EACA;;EAEA;EACA,MAAM;EACN;EACA"}
@@ -0,0 +1,21 @@
1
+ //#region src/notifications.ts
2
+ /** Kinds of in-app notification a user can receive. */
3
+ const NOTIFICATION_TYPE = {
4
+ /** A verification session was assigned to you for review. */
5
+ reviewAssigned: "review.assigned",
6
+ /** A verification session in a project you review needs a manual decision. */
7
+ sessionNeedsReview: "session.requires_review",
8
+ /** Someone else approved or rejected a session assigned to you. */
9
+ reviewDecided: "review.decided",
10
+ /** A webhook endpoint you maintain exhausted its delivery retries. */
11
+ webhookFailing: "webhook.failing",
12
+ /** You were invited to join an organization. */
13
+ invitationReceived: "invitation.received",
14
+ /** Watchlist screening matched a session in a project you review. */
15
+ screeningHit: "screening.hit"
16
+ };
17
+ const DEFAULT_NOTIFICATION_PREFERENCES = { push: true };
18
+ //#endregion
19
+ export { DEFAULT_NOTIFICATION_PREFERENCES, NOTIFICATION_TYPE };
20
+
21
+ //# sourceMappingURL=notifications.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.mjs","names":[],"sources":["../src/notifications.ts"],"sourcesContent":["import type { Id } from './common'\n\n/** Kinds of in-app notification a user can receive. */\nexport const NOTIFICATION_TYPE = {\n /** A verification session was assigned to you for review. */\n reviewAssigned: 'review.assigned',\n /** A verification session in a project you review needs a manual decision. */\n sessionNeedsReview: 'session.requires_review',\n /** Someone else approved or rejected a session assigned to you. */\n reviewDecided: 'review.decided',\n /** A webhook endpoint you maintain exhausted its delivery retries. */\n webhookFailing: 'webhook.failing',\n /** You were invited to join an organization. */\n invitationReceived: 'invitation.received',\n /** Watchlist screening matched a session in a project you review. */\n screeningHit: 'screening.hit',\n} as const\n\nexport type NotificationType = (typeof NOTIFICATION_TYPE)[keyof typeof NOTIFICATION_TYPE]\n\n/** A user's notification delivery preferences. */\nexport interface NotificationPreferences {\n /** Also push notifications to the user's registered devices. */\n push: boolean\n}\n\nexport const DEFAULT_NOTIFICATION_PREFERENCES: NotificationPreferences = {\n push: true,\n}\n\n/** Platforms a device push token can be registered for. */\nexport type PushPlatform = 'ios' | 'android' | 'web'\n\n/** A stored in-app notification, as the API returns it. */\nexport interface UserNotification {\n id: Id\n type: NotificationType | string | null\n title: string\n description: string\n action_text: string | null\n /** A dashboard path, e.g. `/o/acme/sessions/<id>`. */\n action_link: string | null\n meta: Record<string, unknown> | null\n read_at: string | null\n created_at: string\n}\n"],"mappings":";;AAGA,MAAa,oBAAoB;;CAE/B,gBAAgB;;CAEhB,oBAAoB;;CAEpB,eAAe;;CAEf,gBAAgB;;CAEhB,oBAAoB;;CAEpB,cAAc;AAChB;AAUA,MAAa,mCAA4D,EACvE,MAAM,KACR"}
@@ -1,34 +1,36 @@
1
1
  import { Entity, Id, IsoDateTime, Metadata, OrganizationScoped } from "./common.mjs";
2
-
2
+ import { FaceEmbeddingSettings } from "./risk.mjs";
3
3
  //#region src/organization.d.ts
4
4
  /** Membership lifecycle states for organization/project members. */
5
- type MembershipStatus = 'active' | 'invited' | 'suspended';
5
+ export type MembershipStatus = 'active' | 'invited' | 'suspended';
6
6
  /** Invitation lifecycle states. */
7
- type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked';
7
+ export type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked';
8
8
  /**
9
9
  * An organization, business, or workspace using Arkyc. An organization owns projects,
10
10
  * members, roles, API keys, sessions, webhooks, and audit logs.
11
11
  */
12
- interface Organization extends Entity {
12
+ export interface Organization extends Entity {
13
13
  name: string;
14
14
  slug: string;
15
15
  logo_url: string | null;
16
16
  settings: OrganizationSettings;
17
17
  }
18
18
  /** Organization-level configuration (free-form, with known optional keys). */
19
- interface OrganizationSettings extends Metadata {
19
+ export interface OrganizationSettings extends Metadata {
20
20
  /** Days to retain verification media before cleanup (Phase 15). */
21
21
  retention_days?: number;
22
+ /** Store face embeddings to catch one face behind several identities. Off by default. */
23
+ face_embeddings?: Partial<FaceEmbeddingSettings>;
22
24
  }
23
25
  /** Links a {@link User} to a {@link Organization} with a role. */
24
- interface OrganizationMember extends Entity, OrganizationScoped {
26
+ export interface OrganizationMember extends Entity, OrganizationScoped {
25
27
  user_id: Id;
26
28
  role_id: Id;
27
29
  status: MembershipStatus;
28
30
  joined_at: IsoDateTime | null;
29
31
  }
30
32
  /** A pending invitation to join an organization with a given role. */
31
- interface OrganizationInvitation extends Entity, OrganizationScoped {
33
+ export interface OrganizationInvitation extends Entity, OrganizationScoped {
32
34
  email: string;
33
35
  role_id: Id;
34
36
  /** Hash of the single-use invitation token; the raw token is emailed once. */
@@ -37,5 +39,4 @@ interface OrganizationInvitation extends Entity, OrganizationScoped {
37
39
  accepted_at: IsoDateTime | null;
38
40
  }
39
41
  //#endregion
40
- export { InvitationStatus, MembershipStatus, Organization, OrganizationInvitation, OrganizationMember, OrganizationSettings };
41
42
  //# sourceMappingURL=organization.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"organization.d.mts","names":[],"sources":["../src/organization.ts"],"mappings":";;;;KAGY,gBAAA;AAAZ;AAAA,KAGY,gBAAA;;;AAHgB;AAG5B;UAMiB,YAAA,SAAqB,MAAM;EAC1C,IAAA;EACA,IAAA;EACA,QAAA;EACA,QAAA,EAAU,oBAAA;AAAA;;UAIK,oBAAA,SAA6B,QAAQ;EARhB;EAUpC,cAAc;AAAA;;UAIC,kBAAA,SAA2B,MAAA,EAAQ,kBAAA;EAClD,OAAA,EAAS,EAAA;EACT,OAAA,EAAS,EAAA;EACT,MAAA,EAAQ,gBAAA;EACR,SAAA,EAAW,WAAA;AAAA;;UAII,sBAAA,SAA+B,MAAA,EAAQ,kBAAA;EACtD,KAAA;EACA,OAAA,EAAS,EAAA;EAVyB;EAYlC,UAAA;EACA,UAAA,EAAY,WAAA;EACZ,WAAA,EAAa,WAAA;AAAA"}
1
+ {"version":3,"file":"organization.d.mts","names":[],"sources":["../src/organization.ts"],"mappings":";;;;YAIY;;YAGA;;;;;iBAMK,qBAAqB;EACpC;EACA;EACA;EACA,UAAU;;;iBAIK,6BAA6B;;EAE5C;;EAEA,kBAAkB,QAAQ;;;iBAIX,2BAA2B,QAAQ;EAClD,SAAS;EACT,SAAS;EACT,QAAQ;EACR,WAAW;;;iBAII,+BAA+B,QAAQ;EACtD;EACA,SAAS;;EAET;EACA,YAAY;EACZ,aAAa"}
@@ -1,17 +1,17 @@
1
1
  import { Entity, Id, IsoDateTime, Metadata, OrganizationScoped, ProjectScoped } from "./common.mjs";
2
+ import { VelocitySettings } from "./risk.mjs";
2
3
  import { MembershipStatus } from "./organization.mjs";
3
4
  import { CaptureModel } from "./settings.mjs";
4
-
5
5
  //#region src/project.d.ts
6
6
  /** Deployment environment for a project. */
7
- type ProjectEnvironment = 'production' | 'staging' | 'development';
7
+ export type ProjectEnvironment = 'production' | 'staging' | 'development';
8
8
  /** Project lifecycle status. */
9
- type ProjectStatus = 'active' | 'paused' | 'archived';
9
+ export type ProjectStatus = 'active' | 'paused' | 'archived';
10
10
  /**
11
11
  * Per-project, configurable thresholds the decision engine compares scores
12
- * against. Defaults live in `@arkyc/core`; projects may override any subset.
12
+ * against. Projects may override any subset of {@link DEFAULT_VERIFICATION_THRESHOLDS}.
13
13
  */
14
- interface VerificationThresholds {
14
+ export interface VerificationThresholds {
15
15
  documentQualityThreshold: number;
16
16
  ocrConfidenceThreshold: number;
17
17
  livenessThreshold: number;
@@ -19,9 +19,16 @@ interface VerificationThresholds {
19
19
  /** Minimum address-verification confidence before flagging for review. */
20
20
  addressThreshold: number;
21
21
  }
22
+ /** Platform default verification thresholds. */
23
+ export declare const DEFAULT_VERIFICATION_THRESHOLDS: VerificationThresholds;
22
24
  /** Visual branding applied to the widget for a project. */
23
- interface ProjectBranding {
25
+ export interface ProjectBranding {
24
26
  logo_url?: string | null;
27
+ /**
28
+ * Storage object key of an uploaded logo. Server-side only: the API resolves
29
+ * it to a (signed, when the disk is private) `logo_url` in every response.
30
+ */
31
+ logo_key?: string | null;
25
32
  primary_color?: string;
26
33
  border_radius?: number;
27
34
  theme?: 'light' | 'dark';
@@ -38,7 +45,7 @@ interface ProjectBranding {
38
45
  * their phone by scanning a QR code.
39
46
  * The QR is shown first on desktop.
40
47
  */
41
- interface ProjectHandoffSettings {
48
+ export interface ProjectHandoffSettings {
42
49
  /** Whether desktop users are offered the QR handoff to their phone. */
43
50
  enabled?: boolean;
44
51
  /**
@@ -48,7 +55,7 @@ interface ProjectHandoffSettings {
48
55
  allow_desktop?: boolean;
49
56
  }
50
57
  /** Project-level configuration. */
51
- interface ProjectSettings extends Metadata {
58
+ export interface ProjectSettings extends Metadata {
52
59
  thresholds?: Partial<VerificationThresholds>;
53
60
  allowed_origins?: string[];
54
61
  /** Maximum verification attempts before a session is hard-failed. */
@@ -57,12 +64,14 @@ interface ProjectSettings extends Metadata {
57
64
  capture_model?: CaptureModel;
58
65
  /** Cross-device session handoff (QR). Off unless the project opts in. */
59
66
  handoff?: ProjectHandoffSettings;
67
+ /** Repeat-session limits per network address (`VELOCITY_EXCEEDED`). */
68
+ velocity?: Partial<VelocitySettings>;
60
69
  }
61
70
  /**
62
71
  * A specific application, environment, or product integration owned by a
63
72
  * organization. Sessions, API keys, and webhooks are scoped to a project.
64
73
  */
65
- interface Project extends Entity, OrganizationScoped {
74
+ export interface Project extends Entity, OrganizationScoped {
66
75
  name: string;
67
76
  slug: string;
68
77
  environment: ProjectEnvironment;
@@ -72,7 +81,7 @@ interface Project extends Entity, OrganizationScoped {
72
81
  has_ai_grant?: boolean;
73
82
  }
74
83
  /** Links a user to a project with a role (narrower tha organization membership). */
75
- interface ProjectMember extends Entity, ProjectScoped {
84
+ export interface ProjectMember extends Entity, ProjectScoped {
76
85
  user_id: Id;
77
86
  role_id: Id;
78
87
  status: MembershipStatus;
@@ -81,7 +90,7 @@ interface ProjectMember extends Entity, ProjectScoped {
81
90
  * A project API key. Only `key_prefix` is stored in clear; the secret is hashed
82
91
  * (`key_hash`) and shown to the integrator exactly once at creation.
83
92
  */
84
- interface ApiKey extends Entity, ProjectScoped {
93
+ export interface ApiKey extends Entity, ProjectScoped {
85
94
  name: string;
86
95
  key_prefix: string;
87
96
  key_hash: string;
@@ -90,17 +99,16 @@ interface ApiKey extends Entity, ProjectScoped {
90
99
  revoked_at: IsoDateTime | null;
91
100
  }
92
101
  /** An API key plus its one-time-visible secret, returned only at creation. */
93
- interface ApiKeyWithSecret {
102
+ export interface ApiKeyWithSecret {
94
103
  api_key: ApiKey;
95
104
  /** The full secret key, e.g. `sk_live_…`. Never persisted in clear. */
96
105
  secret: string;
97
106
  }
98
107
  /** Resolves the organization + project + (optionally) acting user for a request. */
99
- interface ProjectContext {
108
+ export interface ProjectContext {
100
109
  organization_id: Id;
101
110
  project_id: Id;
102
111
  api_key_id?: Id;
103
112
  }
104
113
  //#endregion
105
- export { ApiKey, ApiKeyWithSecret, Project, ProjectBranding, ProjectContext, ProjectEnvironment, ProjectHandoffSettings, ProjectMember, ProjectSettings, ProjectStatus, VerificationThresholds };
106
114
  //# sourceMappingURL=project.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.mts","names":[],"sources":["../src/project.ts"],"mappings":";;;;;;KAMY,kBAAA;AAAZ;AAAA,KAGY,aAAA;;;AAHkB;AAG9B;UAMiB,sBAAA;EACf,wBAAA;EACA,sBAAA;EACA,iBAAA;EACA,kBAAA;EAJqC;EAMrC,gBAAA;AAAA;;UAIe,eAAA;EACf,QAAA;EACA,aAAA;EACA,aAAA;EACA,KAAA;EARgB;EAUhB,IAAA;EAN8B;;;;EAW9B,aAAA;AAAA;;;;;AAAa;UAQE,sBAAA;EAAsB;EAErC,OAAA;EAAA;AAKa;AAIf;;EAJE,aAAa;AAAA;;UAIE,eAAA,SAAwB,QAAA;EACvC,UAAA,GAAa,OAAA,CAAQ,sBAAA;EACrB,eAAA;EAF+C;EAI/C,WAAA;EAJuC;EAMvC,aAAA,GAAgB,YAAA;EALH;EAOb,OAAA,GAAU,sBAAA;AAAA;;;;;UAOK,OAAA,SAAgB,MAAA,EAAQ,kBAAA;EACvC,IAAA;EACA,IAAA;EACA,WAAA,EAAa,kBAAA;EACb,QAAA,EAAU,eAAA;EACV,QAAA,EAAU,eAAA;EACV,MAAA,EAAQ,aAAA;EACR,YAAA;AAAA;;UAIe,aAAA,SAAsB,MAAA,EAAQ,aAAA;EAC7C,OAAA,EAAS,EAAA;EACT,OAAA,EAAS,EAAA;EACT,MAAA,EAAQ,gBAAA;AAAA;;;;;UAOO,MAAA,SAAe,MAAA,EAAQ,aAAA;EACtC,IAAA;EACA,UAAA;EACA,QAAA;EACA,YAAA,EAAc,WAAA;EACd,UAAA,EAAY,WAAA;EACZ,UAAA,EAAY,WAAA;AAAA;;UAIG,gBAAA;EACf,OAAA,EAAS,MAAM;EArBc;EAuB7B,MAAA;AAAA;;UAIe,cAAA;EACf,eAAA,EAAiB,EAAA;EACjB,UAAA,EAAY,EAAA;EACZ,UAAA,GAAa,EAAA;AAAA"}
1
+ {"version":3,"file":"project.d.mts","names":[],"sources":["../src/project.ts"],"mappings":";;;;;;YAOY;;YAGA;;;;;iBAMK;EACf;EACA;EACA;EACA;;EAEA;;;qBAIW,iCAAiC;;iBAS7B;EACf;;;;;EAKA;EACA;EACA;EACA;;EAEA;;;;;EAKA;;;;;;;iBAQe;;EAEf;;;;;EAKA;;;iBAIe,wBAAwB;EACvC,aAAa,QAAQ;EACrB;;EAEA;;EAEA,gBAAgB;;EAEhB,UAAU;;EAEV,WAAW,QAAQ;;;;;;iBAOJ,gBAAgB,QAAQ;EACvC;EACA;EACA,aAAa;EACb,UAAU;EACV,UAAU;EACV,QAAQ;EACR;;;iBAIe,sBAAsB,QAAQ;EAC7C,SAAS;EACT,SAAS;EACT,QAAQ;;;;;;iBAOO,eAAe,QAAQ;EACtC;EACA;EACA;EACA,cAAc;EACd,YAAY;EACZ,YAAY;;;iBAIG;EACf,SAAS;;EAET;;;iBAIe;EACf,iBAAiB;EACjB,YAAY;EACZ,aAAa"}
@@ -0,0 +1,13 @@
1
+ //#region src/project.ts
2
+ /** Platform default verification thresholds. */
3
+ const DEFAULT_VERIFICATION_THRESHOLDS = {
4
+ documentQualityThreshold: .75,
5
+ ocrConfidenceThreshold: .8,
6
+ livenessThreshold: .85,
7
+ faceMatchThreshold: .75,
8
+ addressThreshold: .6
9
+ };
10
+ //#endregion
11
+ export { DEFAULT_VERIFICATION_THRESHOLDS };
12
+
13
+ //# sourceMappingURL=project.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.mjs","names":[],"sources":["../src/project.ts"],"sourcesContent":["import type { Entity, Id, IsoDateTime, Metadata, OrganizationScoped, ProjectScoped } from './common'\n\nimport type { VelocitySettings } from './risk'\nimport type { CaptureModel } from './settings'\nimport type { MembershipStatus } from './organization'\n\n/** Deployment environment for a project. */\nexport type ProjectEnvironment = 'production' | 'staging' | 'development'\n\n/** Project lifecycle status. */\nexport type ProjectStatus = 'active' | 'paused' | 'archived'\n\n/**\n * Per-project, configurable thresholds the decision engine compares scores\n * against. Projects may override any subset of {@link DEFAULT_VERIFICATION_THRESHOLDS}.\n */\nexport interface VerificationThresholds {\n documentQualityThreshold: number\n ocrConfidenceThreshold: number\n livenessThreshold: number\n faceMatchThreshold: number\n /** Minimum address-verification confidence before flagging for review. */\n addressThreshold: number\n}\n\n/** Platform default verification thresholds. */\nexport const DEFAULT_VERIFICATION_THRESHOLDS: VerificationThresholds = {\n documentQualityThreshold: 0.75,\n ocrConfidenceThreshold: 0.8,\n livenessThreshold: 0.85,\n faceMatchThreshold: 0.75,\n addressThreshold: 0.6,\n}\n\n/** Visual branding applied to the widget for a project. */\nexport interface ProjectBranding {\n logo_url?: string | null\n /**\n * Storage object key of an uploaded logo. Server-side only: the API resolves\n * it to a (signed, when the disk is private) `logo_url` in every response.\n */\n logo_key?: string | null\n primary_color?: string\n border_radius?: number\n theme?: 'light' | 'dark'\n /** Display name (company/product) shown in the widget header. */\n name?: string | null\n /**\n * Whether to show the project's name/logo in the widget header. Defaults to\n * shown; set `false` for an unbranded (white-label) header.\n */\n show_branding?: boolean\n}\n\n/**\n * Cross-device handoff: a desktop user continues an in-progress verification on\n * their phone by scanning a QR code.\n * The QR is shown first on desktop.\n */\nexport interface ProjectHandoffSettings {\n /** Whether desktop users are offered the QR handoff to their phone. */\n enabled?: boolean\n /**\n * Whether a desktop user may instead continue on the desktop device. When\n * `false`, a desktop user must scan to a phone (no \"continue here\"). Defaults true.\n */\n allow_desktop?: boolean\n}\n\n/** Project-level configuration. */\nexport interface ProjectSettings extends Metadata {\n thresholds?: Partial<VerificationThresholds>\n allowed_origins?: string[]\n /** Maximum verification attempts before a session is hard-failed. */\n max_retries?: number\n /** Overrides the global capture model for this project (Phase 17). */\n capture_model?: CaptureModel\n /** Cross-device session handoff (QR). Off unless the project opts in. */\n handoff?: ProjectHandoffSettings\n /** Repeat-session limits per network address (`VELOCITY_EXCEEDED`). */\n velocity?: Partial<VelocitySettings>\n}\n\n/**\n * A specific application, environment, or product integration owned by a\n * organization. Sessions, API keys, and webhooks are scoped to a project.\n */\nexport interface Project extends Entity, OrganizationScoped {\n name: string\n slug: string\n environment: ProjectEnvironment\n settings: ProjectSettings\n branding: ProjectBranding\n status: ProjectStatus\n has_ai_grant?: boolean\n}\n\n/** Links a user to a project with a role (narrower tha organization membership). */\nexport interface ProjectMember extends Entity, ProjectScoped {\n user_id: Id\n role_id: Id\n status: MembershipStatus\n}\n\n/**\n * A project API key. Only `key_prefix` is stored in clear; the secret is hashed\n * (`key_hash`) and shown to the integrator exactly once at creation.\n */\nexport interface ApiKey extends Entity, ProjectScoped {\n name: string\n key_prefix: string\n key_hash: string\n last_used_at: IsoDateTime | null\n expires_at: IsoDateTime | null\n revoked_at: IsoDateTime | null\n}\n\n/** An API key plus its one-time-visible secret, returned only at creation. */\nexport interface ApiKeyWithSecret {\n api_key: ApiKey\n /** The full secret key, e.g. `sk_live_…`. Never persisted in clear. */\n secret: string\n}\n\n/** Resolves the organization + project + (optionally) acting user for a request. */\nexport interface ProjectContext {\n organization_id: Id\n project_id: Id\n api_key_id?: Id\n}\n"],"mappings":";;AA0BA,MAAa,kCAA0D;CACrE,0BAA0B;CAC1B,wBAAwB;CACxB,mBAAmB;CACnB,oBAAoB;CACpB,kBAAkB;AACpB"}