@zyphe-sdk/core 0.2.0 → 0.2.2
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/index.d.ts +40 -21
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +34 -14
- package/dist/openapi.json +141 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -411,8 +411,6 @@ interface components {
|
|
|
411
411
|
riskScore: components["schemas"]["RiskScore"];
|
|
412
412
|
riskTopics: string[];
|
|
413
413
|
};
|
|
414
|
-
/** @enum {string} */
|
|
415
|
-
AmlModerationStatus: "approved" | "rejected" | "escalated";
|
|
416
414
|
AmlOccupancy: {
|
|
417
415
|
endDate?: components["schemas"]["FieldWithControl"];
|
|
418
416
|
post?: components["schemas"]["AmlPosition"][];
|
|
@@ -446,9 +444,7 @@ interface components {
|
|
|
446
444
|
AmlResult: {
|
|
447
445
|
/** Format: date-time */
|
|
448
446
|
createdAt: string;
|
|
449
|
-
data
|
|
450
|
-
[key: string]: unknown;
|
|
451
|
-
};
|
|
447
|
+
data?: components["schemas"]["AmlRiskResult"] | null;
|
|
452
448
|
/** Format: uuid */
|
|
453
449
|
id: string;
|
|
454
450
|
pep: boolean;
|
|
@@ -930,7 +926,7 @@ interface components {
|
|
|
930
926
|
status: components["schemas"]["ResultStatus"];
|
|
931
927
|
};
|
|
932
928
|
/** @enum {string} */
|
|
933
|
-
ErrorTags: "unexpected" | "bad_request" | "permission_denied" | "request_deserialization" | "database" | "invalid_email_or_password" | "user_not_confirmed" | "verify_password" | "send_email" | "open_session" | "read_session" | "close_session" | "user_disabled" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_not_found" | "flow_step_not_found" | "organization_not_found" | "storage" | "verification_request_not_found" | "document_reader" | "websocket" | "organization_settings_not_found" | "start_job" | "result_not_found" | "kyc_grant_not_found" | "document_not_found" | "service_invocation" | "trigger_webhook" | "too_many_invites" | "invite_already_used" | "invite_already_accepted" | "invite_already_revoked" | "invite_revoked" | "invite_expired" | "invite_already_exists" | "share_already_revoked" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "identity_not_found" | "step_order_violation" | "serialization" | "mock_data" | "api_key_not_found" | "not_implemented" | "access_grant" | "rate_limit_exceeded" | "missing_api_key" | "invalid_api_key" | "origin_not_allowed" | "step_already_completed" | "send_sms" | "parse_error" | "inviter_organization_not_found" | "forbidden" | "passkey_authentication" | "internal" | "invalid_email" | "graph_validation" | "external_api" | "share_already_has_write_access" | "share_does_not_have_write_access" | "write_access_already_revoked" | "invite_required" | "billing";
|
|
929
|
+
ErrorTags: "unexpected" | "bad_request" | "permission_denied" | "request_deserialization" | "database" | "invalid_email_or_password" | "user_not_confirmed" | "verify_password" | "send_email" | "open_session" | "read_session" | "close_session" | "user_disabled" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_not_found" | "flow_step_not_found" | "organization_not_found" | "storage" | "verification_request_not_found" | "document_reader" | "websocket" | "organization_settings_not_found" | "start_job" | "result_not_found" | "kyc_grant_not_found" | "document_not_found" | "service_invocation" | "trigger_webhook" | "too_many_invites" | "invite_already_used" | "invite_already_accepted" | "invite_already_revoked" | "invite_revoked" | "invite_expired" | "invite_already_exists" | "share_already_revoked" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "identity_not_found" | "step_order_violation" | "serialization" | "mock_data" | "api_key_not_found" | "not_implemented" | "access_grant" | "rate_limit_exceeded" | "missing_api_key" | "invalid_api_key" | "origin_not_allowed" | "step_already_completed" | "send_sms" | "send_notification" | "parse_error" | "inviter_organization_not_found" | "forbidden" | "passkey_authentication" | "internal" | "invalid_email" | "graph_validation" | "external_api" | "share_already_has_write_access" | "share_does_not_have_write_access" | "write_access_already_revoked" | "invite_required" | "billing";
|
|
934
930
|
/** @description Represents an executed action with its ID and type. */
|
|
935
931
|
ExecutedAction: {
|
|
936
932
|
actionConfig: components["schemas"]["ActionConfig"];
|
|
@@ -1500,8 +1496,17 @@ interface components {
|
|
|
1500
1496
|
email: string;
|
|
1501
1497
|
};
|
|
1502
1498
|
GetNextStepResponse: {
|
|
1499
|
+
/** @description Custom data associated with the flow result, if one exists. */
|
|
1500
|
+
customData?: {
|
|
1501
|
+
[key: string]: unknown;
|
|
1502
|
+
} | null;
|
|
1503
1503
|
/** @description Actions that were automatically executed as part of flow evaluation (e.g. status transitions). */
|
|
1504
1504
|
executedActions?: components["schemas"]["ExecutedAction"][];
|
|
1505
|
+
/**
|
|
1506
|
+
* Format: uuid
|
|
1507
|
+
* @description The ID of the flow result record, if one exists for this user.
|
|
1508
|
+
*/
|
|
1509
|
+
flowResultId?: string | null;
|
|
1505
1510
|
/** @description Whether the user has completed all required steps in the flow. */
|
|
1506
1511
|
isCompleted: boolean;
|
|
1507
1512
|
nextStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
|
|
@@ -1580,50 +1585,55 @@ interface components {
|
|
|
1580
1585
|
};
|
|
1581
1586
|
name: string;
|
|
1582
1587
|
options: unknown;
|
|
1583
|
-
|
|
1588
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1584
1589
|
/** @enum {string} */
|
|
1585
1590
|
type: "date";
|
|
1586
1591
|
value?: unknown;
|
|
1592
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1587
1593
|
} | {
|
|
1588
1594
|
label: {
|
|
1589
1595
|
[key: string]: string;
|
|
1590
1596
|
};
|
|
1591
1597
|
name: string;
|
|
1592
1598
|
options: unknown;
|
|
1593
|
-
|
|
1599
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1594
1600
|
/** @enum {string} */
|
|
1595
1601
|
type: "text";
|
|
1596
1602
|
value?: unknown;
|
|
1603
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1597
1604
|
} | {
|
|
1598
1605
|
label: {
|
|
1599
1606
|
[key: string]: string;
|
|
1600
1607
|
};
|
|
1601
1608
|
name: string;
|
|
1602
1609
|
options: unknown;
|
|
1603
|
-
|
|
1610
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1604
1611
|
/** @enum {string} */
|
|
1605
1612
|
type: "textarea";
|
|
1606
1613
|
value?: unknown;
|
|
1614
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1607
1615
|
} | {
|
|
1608
1616
|
label: {
|
|
1609
1617
|
[key: string]: string;
|
|
1610
1618
|
};
|
|
1611
1619
|
name: string;
|
|
1612
1620
|
options: unknown;
|
|
1613
|
-
|
|
1621
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1614
1622
|
/** @enum {string} */
|
|
1615
1623
|
type: "checkbox";
|
|
1616
1624
|
value?: unknown;
|
|
1625
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1617
1626
|
} | {
|
|
1618
1627
|
label: {
|
|
1619
1628
|
[key: string]: string;
|
|
1620
1629
|
};
|
|
1621
1630
|
name: string;
|
|
1622
1631
|
options: components["schemas"]["FileOptions"];
|
|
1623
|
-
|
|
1632
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1624
1633
|
/** @enum {string} */
|
|
1625
1634
|
type: "file";
|
|
1626
1635
|
value?: unknown;
|
|
1636
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1627
1637
|
} | {
|
|
1628
1638
|
label: {
|
|
1629
1639
|
[key: string]: string;
|
|
@@ -1636,20 +1646,22 @@ interface components {
|
|
|
1636
1646
|
};
|
|
1637
1647
|
};
|
|
1638
1648
|
options: components["schemas"]["SelectOptions"];
|
|
1639
|
-
|
|
1649
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1640
1650
|
/** @enum {string} */
|
|
1641
1651
|
type: "select";
|
|
1642
1652
|
value?: unknown;
|
|
1653
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1643
1654
|
} | {
|
|
1644
1655
|
label: {
|
|
1645
1656
|
[key: string]: string;
|
|
1646
1657
|
};
|
|
1647
1658
|
name: string;
|
|
1648
1659
|
options: unknown;
|
|
1649
|
-
|
|
1660
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1650
1661
|
/** @enum {string} */
|
|
1651
1662
|
type: "place";
|
|
1652
1663
|
value?: unknown;
|
|
1664
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1653
1665
|
};
|
|
1654
1666
|
InputFieldOptions: components["schemas"]["FileOptions"] | components["schemas"]["SelectOptions"] | unknown;
|
|
1655
1667
|
/** @enum {string} */
|
|
@@ -2105,6 +2117,7 @@ interface components {
|
|
|
2105
2117
|
text: {
|
|
2106
2118
|
[key: string]: string;
|
|
2107
2119
|
};
|
|
2120
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
2108
2121
|
};
|
|
2109
2122
|
PoaConfig: {
|
|
2110
2123
|
documentFilter: components["schemas"]["PoaDocumentType"][];
|
|
@@ -2186,6 +2199,13 @@ interface components {
|
|
|
2186
2199
|
autoOneClickKycData?: components["schemas"]["AutoOneClickKycData"] | null;
|
|
2187
2200
|
/** @description Biometric check data (for face matching results) */
|
|
2188
2201
|
biometricCheckData?: unknown;
|
|
2202
|
+
/**
|
|
2203
|
+
* Format: date
|
|
2204
|
+
* @description Date on which a DocumentExpired webhook was last sent for this DV result.
|
|
2205
|
+
* Used by the AML worker to deduplicate repeated expiry notifications across
|
|
2206
|
+
* refresh ticks — once set, the webhook is not re-enqueued.
|
|
2207
|
+
*/
|
|
2208
|
+
documentExpiredWebhookSentAt?: string | null;
|
|
2189
2209
|
/** @description Image quality check results */
|
|
2190
2210
|
imageQuality?: components["schemas"]["ImageQualityCheckResult"][] | null;
|
|
2191
2211
|
/** @description Raw liveness data from face verification */
|
|
@@ -2472,7 +2492,7 @@ interface components {
|
|
|
2472
2492
|
*/
|
|
2473
2493
|
Uuid: string;
|
|
2474
2494
|
/** @enum {string} */
|
|
2475
|
-
ValidationMessages: "validation_unexpected" | "validation_invalid_file_format" | "validation_organization_slug_exists" | "validation_flow_slug_exists" | "validation_flow_id_mismatch" | "validation_flow_step_name_exists" | "validation_consents_not_granted" | "validation_kyb_config_match" | "validation_kyb_config_already_uses_this_kyc_flow_id" | "validation_kyb_moderation_status_wrong" | "validation_form_name_exists" | "validation_database_error" | "validation_flow_name_invalid" | "validation_flow_slug_name_invalid" | "validation_flow_step_name_invalid" | "validation_flow_step_order_duplicate" | "validation_flow_step_order_invalid" | "validation_flow_step_id_mismatch" | "validation_password_too_short" | "validation_password_no_uppercase" | "validation_password_no_lowercase" | "validation_password_no_number" | "validation_password_no_special_character" | "validation_password_contains_whitespace_or_control" | "validation_emails_empty" | "validation_email_invalid" | "validation_emails_too_many" | "validation_emails_duplicate" | "validation_invite_to_self" | "validation_e164_format" | "validation_flow_step_already_has_reference" | "validation_flow_not_found" | "validation_empty_parameter" | "validation_form_not_found" | "validation_workflow_graph_invalid" | "validation_invalid_role_for_invitation";
|
|
2495
|
+
ValidationMessages: "validation_unexpected" | "validation_invalid_file_format" | "validation_organization_slug_exists" | "validation_flow_slug_exists" | "validation_flow_id_mismatch" | "validation_flow_step_name_exists" | "validation_consents_not_granted" | "validation_kyb_config_match" | "validation_kyb_config_already_uses_this_kyc_flow_id" | "validation_kyb_moderation_status_wrong" | "validation_form_name_exists" | "validation_database_error" | "validation_flow_name_invalid" | "validation_flow_slug_name_invalid" | "validation_flow_step_name_invalid" | "validation_flow_step_order_duplicate" | "validation_flow_step_order_invalid" | "validation_flow_step_id_mismatch" | "validation_password_too_short" | "validation_password_no_uppercase" | "validation_password_no_lowercase" | "validation_password_no_number" | "validation_password_no_special_character" | "validation_password_contains_whitespace_or_control" | "validation_emails_empty" | "validation_email_invalid" | "validation_emails_too_many" | "validation_emails_duplicate" | "validation_invite_to_self" | "validation_e164_format" | "validation_flow_step_already_has_reference" | "validation_flow_not_found" | "validation_empty_parameter" | "validation_form_not_found" | "validation_organization_not_found" | "validation_workflow_graph_invalid" | "validation_invalid_role_for_invitation" | "validation_form_condition_forward_ref";
|
|
2476
2496
|
VaultUnlockPasskeyData: {
|
|
2477
2497
|
/** @description Passkey challenge for vault unlock (base64url) */
|
|
2478
2498
|
challenge: string;
|
|
@@ -3835,6 +3855,9 @@ type ProcessDocumentSelectionRequestPayload = paths["/sdk/flow/{flow_id}/vr/{ver
|
|
|
3835
3855
|
type ProcessLivenessResponse = components["schemas"]["ProcessLivenessResponse"];
|
|
3836
3856
|
type ApiKeyType = components["schemas"]["ApiKeyType"];
|
|
3837
3857
|
type FlowStepType = components["schemas"]["FlowStepType"];
|
|
3858
|
+
type Flow = components["schemas"]["Flow"];
|
|
3859
|
+
type FlowStep = components["schemas"]["FlowStep"];
|
|
3860
|
+
type VerificationRequest = components["schemas"]["VerificationRequest"];
|
|
3838
3861
|
type BaxeError = components["schemas"]["BaxeError"];
|
|
3839
3862
|
/**
|
|
3840
3863
|
* Parameters for initializing the Zyphe iframe for a Flow.
|
|
@@ -4206,9 +4229,7 @@ declare function getFlowResult({ organizationId, flowResultId, isSandbox }: GetF
|
|
|
4206
4229
|
}[] | undefined;
|
|
4207
4230
|
amlResults: {
|
|
4208
4231
|
createdAt: string;
|
|
4209
|
-
data
|
|
4210
|
-
[key: string]: unknown;
|
|
4211
|
-
};
|
|
4232
|
+
data?: components["schemas"]["AmlRiskResult"] | null;
|
|
4212
4233
|
id: string;
|
|
4213
4234
|
pep: boolean;
|
|
4214
4235
|
sanctions: boolean;
|
|
@@ -4392,9 +4413,7 @@ declare function getFlowResult({ organizationId, flowResultId, isSandbox }: GetF
|
|
|
4392
4413
|
}[] | undefined;
|
|
4393
4414
|
amlResults: {
|
|
4394
4415
|
createdAt: string;
|
|
4395
|
-
data
|
|
4396
|
-
[key: string]: unknown;
|
|
4397
|
-
};
|
|
4416
|
+
data?: components["schemas"]["AmlRiskResult"] | null;
|
|
4398
4417
|
id: string;
|
|
4399
4418
|
pep: boolean;
|
|
4400
4419
|
sanctions: boolean;
|
|
@@ -4773,4 +4792,4 @@ interface WebhookVerifierOptions<T extends Function> {
|
|
|
4773
4792
|
exposeRawBody?: boolean;
|
|
4774
4793
|
}
|
|
4775
4794
|
|
|
4776
|
-
export { API_KEY_HEADER, type ApiKeyType, type BaxeError, type CompleteLivenessStepParams, type CreateVerificationSessionParams, DocumentType, type Environment, EnvironmentConfigs, Environments, type FlowStepType, type GetLivenessChallengeOptions, type GetLivenessChallengeResponse, type GetNextStepDetailsParams, type InitializeZypheFlowParams, type Locale, type ProcessDocumentSelectionOptions, type ProcessDocumentSelectionPayload, type ProcessDocumentSelectionRequestPayload, type ProcessDocumentSelectionResponse, type ProcessDvDocumentOptions, type ProcessDvDocumentPayload, type ProcessDvLivenessOptions, type ProcessDvLivenessParams, type ProcessIdentityDocumentPayload, type ProcessIdentityDocumentResponse, type ProcessLivenessPayload, type ProcessLivenessResponse, type SDKOptions, type SdkCreateVerificationRequestResponse, type SignatureComponents, type VerificationRequestParams, type VerificationSessionRequestOptions, WebhookSignatureErrorCodes, WebhookSignatureErrorMessages, type WebhookVerifierOptions, ZypheError, bufferToHex, completeDocumentSelectionStep, completeDvStep, completeLivenessStep, constructVerificationSessionUrl, createVerificationSession, getDvResult, getFlowResult, getNextStepDetails, hexToBytes, listFlowResults, parseSignatureHeader, timingSafeEqual };
|
|
4795
|
+
export { API_KEY_HEADER, type ApiKeyType, type BaxeError, type CompleteLivenessStepParams, type CreateVerificationSessionParams, DocumentType, type Environment, EnvironmentConfigs, Environments, type Flow, type FlowStep, type FlowStepType, type GetLivenessChallengeOptions, type GetLivenessChallengeResponse, type GetNextStepDetailsParams, type InitializeZypheFlowParams, type Locale, type ProcessDocumentSelectionOptions, type ProcessDocumentSelectionPayload, type ProcessDocumentSelectionRequestPayload, type ProcessDocumentSelectionResponse, type ProcessDvDocumentOptions, type ProcessDvDocumentPayload, type ProcessDvLivenessOptions, type ProcessDvLivenessParams, type ProcessIdentityDocumentPayload, type ProcessIdentityDocumentResponse, type ProcessLivenessPayload, type ProcessLivenessResponse, type SDKOptions, type SdkCreateVerificationRequestResponse, type SignatureComponents, type VerificationRequest, type VerificationRequestParams, type VerificationSessionRequestOptions, WebhookSignatureErrorCodes, WebhookSignatureErrorMessages, type WebhookVerifierOptions, ZypheError, bufferToHex, completeDocumentSelectionStep, completeDvStep, completeLivenessStep, constructVerificationSessionUrl, createVerificationSession, getDvResult, getFlowResult, getNextStepDetails, hexToBytes, listFlowResults, parseSignatureHeader, timingSafeEqual };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/constants.ts","../src/sdk-error.ts","../src/complete-step.ts","../src/utils/guards.ts","../src/gen/dv_result.ts","../src/utils/protobuf.ts","../src/flow-results.ts","../src/types.ts","../src/verification-session.ts","../src/webhook.ts"],"sourcesContent":["import createClient, { type Middleware } from \"openapi-fetch\";\nimport type { paths } from \"../public/openapi\";\nimport { EnvironmentConfigs, Environments } from \"./constants\";\nimport type { SDKOptions } from \"./types\";\n\nexport const zypheApiClient = (opts: SDKOptions) => {\n // Default to production if no environment is provided\n const environment = opts.environment ?? Environments.PRODUCTION;\n\n return createClient<paths>({\n baseUrl: EnvironmentConfigs[environment].apiUrl,\n });\n};\n","export const Environments = {\n LOCAL: \"local\",\n STAGING: \"staging\",\n PRODUCTION: \"production\",\n} as const;\n\nexport type Environment = (typeof Environments)[keyof typeof Environments];\n\ninterface EnvironmentConfig {\n appUrl: string;\n apiUrl: string;\n}\n\nexport const EnvironmentConfigs = {\n [Environments.LOCAL]: {\n appUrl: \"http://localhost:5173\",\n apiUrl: \"http://localhost:3000\",\n },\n [Environments.STAGING]: {\n appUrl: \"https://app-dev.zyphe.com\",\n apiUrl: \"https://api-dev.zyphe.com\",\n },\n [Environments.PRODUCTION]: {\n appUrl: \"https://verify.zyphe.com\",\n apiUrl: \"https://api.zyphe.com\",\n },\n} as const satisfies Record<Environment, EnvironmentConfig>;\n\nexport const API_KEY_HEADER = \"x-api-key\";\n","import type { BaxeError } from \"./types\";\n\ninterface ZypheErrorOptions extends ErrorOptions {\n errorTag?: string;\n}\n\nexport class ZypheError extends Error {\n errorTag?: string;\n constructor(message: string, options?: ZypheErrorOptions) {\n super(message, { cause: options?.cause });\n this.errorTag = options?.errorTag;\n }\n\n static fromBaxeError(error: BaxeError): ZypheError {\n return new ZypheError(error.message ?? \"An unexpected error occurred\", {\n errorTag: error.errorTag,\n });\n }\n}\n","import { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER } from \"./constants\";\nimport { ZypheError } from \"./sdk-error\";\nimport type {\n ProcessDocumentSelectionRequestPayload,\n ProcessDocumentSelectionResponse,\n ProcessIdentityDocumentResponse,\n ProcessLivenessResponse,\n SdkCreateVerificationRequestResponse,\n SDKOptions,\n} from \"./types\";\n\ntype UploadBody = ArrayBufferView | ArrayBuffer;\n\ninterface UploadResponse {\n ok: boolean;\n}\n\ndeclare const fetch: (\n input: string,\n init: {\n method: \"PUT\";\n body: UploadBody;\n },\n) => Promise<UploadResponse>;\n\ninterface CompleteDvStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n countryCode: string;\n images:\n | { type: \"DOUBLE_SIDED_DOCUMENT\"; frontImage: string; backImage: string }\n | { type: \"SINGLE_SIDED_DOCUMENT\"; image: string };\n}\n\nexport async function completeDvStep(\n { verificationSession, countryCode, images }: CompleteDvStepParams,\n options: SDKOptions,\n): Promise<ProcessIdentityDocumentResponse> {\n const client = zypheApiClient(options);\n\n const response = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-document\",\n {\n body: {\n countryCode,\n images:\n images.type === \"SINGLE_SIDED_DOCUMENT\"\n ? [\n {\n pageIndex: \"front\",\n source: \"file\",\n value: images.image,\n },\n ]\n : [\n {\n pageIndex: \"front\",\n source: \"file\",\n value: images.frontImage,\n },\n {\n pageIndex: \"back\",\n source: \"file\",\n value: images.backImage,\n },\n ],\n },\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (response.error) {\n throw ZypheError.fromBaxeError(response.error);\n }\n\n return response.data;\n}\n\nexport interface CompleteLivenessStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n frontImage: Uint8Array;\n movementImages?: Uint8Array[];\n video?: Uint8Array;\n}\n\nexport async function completeLivenessStep(\n {\n verificationSession,\n frontImage,\n movementImages = [],\n video,\n }: CompleteLivenessStepParams,\n options: SDKOptions,\n): Promise<ProcessLivenessResponse> {\n const client = zypheApiClient(options);\n\n const challengeResponse = await client.GET(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/liveness-challenge\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (challengeResponse.error) {\n throw ZypheError.fromBaxeError(challengeResponse.error);\n }\n\n const challenge = challengeResponse.data;\n\n // Validate ACTIVE-mode inputs before uploading anything\n if (challenge.mode === \"ACTIVE\") {\n if (!video) {\n throw new ZypheError(\"Missing liveness video for active challenge\");\n }\n if (movementImages.length !== challenge.movementImages.length) {\n throw new ZypheError(\n \"Movement image count does not match active challenge\",\n );\n }\n }\n\n const calibrationUploadResponse = await fetch(\n challenge.calibrationImage.presignedUrl,\n {\n method: \"PUT\",\n body: frontImage,\n },\n );\n\n if (!calibrationUploadResponse.ok) {\n throw new ZypheError(\"Failed to upload front image\");\n }\n\n if (challenge.mode === \"ACTIVE\") {\n const videoUploadResponse = await fetch(challenge.video.presignedUrl, {\n method: \"PUT\",\n body: video as UploadBody,\n });\n\n if (!videoUploadResponse.ok) {\n throw new ZypheError(\"Failed to upload liveness video\");\n }\n\n for (const [index, movementImage] of challenge.movementImages.entries()) {\n const movementUploadResponse = await fetch(movementImage.presignedUrl, {\n method: \"PUT\",\n body: movementImages[index] as UploadBody,\n });\n\n if (!movementUploadResponse.ok) {\n throw new ZypheError(`Failed to upload movement image ${index + 1}`);\n }\n }\n }\n\n const processDvLivenessResponse = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-liveness\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n body: {\n challengeId: challenge.id,\n movementImagesQuantity: movementImages.length,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (processDvLivenessResponse.error) {\n throw ZypheError.fromBaxeError(processDvLivenessResponse.error);\n }\n\n return processDvLivenessResponse.data;\n}\n\ninterface CompleteDocumentSelectionStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n payload: ProcessDocumentSelectionRequestPayload;\n}\n\nexport async function completeDocumentSelectionStep(\n { verificationSession, payload }: CompleteDocumentSelectionStepParams,\n options: SDKOptions,\n): Promise<ProcessDocumentSelectionResponse> {\n const client = zypheApiClient(options);\n\n const processDocumentSelectionResponse = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-selection\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n body: payload,\n },\n );\n\n if (processDocumentSelectionResponse.error) {\n throw ZypheError.fromBaxeError(processDocumentSelectionResponse.error);\n }\n\n return processDocumentSelectionResponse.data;\n}\n","import type { ApiKeyType } from \"../types\";\n\nconst ApiKeyTypes = {\n PUBLISHABLE: \"zyphe_pk_\",\n SECRET: \"zyphe_sk_\",\n} as const satisfies Record<ApiKeyType, string>;\n\n/**\n * Ensures that the API key is of the specified type.\n * @param apiKey - The API key to check.\n * @param type - The type of API key to check for.\n * @throws An error if the API key is not of the specified type.\n */\nexport function ensureApiKeyType(apiKey: string, types: ApiKeyType[]) {\n if (!types.some((type) => apiKey.startsWith(ApiKeyTypes[type]))) {\n throw new Error(\n `Invalid API key. This function is only available for ${types.join(\n \", \",\n )} keys`,\n );\n }\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.7.5\n// protoc unknown\n// source: dv_result.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\n\nexport const protobufPackage = \"dv_result_proto\";\n\nexport enum ImageProvenance {\n UNSPECIFIED_IMAGE_PROVENANCE = 0,\n FRONT_DOCUMENT_IMAGE = 1,\n BACK_DOCUMENT_IMAGE = 2,\n SIGNATURE_IMAGE = 3,\n PORTRAIT_IMAGE = 5,\n CITIZENSHIP_IMAGE = 6,\n SELFIE_IMAGE = 7,\n UNRECOGNIZED = -1,\n}\n\nexport function imageProvenanceFromJSON(object: any): ImageProvenance {\n switch (object) {\n case 0:\n case \"UNSPECIFIED_IMAGE_PROVENANCE\":\n return ImageProvenance.UNSPECIFIED_IMAGE_PROVENANCE;\n case 1:\n case \"FRONT_DOCUMENT_IMAGE\":\n return ImageProvenance.FRONT_DOCUMENT_IMAGE;\n case 2:\n case \"BACK_DOCUMENT_IMAGE\":\n return ImageProvenance.BACK_DOCUMENT_IMAGE;\n case 3:\n case \"SIGNATURE_IMAGE\":\n return ImageProvenance.SIGNATURE_IMAGE;\n case 5:\n case \"PORTRAIT_IMAGE\":\n return ImageProvenance.PORTRAIT_IMAGE;\n case 6:\n case \"CITIZENSHIP_IMAGE\":\n return ImageProvenance.CITIZENSHIP_IMAGE;\n case 7:\n case \"SELFIE_IMAGE\":\n return ImageProvenance.SELFIE_IMAGE;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ImageProvenance.UNRECOGNIZED;\n }\n}\n\nexport function imageProvenanceToJSON(object: ImageProvenance): string {\n switch (object) {\n case ImageProvenance.UNSPECIFIED_IMAGE_PROVENANCE:\n return \"UNSPECIFIED_IMAGE_PROVENANCE\";\n case ImageProvenance.FRONT_DOCUMENT_IMAGE:\n return \"FRONT_DOCUMENT_IMAGE\";\n case ImageProvenance.BACK_DOCUMENT_IMAGE:\n return \"BACK_DOCUMENT_IMAGE\";\n case ImageProvenance.SIGNATURE_IMAGE:\n return \"SIGNATURE_IMAGE\";\n case ImageProvenance.PORTRAIT_IMAGE:\n return \"PORTRAIT_IMAGE\";\n case ImageProvenance.CITIZENSHIP_IMAGE:\n return \"CITIZENSHIP_IMAGE\";\n case ImageProvenance.SELFIE_IMAGE:\n return \"SELFIE_IMAGE\";\n case ImageProvenance.UNRECOGNIZED:\n default:\n return \"UNRECOGNIZED\";\n }\n}\n\nexport enum ResultStatus {\n FAILED = 0,\n PASSED = 1,\n PARTIAL = 2,\n REQUIRES_MANUAL_REVIEW = 3,\n REQUIRES_ADMIN_REVIEW = 4,\n MANUALLY_APPROVED = 5,\n MANUALLY_REJECTED = 6,\n UNRECOGNIZED = -1,\n}\n\nexport function resultStatusFromJSON(object: any): ResultStatus {\n switch (object) {\n case 0:\n case \"FAILED\":\n return ResultStatus.FAILED;\n case 1:\n case \"PASSED\":\n return ResultStatus.PASSED;\n case 2:\n case \"PARTIAL\":\n return ResultStatus.PARTIAL;\n case 3:\n case \"REQUIRES_MANUAL_REVIEW\":\n return ResultStatus.REQUIRES_MANUAL_REVIEW;\n case 4:\n case \"REQUIRES_ADMIN_REVIEW\":\n return ResultStatus.REQUIRES_ADMIN_REVIEW;\n case 5:\n case \"MANUALLY_APPROVED\":\n return ResultStatus.MANUALLY_APPROVED;\n case 6:\n case \"MANUALLY_REJECTED\":\n return ResultStatus.MANUALLY_REJECTED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ResultStatus.UNRECOGNIZED;\n }\n}\n\nexport function resultStatusToJSON(object: ResultStatus): string {\n switch (object) {\n case ResultStatus.FAILED:\n return \"FAILED\";\n case ResultStatus.PASSED:\n return \"PASSED\";\n case ResultStatus.PARTIAL:\n return \"PARTIAL\";\n case ResultStatus.REQUIRES_MANUAL_REVIEW:\n return \"REQUIRES_MANUAL_REVIEW\";\n case ResultStatus.REQUIRES_ADMIN_REVIEW:\n return \"REQUIRES_ADMIN_REVIEW\";\n case ResultStatus.MANUALLY_APPROVED:\n return \"MANUALLY_APPROVED\";\n case ResultStatus.MANUALLY_REJECTED:\n return \"MANUALLY_REJECTED\";\n case ResultStatus.UNRECOGNIZED:\n default:\n return \"UNRECOGNIZED\";\n }\n}\n\nexport interface PersonalData {\n givenName: string;\n surname: string;\n dateOfBirth: string;\n nationality: string;\n gender: string;\n placeOfBirth: string;\n personalNumber: string;\n}\n\nexport interface DocumentData {\n documentNumber: string;\n issuingState: string;\n issuingAuthority: string;\n expiryDate: string;\n documentClassCode: string;\n mrzStrings: string;\n documentCan: string;\n}\n\nexport interface AddressData {\n flat: string;\n houseNumber: string;\n building: string;\n street: string;\n city: string;\n postalCode: string;\n country: string;\n addressLine: string;\n}\n\nexport interface Image {\n contentType: string;\n data: Uint8Array;\n provenance: ImageProvenance;\n}\n\nexport interface Video {\n url: string;\n}\n\nexport interface Document {\n personalData: PersonalData | undefined;\n documentData: DocumentData | undefined;\n addressData: AddressData | undefined;\n}\n\nexport interface Details {\n status: ResultStatus;\n docreaderRequestLog: string;\n docreaderResponseLog: string;\n faceapiResponseLog: string;\n}\n\nexport interface Message {\n document?: Document | undefined;\n frontImage?: Image | undefined;\n backImage?: Image | undefined;\n otherImage?: Image | undefined;\n details?: Details | undefined;\n liveness?: Video | undefined;\n}\n\nfunction createBasePersonalData(): PersonalData {\n return {\n givenName: \"\",\n surname: \"\",\n dateOfBirth: \"\",\n nationality: \"\",\n gender: \"\",\n placeOfBirth: \"\",\n personalNumber: \"\",\n };\n}\n\nexport const PersonalData: MessageFns<PersonalData> = {\n encode(message: PersonalData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.givenName !== \"\") {\n writer.uint32(10).string(message.givenName);\n }\n if (message.surname !== \"\") {\n writer.uint32(18).string(message.surname);\n }\n if (message.dateOfBirth !== \"\") {\n writer.uint32(26).string(message.dateOfBirth);\n }\n if (message.nationality !== \"\") {\n writer.uint32(34).string(message.nationality);\n }\n if (message.gender !== \"\") {\n writer.uint32(42).string(message.gender);\n }\n if (message.placeOfBirth !== \"\") {\n writer.uint32(50).string(message.placeOfBirth);\n }\n if (message.personalNumber !== \"\") {\n writer.uint32(58).string(message.personalNumber);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): PersonalData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePersonalData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.givenName = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.surname = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.dateOfBirth = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.nationality = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.gender = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.placeOfBirth = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.personalNumber = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): PersonalData {\n return {\n givenName: isSet(object.givenName) ? globalThis.String(object.givenName) : \"\",\n surname: isSet(object.surname) ? globalThis.String(object.surname) : \"\",\n dateOfBirth: isSet(object.dateOfBirth) ? globalThis.String(object.dateOfBirth) : \"\",\n nationality: isSet(object.nationality) ? globalThis.String(object.nationality) : \"\",\n gender: isSet(object.gender) ? globalThis.String(object.gender) : \"\",\n placeOfBirth: isSet(object.placeOfBirth) ? globalThis.String(object.placeOfBirth) : \"\",\n personalNumber: isSet(object.personalNumber) ? globalThis.String(object.personalNumber) : \"\",\n };\n },\n\n toJSON(message: PersonalData): unknown {\n const obj: any = {};\n if (message.givenName !== \"\") {\n obj.givenName = message.givenName;\n }\n if (message.surname !== \"\") {\n obj.surname = message.surname;\n }\n if (message.dateOfBirth !== \"\") {\n obj.dateOfBirth = message.dateOfBirth;\n }\n if (message.nationality !== \"\") {\n obj.nationality = message.nationality;\n }\n if (message.gender !== \"\") {\n obj.gender = message.gender;\n }\n if (message.placeOfBirth !== \"\") {\n obj.placeOfBirth = message.placeOfBirth;\n }\n if (message.personalNumber !== \"\") {\n obj.personalNumber = message.personalNumber;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<PersonalData>, I>>(base?: I): PersonalData {\n return PersonalData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<PersonalData>, I>>(object: I): PersonalData {\n const message = createBasePersonalData();\n message.givenName = object.givenName ?? \"\";\n message.surname = object.surname ?? \"\";\n message.dateOfBirth = object.dateOfBirth ?? \"\";\n message.nationality = object.nationality ?? \"\";\n message.gender = object.gender ?? \"\";\n message.placeOfBirth = object.placeOfBirth ?? \"\";\n message.personalNumber = object.personalNumber ?? \"\";\n return message;\n },\n};\n\nfunction createBaseDocumentData(): DocumentData {\n return {\n documentNumber: \"\",\n issuingState: \"\",\n issuingAuthority: \"\",\n expiryDate: \"\",\n documentClassCode: \"\",\n mrzStrings: \"\",\n documentCan: \"\",\n };\n}\n\nexport const DocumentData: MessageFns<DocumentData> = {\n encode(message: DocumentData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.documentNumber !== \"\") {\n writer.uint32(10).string(message.documentNumber);\n }\n if (message.issuingState !== \"\") {\n writer.uint32(18).string(message.issuingState);\n }\n if (message.issuingAuthority !== \"\") {\n writer.uint32(26).string(message.issuingAuthority);\n }\n if (message.expiryDate !== \"\") {\n writer.uint32(34).string(message.expiryDate);\n }\n if (message.documentClassCode !== \"\") {\n writer.uint32(42).string(message.documentClassCode);\n }\n if (message.mrzStrings !== \"\") {\n writer.uint32(50).string(message.mrzStrings);\n }\n if (message.documentCan !== \"\") {\n writer.uint32(58).string(message.documentCan);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): DocumentData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDocumentData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.documentNumber = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.issuingState = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.issuingAuthority = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.expiryDate = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.documentClassCode = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.mrzStrings = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.documentCan = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): DocumentData {\n return {\n documentNumber: isSet(object.documentNumber) ? globalThis.String(object.documentNumber) : \"\",\n issuingState: isSet(object.issuingState) ? globalThis.String(object.issuingState) : \"\",\n issuingAuthority: isSet(object.issuingAuthority) ? globalThis.String(object.issuingAuthority) : \"\",\n expiryDate: isSet(object.expiryDate) ? globalThis.String(object.expiryDate) : \"\",\n documentClassCode: isSet(object.documentClassCode) ? globalThis.String(object.documentClassCode) : \"\",\n mrzStrings: isSet(object.mrzStrings) ? globalThis.String(object.mrzStrings) : \"\",\n documentCan: isSet(object.documentCan) ? globalThis.String(object.documentCan) : \"\",\n };\n },\n\n toJSON(message: DocumentData): unknown {\n const obj: any = {};\n if (message.documentNumber !== \"\") {\n obj.documentNumber = message.documentNumber;\n }\n if (message.issuingState !== \"\") {\n obj.issuingState = message.issuingState;\n }\n if (message.issuingAuthority !== \"\") {\n obj.issuingAuthority = message.issuingAuthority;\n }\n if (message.expiryDate !== \"\") {\n obj.expiryDate = message.expiryDate;\n }\n if (message.documentClassCode !== \"\") {\n obj.documentClassCode = message.documentClassCode;\n }\n if (message.mrzStrings !== \"\") {\n obj.mrzStrings = message.mrzStrings;\n }\n if (message.documentCan !== \"\") {\n obj.documentCan = message.documentCan;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<DocumentData>, I>>(base?: I): DocumentData {\n return DocumentData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<DocumentData>, I>>(object: I): DocumentData {\n const message = createBaseDocumentData();\n message.documentNumber = object.documentNumber ?? \"\";\n message.issuingState = object.issuingState ?? \"\";\n message.issuingAuthority = object.issuingAuthority ?? \"\";\n message.expiryDate = object.expiryDate ?? \"\";\n message.documentClassCode = object.documentClassCode ?? \"\";\n message.mrzStrings = object.mrzStrings ?? \"\";\n message.documentCan = object.documentCan ?? \"\";\n return message;\n },\n};\n\nfunction createBaseAddressData(): AddressData {\n return {\n flat: \"\",\n houseNumber: \"\",\n building: \"\",\n street: \"\",\n city: \"\",\n postalCode: \"\",\n country: \"\",\n addressLine: \"\",\n };\n}\n\nexport const AddressData: MessageFns<AddressData> = {\n encode(message: AddressData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.flat !== \"\") {\n writer.uint32(10).string(message.flat);\n }\n if (message.houseNumber !== \"\") {\n writer.uint32(18).string(message.houseNumber);\n }\n if (message.building !== \"\") {\n writer.uint32(26).string(message.building);\n }\n if (message.street !== \"\") {\n writer.uint32(34).string(message.street);\n }\n if (message.city !== \"\") {\n writer.uint32(42).string(message.city);\n }\n if (message.postalCode !== \"\") {\n writer.uint32(50).string(message.postalCode);\n }\n if (message.country !== \"\") {\n writer.uint32(58).string(message.country);\n }\n if (message.addressLine !== \"\") {\n writer.uint32(66).string(message.addressLine);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): AddressData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseAddressData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.flat = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.houseNumber = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.building = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.street = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.city = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.postalCode = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.country = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.addressLine = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): AddressData {\n return {\n flat: isSet(object.flat) ? globalThis.String(object.flat) : \"\",\n houseNumber: isSet(object.houseNumber) ? globalThis.String(object.houseNumber) : \"\",\n building: isSet(object.building) ? globalThis.String(object.building) : \"\",\n street: isSet(object.street) ? globalThis.String(object.street) : \"\",\n city: isSet(object.city) ? globalThis.String(object.city) : \"\",\n postalCode: isSet(object.postalCode) ? globalThis.String(object.postalCode) : \"\",\n country: isSet(object.country) ? globalThis.String(object.country) : \"\",\n addressLine: isSet(object.addressLine) ? globalThis.String(object.addressLine) : \"\",\n };\n },\n\n toJSON(message: AddressData): unknown {\n const obj: any = {};\n if (message.flat !== \"\") {\n obj.flat = message.flat;\n }\n if (message.houseNumber !== \"\") {\n obj.houseNumber = message.houseNumber;\n }\n if (message.building !== \"\") {\n obj.building = message.building;\n }\n if (message.street !== \"\") {\n obj.street = message.street;\n }\n if (message.city !== \"\") {\n obj.city = message.city;\n }\n if (message.postalCode !== \"\") {\n obj.postalCode = message.postalCode;\n }\n if (message.country !== \"\") {\n obj.country = message.country;\n }\n if (message.addressLine !== \"\") {\n obj.addressLine = message.addressLine;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<AddressData>, I>>(base?: I): AddressData {\n return AddressData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<AddressData>, I>>(object: I): AddressData {\n const message = createBaseAddressData();\n message.flat = object.flat ?? \"\";\n message.houseNumber = object.houseNumber ?? \"\";\n message.building = object.building ?? \"\";\n message.street = object.street ?? \"\";\n message.city = object.city ?? \"\";\n message.postalCode = object.postalCode ?? \"\";\n message.country = object.country ?? \"\";\n message.addressLine = object.addressLine ?? \"\";\n return message;\n },\n};\n\nfunction createBaseImage(): Image {\n return { contentType: \"\", data: new Uint8Array(0), provenance: 0 };\n}\n\nexport const Image: MessageFns<Image> = {\n encode(message: Image, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.contentType !== \"\") {\n writer.uint32(10).string(message.contentType);\n }\n if (message.data.length !== 0) {\n writer.uint32(18).bytes(message.data);\n }\n if (message.provenance !== 0) {\n writer.uint32(24).int32(message.provenance);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Image {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseImage();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.contentType = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.data = reader.bytes();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.provenance = reader.int32() as any;\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Image {\n return {\n contentType: isSet(object.contentType) ? globalThis.String(object.contentType) : \"\",\n data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),\n provenance: isSet(object.provenance) ? imageProvenanceFromJSON(object.provenance) : 0,\n };\n },\n\n toJSON(message: Image): unknown {\n const obj: any = {};\n if (message.contentType !== \"\") {\n obj.contentType = message.contentType;\n }\n if (message.data.length !== 0) {\n obj.data = base64FromBytes(message.data);\n }\n if (message.provenance !== 0) {\n obj.provenance = imageProvenanceToJSON(message.provenance);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Image>, I>>(base?: I): Image {\n return Image.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Image>, I>>(object: I): Image {\n const message = createBaseImage();\n message.contentType = object.contentType ?? \"\";\n message.data = object.data ?? new Uint8Array(0);\n message.provenance = object.provenance ?? 0;\n return message;\n },\n};\n\nfunction createBaseVideo(): Video {\n return { url: \"\" };\n}\n\nexport const Video: MessageFns<Video> = {\n encode(message: Video, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.url !== \"\") {\n writer.uint32(10).string(message.url);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Video {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseVideo();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.url = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Video {\n return { url: isSet(object.url) ? globalThis.String(object.url) : \"\" };\n },\n\n toJSON(message: Video): unknown {\n const obj: any = {};\n if (message.url !== \"\") {\n obj.url = message.url;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Video>, I>>(base?: I): Video {\n return Video.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Video>, I>>(object: I): Video {\n const message = createBaseVideo();\n message.url = object.url ?? \"\";\n return message;\n },\n};\n\nfunction createBaseDocument(): Document {\n return { personalData: undefined, documentData: undefined, addressData: undefined };\n}\n\nexport const Document: MessageFns<Document> = {\n encode(message: Document, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.personalData !== undefined) {\n PersonalData.encode(message.personalData, writer.uint32(10).fork()).join();\n }\n if (message.documentData !== undefined) {\n DocumentData.encode(message.documentData, writer.uint32(18).fork()).join();\n }\n if (message.addressData !== undefined) {\n AddressData.encode(message.addressData, writer.uint32(26).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Document {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDocument();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.personalData = PersonalData.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.documentData = DocumentData.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.addressData = AddressData.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Document {\n return {\n personalData: isSet(object.personalData) ? PersonalData.fromJSON(object.personalData) : undefined,\n documentData: isSet(object.documentData) ? DocumentData.fromJSON(object.documentData) : undefined,\n addressData: isSet(object.addressData) ? AddressData.fromJSON(object.addressData) : undefined,\n };\n },\n\n toJSON(message: Document): unknown {\n const obj: any = {};\n if (message.personalData !== undefined) {\n obj.personalData = PersonalData.toJSON(message.personalData);\n }\n if (message.documentData !== undefined) {\n obj.documentData = DocumentData.toJSON(message.documentData);\n }\n if (message.addressData !== undefined) {\n obj.addressData = AddressData.toJSON(message.addressData);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Document>, I>>(base?: I): Document {\n return Document.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Document>, I>>(object: I): Document {\n const message = createBaseDocument();\n message.personalData = (object.personalData !== undefined && object.personalData !== null)\n ? PersonalData.fromPartial(object.personalData)\n : undefined;\n message.documentData = (object.documentData !== undefined && object.documentData !== null)\n ? DocumentData.fromPartial(object.documentData)\n : undefined;\n message.addressData = (object.addressData !== undefined && object.addressData !== null)\n ? AddressData.fromPartial(object.addressData)\n : undefined;\n return message;\n },\n};\n\nfunction createBaseDetails(): Details {\n return { status: 0, docreaderRequestLog: \"\", docreaderResponseLog: \"\", faceapiResponseLog: \"\" };\n}\n\nexport const Details: MessageFns<Details> = {\n encode(message: Details, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.status !== 0) {\n writer.uint32(8).int32(message.status);\n }\n if (message.docreaderRequestLog !== \"\") {\n writer.uint32(18).string(message.docreaderRequestLog);\n }\n if (message.docreaderResponseLog !== \"\") {\n writer.uint32(26).string(message.docreaderResponseLog);\n }\n if (message.faceapiResponseLog !== \"\") {\n writer.uint32(34).string(message.faceapiResponseLog);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Details {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDetails();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.status = reader.int32() as any;\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.docreaderRequestLog = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.docreaderResponseLog = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.faceapiResponseLog = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Details {\n return {\n status: isSet(object.status) ? resultStatusFromJSON(object.status) : 0,\n docreaderRequestLog: isSet(object.docreaderRequestLog) ? globalThis.String(object.docreaderRequestLog) : \"\",\n docreaderResponseLog: isSet(object.docreaderResponseLog) ? globalThis.String(object.docreaderResponseLog) : \"\",\n faceapiResponseLog: isSet(object.faceapiResponseLog) ? globalThis.String(object.faceapiResponseLog) : \"\",\n };\n },\n\n toJSON(message: Details): unknown {\n const obj: any = {};\n if (message.status !== 0) {\n obj.status = resultStatusToJSON(message.status);\n }\n if (message.docreaderRequestLog !== \"\") {\n obj.docreaderRequestLog = message.docreaderRequestLog;\n }\n if (message.docreaderResponseLog !== \"\") {\n obj.docreaderResponseLog = message.docreaderResponseLog;\n }\n if (message.faceapiResponseLog !== \"\") {\n obj.faceapiResponseLog = message.faceapiResponseLog;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Details>, I>>(base?: I): Details {\n return Details.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Details>, I>>(object: I): Details {\n const message = createBaseDetails();\n message.status = object.status ?? 0;\n message.docreaderRequestLog = object.docreaderRequestLog ?? \"\";\n message.docreaderResponseLog = object.docreaderResponseLog ?? \"\";\n message.faceapiResponseLog = object.faceapiResponseLog ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMessage(): Message {\n return {\n document: undefined,\n frontImage: undefined,\n backImage: undefined,\n otherImage: undefined,\n details: undefined,\n liveness: undefined,\n };\n}\n\nexport const Message: MessageFns<Message> = {\n encode(message: Message, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.document !== undefined) {\n Document.encode(message.document, writer.uint32(10).fork()).join();\n }\n if (message.frontImage !== undefined) {\n Image.encode(message.frontImage, writer.uint32(18).fork()).join();\n }\n if (message.backImage !== undefined) {\n Image.encode(message.backImage, writer.uint32(26).fork()).join();\n }\n if (message.otherImage !== undefined) {\n Image.encode(message.otherImage, writer.uint32(34).fork()).join();\n }\n if (message.details !== undefined) {\n Details.encode(message.details, writer.uint32(42).fork()).join();\n }\n if (message.liveness !== undefined) {\n Video.encode(message.liveness, writer.uint32(50).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Message {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMessage();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.document = Document.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.frontImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.backImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.otherImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.details = Details.decode(reader, reader.uint32());\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.liveness = Video.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Message {\n return {\n document: isSet(object.document) ? Document.fromJSON(object.document) : undefined,\n frontImage: isSet(object.frontImage) ? Image.fromJSON(object.frontImage) : undefined,\n backImage: isSet(object.backImage) ? Image.fromJSON(object.backImage) : undefined,\n otherImage: isSet(object.otherImage) ? Image.fromJSON(object.otherImage) : undefined,\n details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,\n liveness: isSet(object.liveness) ? Video.fromJSON(object.liveness) : undefined,\n };\n },\n\n toJSON(message: Message): unknown {\n const obj: any = {};\n if (message.document !== undefined) {\n obj.document = Document.toJSON(message.document);\n }\n if (message.frontImage !== undefined) {\n obj.frontImage = Image.toJSON(message.frontImage);\n }\n if (message.backImage !== undefined) {\n obj.backImage = Image.toJSON(message.backImage);\n }\n if (message.otherImage !== undefined) {\n obj.otherImage = Image.toJSON(message.otherImage);\n }\n if (message.details !== undefined) {\n obj.details = Details.toJSON(message.details);\n }\n if (message.liveness !== undefined) {\n obj.liveness = Video.toJSON(message.liveness);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Message>, I>>(base?: I): Message {\n return Message.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Message>, I>>(object: I): Message {\n const message = createBaseMessage();\n message.document = (object.document !== undefined && object.document !== null)\n ? Document.fromPartial(object.document)\n : undefined;\n message.frontImage = (object.frontImage !== undefined && object.frontImage !== null)\n ? Image.fromPartial(object.frontImage)\n : undefined;\n message.backImage = (object.backImage !== undefined && object.backImage !== null)\n ? Image.fromPartial(object.backImage)\n : undefined;\n message.otherImage = (object.otherImage !== undefined && object.otherImage !== null)\n ? Image.fromPartial(object.otherImage)\n : undefined;\n message.details = (object.details !== undefined && object.details !== null)\n ? Details.fromPartial(object.details)\n : undefined;\n message.liveness = (object.liveness !== undefined && object.liveness !== null)\n ? Video.fromPartial(object.liveness)\n : undefined;\n return message;\n },\n};\n\nfunction bytesFromBase64(b64: string): Uint8Array {\n if ((globalThis as any).Buffer) {\n return Uint8Array.from(globalThis.Buffer.from(b64, \"base64\"));\n } else {\n const bin = globalThis.atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n }\n}\n\nfunction base64FromBytes(arr: Uint8Array): string {\n if ((globalThis as any).Buffer) {\n return globalThis.Buffer.from(arr).toString(\"base64\");\n } else {\n const bin: string[] = [];\n arr.forEach((byte) => {\n bin.push(globalThis.String.fromCharCode(byte));\n });\n return globalThis.btoa(bin.join(\"\"));\n }\n}\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;\n\nexport type DeepPartial<T> = T extends Builtin ? T\n : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\ntype KeysOfUnion<T> = T extends T ? keyof T : never;\nexport type Exact<P, I extends P> = P extends Builtin ? P\n : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };\n\nfunction isSet(value: any): boolean {\n return value !== null && value !== undefined;\n}\n\nexport interface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n fromJSON(object: any): T;\n toJSON(message: T): unknown;\n create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;\n fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;\n}\n","import { type Image, type ImageProvenance, Message } from \"../gen/dv_result\";\n\nexport interface ParsedKycMessages\n extends Pick<Message, \"document\" | \"frontImage\" | \"backImage\" | \"details\"> {\n otherImages?: Image[];\n}\n\nexport function decodeLengthPrefixedMessages(\n buffer: Uint8Array,\n): ParsedKycMessages {\n const result: ParsedKycMessages = {};\n let currentOffset = 0;\n\n while (currentOffset < buffer.length) {\n // Read the length prefix\n const { length, offset } = readVarint(buffer.slice(currentOffset));\n const messageStart = currentOffset + offset;\n const messageEnd = messageStart + length;\n\n // Check if we have enough bytes for the complete message\n if (buffer.length < messageEnd) {\n throw new Error(\"Incomplete Protobuf Message\");\n }\n\n // Extract and decode the message\n const messageBuffer = buffer.slice(messageStart, messageEnd);\n const message = Message.decode(messageBuffer);\n\n // Organize by message type\n if (message.document) {\n result.document = message.document;\n } else if (message.frontImage) {\n result.frontImage = message.frontImage;\n } else if (message.backImage) {\n result.backImage = message.backImage;\n } else if (message.otherImage) {\n result.otherImages = result.otherImages ?? [];\n result.otherImages.push(message.otherImage);\n } else if (message.details) {\n result.details = message.details;\n }\n\n // Move to the next message\n currentOffset = messageEnd;\n }\n\n return result;\n}\n\nexport function readVarint(buffer: Uint8Array): {\n length: number;\n offset: number;\n} {\n let result = 0,\n shift = 0,\n offset = 0;\n const maxBytes = Math.min(buffer.length, 5);\n\n for (let i = 0; i < maxBytes; i++) {\n const byte = buffer[offset];\n if (byte === undefined) {\n break;\n }\n\n offset++;\n result |= (byte & 0x7f) << shift;\n\n if ((byte & 0x80) === 0) {\n return { length: result, offset };\n }\n\n shift += 7;\n }\n\n throw new Error(\"Malformed Varint: Too many bytes without termination.\");\n}\n\nexport interface SDKDvImageData {\n fileBuffer: Uint8Array;\n contentType: string;\n provenance: ImageProvenance;\n}\n\nexport function processDvImage(image: Image): SDKDvImageData {\n return {\n fileBuffer: image.data,\n contentType: image.contentType,\n provenance: image.provenance,\n };\n}\n","import { ensureApiKeyType } from \"./utils/guards\";\nimport { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER } from \"./constants\";\nimport type { SDKOptions } from \"./types\";\nimport type { components } from \"../public/openapi\";\nimport { decodeLengthPrefixedMessages } from \"./utils/protobuf\";\n\ninterface GetFlowResultParams {\n organizationId: string;\n flowResultId: string;\n isSandbox: boolean;\n}\n\ninterface ListFlowResultsParams {\n organizationId: string;\n flowSlug: string;\n isSandbox: boolean;\n pagination?: components[\"schemas\"][\"Pagination\"];\n locale?: components[\"schemas\"][\"Locale\"];\n}\n\nexport async function listFlowResults(\n {\n organizationId,\n flowSlug,\n isSandbox,\n pagination,\n locale,\n }: ListFlowResultsParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n return client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/flow/{flow_slug}/list\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_slug: flowSlug,\n },\n query: {\n pagination,\n sandbox: isSandbox,\n locale,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n },\n );\n}\n\nexport async function getFlowResult(\n { organizationId, flowResultId, isSandbox }: GetFlowResultParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n const response = await client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/{flow_result_id}/details\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_result_id: flowResultId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n },\n );\n\n const { data, ...rest } = response;\n\n return {\n ...rest,\n data: {\n ...data,\n dvResults: data?.dvResults.toSorted((a, b) => {\n return b.createdAt?.localeCompare(a.createdAt ?? \"\") ?? 0;\n }),\n amlResults: data?.amlResults.toSorted((a, b) => {\n return b.createdAt.localeCompare(a.createdAt);\n }),\n poaResults: data?.poaResults.toSorted((a, b) => {\n return b.createdAt.localeCompare(a.createdAt);\n }),\n },\n };\n}\n\ninterface GetDvResultParams extends GetFlowResultParams {\n dvResultId: string;\n}\n\nexport async function getDvResult(\n { organizationId, flowResultId, dvResultId, isSandbox }: GetDvResultParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n const response = await client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/{flow_result_id}/dv/{dv_result_id}/details\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_result_id: flowResultId,\n dv_result_id: dvResultId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n Accept: \"application/x-protobuf\",\n },\n parseAs: \"arrayBuffer\",\n },\n );\n\n const { data, ...rest } = response;\n\n return {\n ...rest,\n data: data ? decodeLengthPrefixedMessages(new Uint8Array(data)) : undefined,\n };\n}\n","import type { components, paths } from \"../public/openapi\";\nimport type { Environment } from \"./constants\";\n\nexport type SdkCreateVerificationRequestResponse =\n components[\"schemas\"][\"SdkCreateVerificationRequestResponse\"];\n\nexport type Locale = components[\"schemas\"][\"Locale\"];\n\nexport type GetLivenessChallengeResponse =\n components[\"schemas\"][\"GetLivenessChallengeResponse\"];\n\nexport type ProcessDocumentSelectionPayload =\n components[\"schemas\"][\"ProcessDocumentSelectionPayload\"];\n\nexport type ProcessDocumentSelectionResponse =\n components[\"schemas\"][\"ProcessDocumentSelectionResponse\"];\n\nexport type ProcessIdentityDocumentPayload =\n components[\"schemas\"][\"ProcessIdentityDocumentPayload\"];\n\nexport type ProcessIdentityDocumentResponse =\n components[\"schemas\"][\"ProcessIdentityDocumentResponse\"];\n\nexport type ProcessLivenessPayload =\n components[\"schemas\"][\"ProcessLivenessPayload\"];\n\nexport type ProcessDvDocumentPayload =\n paths[\"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-document\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\nexport type ProcessDocumentSelectionRequestPayload =\n paths[\"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-selection\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\nexport type ProcessLivenessResponse =\n components[\"schemas\"][\"ProcessLivenessResponse\"];\n\nexport type ApiKeyType = components[\"schemas\"][\"ApiKeyType\"];\n\nexport type FlowStepType = components[\"schemas\"][\"FlowStepType\"];\n\nexport type BaxeError = components[\"schemas\"][\"BaxeError\"];\n\n/**\n * Parameters for initializing the Zyphe iframe for a Flow.\n * These will remain constant for each user that visits the Flow URL.\n */\nexport interface InitializeZypheFlowParams {\n /**\n * The ID of the Flow\n * UUID v4 format\n * @example \"4810bc63-bfdd-4487-ae57-c939046f56b6\"\n */\n flowId: string;\n /**\n * The ID of the FlowStep\n * UUID v4 format\n * @example \"4810bc63-bfdd-4487-ae57-c939046f56b6\"\n */\n flowStepId: string;\n /**\n * The email of the user.\n * @example \"user@example.com\"\n */\n email: string;\n /**\n * The type of Flow URL.\n * The third path segment of your Flow URL.\n * @example \"http://localhost:5173/flow/flowSlug/kyc/stepSlug\"\n */\n product: \"kyc\"; //| \"kyb\";\n /**\n * Whether the Flow is a \"sandbox\" Flow.\n *\n * This will prepend \"sandbox\" to the final URL.\n * @example \"http://localhost:5173/sandbox/flow/flowSlug/kyc/stepSlug\"\n */\n isSandbox: boolean;\n /**\n * Custom data to be passed to the Flow.\n * @example { \"custom_data\": \"custom_value\" }\n */\n customData?: Record<string, string>;\n}\n\nexport type GetNextStepDetailsParams = Pick<\n InitializeZypheFlowParams,\n \"flowId\" | \"isSandbox\" | \"email\"\n>;\n\nexport interface VerificationRequestParams {\n flowId: string;\n verificationRequestId: string;\n isSandbox: boolean;\n}\n\nexport interface ProcessDvLivenessParams extends VerificationRequestParams {\n payload: ProcessLivenessPayload;\n}\n\nexport interface SDKOptions {\n apiKey: string;\n /**\n * The environment to use for the SDK.\n * This will determine the base URL for the API and the Flow URL.\n *\n * If not provided, we will default to \"production\".\n *\n * @default \"production\"\n */\n environment?: Environment;\n /**\n * If set, the QR code displayed on desktop devices of a Document Verification flow will direct to this URL.\n * If not set, the QR code will direct to the corresponding zyphe.com URL, depending upon your configured environment.\n *\n * The URL will include the query parameters `zypheVr`, `zypheToken`, and\n * `zypheAccessSig`.\n *\n * @default \"https://app-dev.zyphe.com\" || \"https://verify.zyphe.com\"\n * @example \"http://example.com\"\n */\n handoffBaseUrl?: string;\n /**\n * The main background color of the page.\n * This will override the primary color configured in verify.zyphe.com\n *\n * The accepted values are flexible, but we recommend a hex code.\n * @example \"#000000\"\n */\n primaryColor?: string;\n /**\n * The accent color of the page, used for buttons, icons, etc.\n * This will override the secondary color configured in verify.zyphe.com\n *\n * The accepted values are flexible, but we recommend a hex code.\n * @example \"#000000\"\n */\n secondaryColor?: string;\n /**\n * If true, the verification session will be displayed in \"fullscreen\" mode.\n */\n isFullscreen?: boolean;\n}\n\nexport interface VerificationSessionRequestOptions {\n verificationSession: SdkCreateVerificationRequestResponse;\n options: SDKOptions;\n}\n\nexport interface ProcessDvDocumentOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessDvDocumentPayload;\n}\n\nexport interface ProcessDocumentSelectionOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessDocumentSelectionRequestPayload;\n}\n\nexport interface ProcessDvLivenessOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessLivenessPayload;\n}\n\nexport interface GetLivenessChallengeOptions\n extends VerificationSessionRequestOptions {}\n\nexport interface CreateVerificationSessionParams {\n email: string;\n flowId: string;\n flowStepId: string;\n isSandbox: boolean;\n customData?: Record<string, string>;\n}\n\nexport const DocumentType = {\n IDENTITY_CARD: 12,\n DRIVING_LICENSE: 49,\n PASSPORT: 11,\n} as const;\n\nexport type DocumentType = (typeof DocumentType)[keyof typeof DocumentType];\n","import { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER, EnvironmentConfigs, Environments } from \"./constants\";\nimport type {\n CreateVerificationSessionParams,\n GetNextStepDetailsParams,\n InitializeZypheFlowParams,\n SdkCreateVerificationRequestResponse,\n SDKOptions,\n} from \"./types\";\n\nexport function createVerificationSession(\n {\n email,\n flowId,\n flowStepId,\n isSandbox,\n customData,\n }: CreateVerificationSessionParams,\n opts: SDKOptions,\n) {\n const client = zypheApiClient(opts);\n\n return client.POST(\"/sdk/flow/{flow_id}/vr/create\", {\n body: { email, flowStepId, customData },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n params: {\n path: {\n flow_id: flowId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n });\n}\n\nfunction getFlowUrlOrigin(\n environment: SDKOptions[\"environment\"] = Environments.PRODUCTION,\n) {\n return EnvironmentConfigs[environment].appUrl;\n}\n\nexport function constructVerificationSessionUrl({\n flowParams,\n verificationSession,\n opts,\n}: {\n flowParams: InitializeZypheFlowParams;\n verificationSession: SdkCreateVerificationRequestResponse;\n opts: SDKOptions;\n}) {\n const origin = getFlowUrlOrigin(opts.environment);\n const { email, isSandbox, product } = flowParams;\n const { handoffBaseUrl, primaryColor, secondaryColor, isFullscreen } = opts;\n\n if (!verificationSession) {\n throw new Error(\"Failed to create verification session\");\n }\n\n const zypheEmail = verificationSession.email || email;\n\n let baseUrl = `${origin}${isSandbox ? \"/sandbox\" : \"\"}/flow/${verificationSession.flowSlug}/${product}/${verificationSession.flowStepSlug}?zypheVr=${encodeURIComponent(verificationSession.verificationRequest.id)}&zypheEmail=${encodeURIComponent(zypheEmail)}&zypheToken=${encodeURIComponent(verificationSession.zypheToken)}`;\n\n if (handoffBaseUrl) {\n baseUrl += `&zypheHandoffBaseUrl=${encodeURIComponent(handoffBaseUrl)}`;\n }\n\n if (primaryColor) {\n baseUrl += `&zyphePrimaryColor=${encodeURIComponent(primaryColor)}`;\n }\n\n if (secondaryColor) {\n baseUrl += `&zypheSecondaryColor=${encodeURIComponent(secondaryColor)}`;\n }\n\n if (isFullscreen) {\n baseUrl += `&zypheFullscreen=${encodeURIComponent(isFullscreen)}`;\n }\n\n if(verificationSession.zypheAccessSig) {\n baseUrl += `&zypheAccessSig=${encodeURIComponent(verificationSession.zypheAccessSig)}`;\n }\n\n return baseUrl;\n}\n\nexport function getNextStepDetails(\n flowParams: GetNextStepDetailsParams,\n opts: SDKOptions,\n) {\n const client = zypheApiClient(opts);\n\n return client.GET(\"/sdk/flow/{flow_id}/vr/next-step\", {\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n params: {\n path: {\n flow_id: flowParams.flowId,\n },\n query: {\n sandbox: flowParams.isSandbox,\n email: flowParams.email,\n },\n },\n });\n}\n","export interface SignatureComponents {\n timestamp: string;\n signatureHex: string;\n}\n\n/**\n * Parses a webhook signature header of the form \"t=<timestamp>,v0=<signature>\"\n * @param signatureHeader - The header string, e.g. \"t=1234567890,v0=abcdef...\"\n * @returns The parsed timestamp and signature hex\n */\nexport function parseSignatureHeader(\n signatureHeader: string,\n): SignatureComponents {\n const match = signatureHeader.match(/^t=(\\d+),v0=([a-fA-F0-9]+)$/);\n if (!match) {\n throw new Error(\"Invalid signature header format\");\n }\n const [, timestamp, signatureHex] = match;\n\n if (!timestamp || !signatureHex) {\n throw new Error(\"Invalid signature header format\");\n }\n\n return { timestamp, signatureHex };\n}\n\n/**\n * Converts a hex string to a Uint8Array\n * @param hex - The hex string to convert\n * @returns The resulting Uint8Array\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (hex.length % 2 !== 0) throw new Error(\"Invalid hex string\");\n const bytes = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);\n }\n return bytes;\n}\n\n/**\n * Converts an ArrayBuffer to a hex string\n * @param buffer - The buffer to convert\n * @returns The hex string representation\n */\nexport function bufferToHex(buffer: ArrayBuffer): string {\n return Array.from(new Uint8Array(buffer))\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n\n/**\n * Compares two strings in constant time to prevent timing attacks\n * @param a - First string\n * @param b - Second string\n * @returns True if strings are equal, false otherwise\n */\nexport function timingSafeEqual(a: string, b: string): boolean {\n if (a.length !== b.length) return false;\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a.charCodeAt(i) ^ b.charCodeAt(i);\n }\n return result === 0;\n}\n\nexport const WebhookSignatureErrorCodes = {\n MISSING_SIGNATURE_HEADER: 1,\n INVALID_SIGNATURE_HEADER: 2,\n SIGNATURE_MISMATCH: 3,\n} as const;\n\nexport const WebhookSignatureErrorMessages = {\n [WebhookSignatureErrorCodes.MISSING_SIGNATURE_HEADER]:\n \"Missing signature header\",\n [WebhookSignatureErrorCodes.INVALID_SIGNATURE_HEADER]:\n \"Invalid signature header\",\n [WebhookSignatureErrorCodes.SIGNATURE_MISMATCH]: \"Signature mismatch\",\n} as const;\n\nexport interface WebhookVerifierOptions<T extends Function> {\n /**\n * The hex-encoded secret key used to verify the signature\n */\n secretHex: string;\n\n /**\n * The name of the header containing the signature\n * @default \"x-signature\"\n */\n signatureHeader?: string;\n\n /**\n * Optional function to handle unauthorized requests\n * @default Returns 401 Unauthorized with JSON error\n */\n onUnauthorized?: T;\n\n /**\n * Whether to make the raw body available on req.rawBody\n * @default true\n */\n exposeRawBody?: boolean;\n}\n"],"mappings":";AAAA,OAAO,kBAAuC;;;ACAvC,IAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,YAAY;AACd;AASO,IAAM,qBAAqB;AAAA,EAChC,CAAC,aAAa,KAAK,GAAG;AAAA,IACpB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,OAAO,GAAG;AAAA,IACtB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,UAAU,GAAG;AAAA,IACzB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;AAEO,IAAM,iBAAiB;;;ADvBvB,IAAM,iBAAiB,CAAC,SAAqB;AAElD,QAAM,cAAc,KAAK,eAAe,aAAa;AAErD,SAAO,aAAoB;AAAA,IACzB,SAAS,mBAAmB,WAAW,EAAE;AAAA,EAC3C,CAAC;AACH;;;AENO,IAAM,aAAN,MAAM,oBAAmB,MAAM;AAAA,EACpC;AAAA,EACA,YAAY,SAAiB,SAA6B;AACxD,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,WAAW,SAAS;AAAA,EA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A2B,kBAAkB,GAAG;AACnD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/constants.ts","../src/sdk-error.ts","../src/complete-step.ts","../src/utils/guards.ts","../src/gen/dv_result.ts","../src/utils/protobuf.ts","../src/flow-results.ts","../src/types.ts","../src/verification-session.ts","../src/webhook.ts"],"sourcesContent":["import createClient, { type Middleware } from \"openapi-fetch\";\nimport type { paths } from \"../public/openapi\";\nimport { EnvironmentConfigs, Environments } from \"./constants\";\nimport type { SDKOptions } from \"./types\";\n\nexport const zypheApiClient = (opts: SDKOptions) => {\n // Default to production if no environment is provided\n const environment = opts.environment ?? Environments.PRODUCTION;\n\n return createClient<paths>({\n baseUrl: EnvironmentConfigs[environment].apiUrl,\n });\n};\n","export const Environments = {\n LOCAL: \"local\",\n STAGING: \"staging\",\n PRODUCTION: \"production\",\n} as const;\n\nexport type Environment = (typeof Environments)[keyof typeof Environments];\n\ninterface EnvironmentConfig {\n appUrl: string;\n apiUrl: string;\n}\n\nexport const EnvironmentConfigs = {\n [Environments.LOCAL]: {\n appUrl: \"http://localhost:5173\",\n apiUrl: \"http://localhost:3000\",\n },\n [Environments.STAGING]: {\n appUrl: \"https://app-dev.zyphe.com\",\n apiUrl: \"https://api-dev.zyphe.com\",\n },\n [Environments.PRODUCTION]: {\n appUrl: \"https://verify.zyphe.com\",\n apiUrl: \"https://api.zyphe.com\",\n },\n} as const satisfies Record<Environment, EnvironmentConfig>;\n\nexport const API_KEY_HEADER = \"x-api-key\";\n","import type { BaxeError } from \"./types\";\n\ninterface ZypheErrorOptions extends ErrorOptions {\n errorTag?: string;\n}\n\nexport class ZypheError extends Error {\n errorTag?: string;\n constructor(message: string, options?: ZypheErrorOptions) {\n super(message, { cause: options?.cause });\n this.errorTag = options?.errorTag;\n }\n\n static fromBaxeError(error: BaxeError): ZypheError {\n return new ZypheError(error.message ?? \"An unexpected error occurred\", {\n errorTag: error.errorTag,\n });\n }\n}\n","import { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER } from \"./constants\";\nimport { ZypheError } from \"./sdk-error\";\nimport type {\n ProcessDocumentSelectionRequestPayload,\n ProcessDocumentSelectionResponse,\n ProcessIdentityDocumentResponse,\n ProcessLivenessResponse,\n SdkCreateVerificationRequestResponse,\n SDKOptions,\n} from \"./types\";\n\ntype UploadBody = ArrayBufferView | ArrayBuffer;\n\ninterface UploadResponse {\n ok: boolean;\n}\n\ndeclare const fetch: (\n input: string,\n init: {\n method: \"PUT\";\n body: UploadBody;\n },\n) => Promise<UploadResponse>;\n\ninterface CompleteDvStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n countryCode: string;\n images:\n | { type: \"DOUBLE_SIDED_DOCUMENT\"; frontImage: string; backImage: string }\n | { type: \"SINGLE_SIDED_DOCUMENT\"; image: string };\n}\n\nexport async function completeDvStep(\n { verificationSession, countryCode, images }: CompleteDvStepParams,\n options: SDKOptions,\n): Promise<ProcessIdentityDocumentResponse> {\n const client = zypheApiClient(options);\n\n const response = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-document\",\n {\n body: {\n countryCode,\n images:\n images.type === \"SINGLE_SIDED_DOCUMENT\"\n ? [\n {\n pageIndex: \"front\",\n source: \"file\",\n value: images.image,\n },\n ]\n : [\n {\n pageIndex: \"front\",\n source: \"file\",\n value: images.frontImage,\n },\n {\n pageIndex: \"back\",\n source: \"file\",\n value: images.backImage,\n },\n ],\n },\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (response.error) {\n throw ZypheError.fromBaxeError(response.error);\n }\n\n return response.data;\n}\n\nexport interface CompleteLivenessStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n frontImage: Uint8Array;\n movementImages?: Uint8Array[];\n video?: Uint8Array;\n}\n\nexport async function completeLivenessStep(\n {\n verificationSession,\n frontImage,\n movementImages = [],\n video,\n }: CompleteLivenessStepParams,\n options: SDKOptions,\n): Promise<ProcessLivenessResponse> {\n const client = zypheApiClient(options);\n\n const challengeResponse = await client.GET(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/liveness-challenge\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (challengeResponse.error) {\n throw ZypheError.fromBaxeError(challengeResponse.error);\n }\n\n const challenge = challengeResponse.data;\n\n // Validate ACTIVE-mode inputs before uploading anything\n if (challenge.mode === \"ACTIVE\") {\n if (!video) {\n throw new ZypheError(\"Missing liveness video for active challenge\");\n }\n if (movementImages.length !== challenge.movementImages.length) {\n throw new ZypheError(\n \"Movement image count does not match active challenge\",\n );\n }\n }\n\n const calibrationUploadResponse = await fetch(\n challenge.calibrationImage.presignedUrl,\n {\n method: \"PUT\",\n body: frontImage,\n },\n );\n\n if (!calibrationUploadResponse.ok) {\n throw new ZypheError(\"Failed to upload front image\");\n }\n\n if (challenge.mode === \"ACTIVE\") {\n const videoUploadResponse = await fetch(challenge.video.presignedUrl, {\n method: \"PUT\",\n body: video as UploadBody,\n });\n\n if (!videoUploadResponse.ok) {\n throw new ZypheError(\"Failed to upload liveness video\");\n }\n\n for (const [index, movementImage] of challenge.movementImages.entries()) {\n const movementUploadResponse = await fetch(movementImage.presignedUrl, {\n method: \"PUT\",\n body: movementImages[index] as UploadBody,\n });\n\n if (!movementUploadResponse.ok) {\n throw new ZypheError(`Failed to upload movement image ${index + 1}`);\n }\n }\n }\n\n const processDvLivenessResponse = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-liveness\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n body: {\n challengeId: challenge.id,\n movementImagesQuantity: movementImages.length,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n },\n );\n\n if (processDvLivenessResponse.error) {\n throw ZypheError.fromBaxeError(processDvLivenessResponse.error);\n }\n\n return processDvLivenessResponse.data;\n}\n\ninterface CompleteDocumentSelectionStepParams {\n verificationSession: SdkCreateVerificationRequestResponse;\n payload: ProcessDocumentSelectionRequestPayload;\n}\n\nexport async function completeDocumentSelectionStep(\n { verificationSession, payload }: CompleteDocumentSelectionStepParams,\n options: SDKOptions,\n): Promise<ProcessDocumentSelectionResponse> {\n const client = zypheApiClient(options);\n\n const processDocumentSelectionResponse = await client.POST(\n \"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-selection\",\n {\n headers: {\n [API_KEY_HEADER]: options.apiKey,\n },\n params: {\n path: {\n flow_id: verificationSession.verificationRequest.flowId,\n verification_request_id: verificationSession.verificationRequest.id,\n },\n query: {\n sandbox: verificationSession.isSandbox,\n },\n },\n body: payload,\n },\n );\n\n if (processDocumentSelectionResponse.error) {\n throw ZypheError.fromBaxeError(processDocumentSelectionResponse.error);\n }\n\n return processDocumentSelectionResponse.data;\n}\n","import type { ApiKeyType } from \"../types\";\n\nconst ApiKeyTypes = {\n PUBLISHABLE: \"zyphe_pk_\",\n SECRET: \"zyphe_sk_\",\n} as const satisfies Record<ApiKeyType, string>;\n\n/**\n * Ensures that the API key is of the specified type.\n * @param apiKey - The API key to check.\n * @param type - The type of API key to check for.\n * @throws An error if the API key is not of the specified type.\n */\nexport function ensureApiKeyType(apiKey: string, types: ApiKeyType[]) {\n if (!types.some((type) => apiKey.startsWith(ApiKeyTypes[type]))) {\n throw new Error(\n `Invalid API key. This function is only available for ${types.join(\n \", \",\n )} keys`,\n );\n }\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.7.5\n// protoc unknown\n// source: dv_result.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\n\nexport const protobufPackage = \"dv_result_proto\";\n\nexport enum ImageProvenance {\n UNSPECIFIED_IMAGE_PROVENANCE = 0,\n FRONT_DOCUMENT_IMAGE = 1,\n BACK_DOCUMENT_IMAGE = 2,\n SIGNATURE_IMAGE = 3,\n PORTRAIT_IMAGE = 5,\n CITIZENSHIP_IMAGE = 6,\n SELFIE_IMAGE = 7,\n UNRECOGNIZED = -1,\n}\n\nexport function imageProvenanceFromJSON(object: any): ImageProvenance {\n switch (object) {\n case 0:\n case \"UNSPECIFIED_IMAGE_PROVENANCE\":\n return ImageProvenance.UNSPECIFIED_IMAGE_PROVENANCE;\n case 1:\n case \"FRONT_DOCUMENT_IMAGE\":\n return ImageProvenance.FRONT_DOCUMENT_IMAGE;\n case 2:\n case \"BACK_DOCUMENT_IMAGE\":\n return ImageProvenance.BACK_DOCUMENT_IMAGE;\n case 3:\n case \"SIGNATURE_IMAGE\":\n return ImageProvenance.SIGNATURE_IMAGE;\n case 5:\n case \"PORTRAIT_IMAGE\":\n return ImageProvenance.PORTRAIT_IMAGE;\n case 6:\n case \"CITIZENSHIP_IMAGE\":\n return ImageProvenance.CITIZENSHIP_IMAGE;\n case 7:\n case \"SELFIE_IMAGE\":\n return ImageProvenance.SELFIE_IMAGE;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ImageProvenance.UNRECOGNIZED;\n }\n}\n\nexport function imageProvenanceToJSON(object: ImageProvenance): string {\n switch (object) {\n case ImageProvenance.UNSPECIFIED_IMAGE_PROVENANCE:\n return \"UNSPECIFIED_IMAGE_PROVENANCE\";\n case ImageProvenance.FRONT_DOCUMENT_IMAGE:\n return \"FRONT_DOCUMENT_IMAGE\";\n case ImageProvenance.BACK_DOCUMENT_IMAGE:\n return \"BACK_DOCUMENT_IMAGE\";\n case ImageProvenance.SIGNATURE_IMAGE:\n return \"SIGNATURE_IMAGE\";\n case ImageProvenance.PORTRAIT_IMAGE:\n return \"PORTRAIT_IMAGE\";\n case ImageProvenance.CITIZENSHIP_IMAGE:\n return \"CITIZENSHIP_IMAGE\";\n case ImageProvenance.SELFIE_IMAGE:\n return \"SELFIE_IMAGE\";\n case ImageProvenance.UNRECOGNIZED:\n default:\n return \"UNRECOGNIZED\";\n }\n}\n\nexport enum ResultStatus {\n FAILED = 0,\n PASSED = 1,\n PARTIAL = 2,\n REQUIRES_MANUAL_REVIEW = 3,\n REQUIRES_ADMIN_REVIEW = 4,\n MANUALLY_APPROVED = 5,\n MANUALLY_REJECTED = 6,\n UNRECOGNIZED = -1,\n}\n\nexport function resultStatusFromJSON(object: any): ResultStatus {\n switch (object) {\n case 0:\n case \"FAILED\":\n return ResultStatus.FAILED;\n case 1:\n case \"PASSED\":\n return ResultStatus.PASSED;\n case 2:\n case \"PARTIAL\":\n return ResultStatus.PARTIAL;\n case 3:\n case \"REQUIRES_MANUAL_REVIEW\":\n return ResultStatus.REQUIRES_MANUAL_REVIEW;\n case 4:\n case \"REQUIRES_ADMIN_REVIEW\":\n return ResultStatus.REQUIRES_ADMIN_REVIEW;\n case 5:\n case \"MANUALLY_APPROVED\":\n return ResultStatus.MANUALLY_APPROVED;\n case 6:\n case \"MANUALLY_REJECTED\":\n return ResultStatus.MANUALLY_REJECTED;\n case -1:\n case \"UNRECOGNIZED\":\n default:\n return ResultStatus.UNRECOGNIZED;\n }\n}\n\nexport function resultStatusToJSON(object: ResultStatus): string {\n switch (object) {\n case ResultStatus.FAILED:\n return \"FAILED\";\n case ResultStatus.PASSED:\n return \"PASSED\";\n case ResultStatus.PARTIAL:\n return \"PARTIAL\";\n case ResultStatus.REQUIRES_MANUAL_REVIEW:\n return \"REQUIRES_MANUAL_REVIEW\";\n case ResultStatus.REQUIRES_ADMIN_REVIEW:\n return \"REQUIRES_ADMIN_REVIEW\";\n case ResultStatus.MANUALLY_APPROVED:\n return \"MANUALLY_APPROVED\";\n case ResultStatus.MANUALLY_REJECTED:\n return \"MANUALLY_REJECTED\";\n case ResultStatus.UNRECOGNIZED:\n default:\n return \"UNRECOGNIZED\";\n }\n}\n\nexport interface PersonalData {\n givenName: string;\n surname: string;\n dateOfBirth: string;\n nationality: string;\n gender: string;\n placeOfBirth: string;\n personalNumber: string;\n}\n\nexport interface DocumentData {\n documentNumber: string;\n issuingState: string;\n issuingAuthority: string;\n expiryDate: string;\n documentClassCode: string;\n mrzStrings: string;\n documentCan: string;\n}\n\nexport interface AddressData {\n flat: string;\n houseNumber: string;\n building: string;\n street: string;\n city: string;\n postalCode: string;\n country: string;\n addressLine: string;\n}\n\nexport interface Image {\n contentType: string;\n data: Uint8Array;\n provenance: ImageProvenance;\n}\n\nexport interface Video {\n url: string;\n}\n\nexport interface Document {\n personalData: PersonalData | undefined;\n documentData: DocumentData | undefined;\n addressData: AddressData | undefined;\n}\n\nexport interface Details {\n status: ResultStatus;\n docreaderRequestLog: string;\n docreaderResponseLog: string;\n faceapiResponseLog: string;\n}\n\nexport interface Message {\n document?: Document | undefined;\n frontImage?: Image | undefined;\n backImage?: Image | undefined;\n otherImage?: Image | undefined;\n details?: Details | undefined;\n liveness?: Video | undefined;\n}\n\nfunction createBasePersonalData(): PersonalData {\n return {\n givenName: \"\",\n surname: \"\",\n dateOfBirth: \"\",\n nationality: \"\",\n gender: \"\",\n placeOfBirth: \"\",\n personalNumber: \"\",\n };\n}\n\nexport const PersonalData: MessageFns<PersonalData> = {\n encode(message: PersonalData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.givenName !== \"\") {\n writer.uint32(10).string(message.givenName);\n }\n if (message.surname !== \"\") {\n writer.uint32(18).string(message.surname);\n }\n if (message.dateOfBirth !== \"\") {\n writer.uint32(26).string(message.dateOfBirth);\n }\n if (message.nationality !== \"\") {\n writer.uint32(34).string(message.nationality);\n }\n if (message.gender !== \"\") {\n writer.uint32(42).string(message.gender);\n }\n if (message.placeOfBirth !== \"\") {\n writer.uint32(50).string(message.placeOfBirth);\n }\n if (message.personalNumber !== \"\") {\n writer.uint32(58).string(message.personalNumber);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): PersonalData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePersonalData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.givenName = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.surname = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.dateOfBirth = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.nationality = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.gender = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.placeOfBirth = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.personalNumber = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): PersonalData {\n return {\n givenName: isSet(object.givenName) ? globalThis.String(object.givenName) : \"\",\n surname: isSet(object.surname) ? globalThis.String(object.surname) : \"\",\n dateOfBirth: isSet(object.dateOfBirth) ? globalThis.String(object.dateOfBirth) : \"\",\n nationality: isSet(object.nationality) ? globalThis.String(object.nationality) : \"\",\n gender: isSet(object.gender) ? globalThis.String(object.gender) : \"\",\n placeOfBirth: isSet(object.placeOfBirth) ? globalThis.String(object.placeOfBirth) : \"\",\n personalNumber: isSet(object.personalNumber) ? globalThis.String(object.personalNumber) : \"\",\n };\n },\n\n toJSON(message: PersonalData): unknown {\n const obj: any = {};\n if (message.givenName !== \"\") {\n obj.givenName = message.givenName;\n }\n if (message.surname !== \"\") {\n obj.surname = message.surname;\n }\n if (message.dateOfBirth !== \"\") {\n obj.dateOfBirth = message.dateOfBirth;\n }\n if (message.nationality !== \"\") {\n obj.nationality = message.nationality;\n }\n if (message.gender !== \"\") {\n obj.gender = message.gender;\n }\n if (message.placeOfBirth !== \"\") {\n obj.placeOfBirth = message.placeOfBirth;\n }\n if (message.personalNumber !== \"\") {\n obj.personalNumber = message.personalNumber;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<PersonalData>, I>>(base?: I): PersonalData {\n return PersonalData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<PersonalData>, I>>(object: I): PersonalData {\n const message = createBasePersonalData();\n message.givenName = object.givenName ?? \"\";\n message.surname = object.surname ?? \"\";\n message.dateOfBirth = object.dateOfBirth ?? \"\";\n message.nationality = object.nationality ?? \"\";\n message.gender = object.gender ?? \"\";\n message.placeOfBirth = object.placeOfBirth ?? \"\";\n message.personalNumber = object.personalNumber ?? \"\";\n return message;\n },\n};\n\nfunction createBaseDocumentData(): DocumentData {\n return {\n documentNumber: \"\",\n issuingState: \"\",\n issuingAuthority: \"\",\n expiryDate: \"\",\n documentClassCode: \"\",\n mrzStrings: \"\",\n documentCan: \"\",\n };\n}\n\nexport const DocumentData: MessageFns<DocumentData> = {\n encode(message: DocumentData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.documentNumber !== \"\") {\n writer.uint32(10).string(message.documentNumber);\n }\n if (message.issuingState !== \"\") {\n writer.uint32(18).string(message.issuingState);\n }\n if (message.issuingAuthority !== \"\") {\n writer.uint32(26).string(message.issuingAuthority);\n }\n if (message.expiryDate !== \"\") {\n writer.uint32(34).string(message.expiryDate);\n }\n if (message.documentClassCode !== \"\") {\n writer.uint32(42).string(message.documentClassCode);\n }\n if (message.mrzStrings !== \"\") {\n writer.uint32(50).string(message.mrzStrings);\n }\n if (message.documentCan !== \"\") {\n writer.uint32(58).string(message.documentCan);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): DocumentData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDocumentData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.documentNumber = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.issuingState = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.issuingAuthority = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.expiryDate = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.documentClassCode = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.mrzStrings = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.documentCan = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): DocumentData {\n return {\n documentNumber: isSet(object.documentNumber) ? globalThis.String(object.documentNumber) : \"\",\n issuingState: isSet(object.issuingState) ? globalThis.String(object.issuingState) : \"\",\n issuingAuthority: isSet(object.issuingAuthority) ? globalThis.String(object.issuingAuthority) : \"\",\n expiryDate: isSet(object.expiryDate) ? globalThis.String(object.expiryDate) : \"\",\n documentClassCode: isSet(object.documentClassCode) ? globalThis.String(object.documentClassCode) : \"\",\n mrzStrings: isSet(object.mrzStrings) ? globalThis.String(object.mrzStrings) : \"\",\n documentCan: isSet(object.documentCan) ? globalThis.String(object.documentCan) : \"\",\n };\n },\n\n toJSON(message: DocumentData): unknown {\n const obj: any = {};\n if (message.documentNumber !== \"\") {\n obj.documentNumber = message.documentNumber;\n }\n if (message.issuingState !== \"\") {\n obj.issuingState = message.issuingState;\n }\n if (message.issuingAuthority !== \"\") {\n obj.issuingAuthority = message.issuingAuthority;\n }\n if (message.expiryDate !== \"\") {\n obj.expiryDate = message.expiryDate;\n }\n if (message.documentClassCode !== \"\") {\n obj.documentClassCode = message.documentClassCode;\n }\n if (message.mrzStrings !== \"\") {\n obj.mrzStrings = message.mrzStrings;\n }\n if (message.documentCan !== \"\") {\n obj.documentCan = message.documentCan;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<DocumentData>, I>>(base?: I): DocumentData {\n return DocumentData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<DocumentData>, I>>(object: I): DocumentData {\n const message = createBaseDocumentData();\n message.documentNumber = object.documentNumber ?? \"\";\n message.issuingState = object.issuingState ?? \"\";\n message.issuingAuthority = object.issuingAuthority ?? \"\";\n message.expiryDate = object.expiryDate ?? \"\";\n message.documentClassCode = object.documentClassCode ?? \"\";\n message.mrzStrings = object.mrzStrings ?? \"\";\n message.documentCan = object.documentCan ?? \"\";\n return message;\n },\n};\n\nfunction createBaseAddressData(): AddressData {\n return {\n flat: \"\",\n houseNumber: \"\",\n building: \"\",\n street: \"\",\n city: \"\",\n postalCode: \"\",\n country: \"\",\n addressLine: \"\",\n };\n}\n\nexport const AddressData: MessageFns<AddressData> = {\n encode(message: AddressData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.flat !== \"\") {\n writer.uint32(10).string(message.flat);\n }\n if (message.houseNumber !== \"\") {\n writer.uint32(18).string(message.houseNumber);\n }\n if (message.building !== \"\") {\n writer.uint32(26).string(message.building);\n }\n if (message.street !== \"\") {\n writer.uint32(34).string(message.street);\n }\n if (message.city !== \"\") {\n writer.uint32(42).string(message.city);\n }\n if (message.postalCode !== \"\") {\n writer.uint32(50).string(message.postalCode);\n }\n if (message.country !== \"\") {\n writer.uint32(58).string(message.country);\n }\n if (message.addressLine !== \"\") {\n writer.uint32(66).string(message.addressLine);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): AddressData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseAddressData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.flat = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.houseNumber = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.building = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.street = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.city = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.postalCode = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.country = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.addressLine = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): AddressData {\n return {\n flat: isSet(object.flat) ? globalThis.String(object.flat) : \"\",\n houseNumber: isSet(object.houseNumber) ? globalThis.String(object.houseNumber) : \"\",\n building: isSet(object.building) ? globalThis.String(object.building) : \"\",\n street: isSet(object.street) ? globalThis.String(object.street) : \"\",\n city: isSet(object.city) ? globalThis.String(object.city) : \"\",\n postalCode: isSet(object.postalCode) ? globalThis.String(object.postalCode) : \"\",\n country: isSet(object.country) ? globalThis.String(object.country) : \"\",\n addressLine: isSet(object.addressLine) ? globalThis.String(object.addressLine) : \"\",\n };\n },\n\n toJSON(message: AddressData): unknown {\n const obj: any = {};\n if (message.flat !== \"\") {\n obj.flat = message.flat;\n }\n if (message.houseNumber !== \"\") {\n obj.houseNumber = message.houseNumber;\n }\n if (message.building !== \"\") {\n obj.building = message.building;\n }\n if (message.street !== \"\") {\n obj.street = message.street;\n }\n if (message.city !== \"\") {\n obj.city = message.city;\n }\n if (message.postalCode !== \"\") {\n obj.postalCode = message.postalCode;\n }\n if (message.country !== \"\") {\n obj.country = message.country;\n }\n if (message.addressLine !== \"\") {\n obj.addressLine = message.addressLine;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<AddressData>, I>>(base?: I): AddressData {\n return AddressData.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<AddressData>, I>>(object: I): AddressData {\n const message = createBaseAddressData();\n message.flat = object.flat ?? \"\";\n message.houseNumber = object.houseNumber ?? \"\";\n message.building = object.building ?? \"\";\n message.street = object.street ?? \"\";\n message.city = object.city ?? \"\";\n message.postalCode = object.postalCode ?? \"\";\n message.country = object.country ?? \"\";\n message.addressLine = object.addressLine ?? \"\";\n return message;\n },\n};\n\nfunction createBaseImage(): Image {\n return { contentType: \"\", data: new Uint8Array(0), provenance: 0 };\n}\n\nexport const Image: MessageFns<Image> = {\n encode(message: Image, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.contentType !== \"\") {\n writer.uint32(10).string(message.contentType);\n }\n if (message.data.length !== 0) {\n writer.uint32(18).bytes(message.data);\n }\n if (message.provenance !== 0) {\n writer.uint32(24).int32(message.provenance);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Image {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseImage();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.contentType = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.data = reader.bytes();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.provenance = reader.int32() as any;\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Image {\n return {\n contentType: isSet(object.contentType) ? globalThis.String(object.contentType) : \"\",\n data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),\n provenance: isSet(object.provenance) ? imageProvenanceFromJSON(object.provenance) : 0,\n };\n },\n\n toJSON(message: Image): unknown {\n const obj: any = {};\n if (message.contentType !== \"\") {\n obj.contentType = message.contentType;\n }\n if (message.data.length !== 0) {\n obj.data = base64FromBytes(message.data);\n }\n if (message.provenance !== 0) {\n obj.provenance = imageProvenanceToJSON(message.provenance);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Image>, I>>(base?: I): Image {\n return Image.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Image>, I>>(object: I): Image {\n const message = createBaseImage();\n message.contentType = object.contentType ?? \"\";\n message.data = object.data ?? new Uint8Array(0);\n message.provenance = object.provenance ?? 0;\n return message;\n },\n};\n\nfunction createBaseVideo(): Video {\n return { url: \"\" };\n}\n\nexport const Video: MessageFns<Video> = {\n encode(message: Video, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.url !== \"\") {\n writer.uint32(10).string(message.url);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Video {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseVideo();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.url = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Video {\n return { url: isSet(object.url) ? globalThis.String(object.url) : \"\" };\n },\n\n toJSON(message: Video): unknown {\n const obj: any = {};\n if (message.url !== \"\") {\n obj.url = message.url;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Video>, I>>(base?: I): Video {\n return Video.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Video>, I>>(object: I): Video {\n const message = createBaseVideo();\n message.url = object.url ?? \"\";\n return message;\n },\n};\n\nfunction createBaseDocument(): Document {\n return { personalData: undefined, documentData: undefined, addressData: undefined };\n}\n\nexport const Document: MessageFns<Document> = {\n encode(message: Document, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.personalData !== undefined) {\n PersonalData.encode(message.personalData, writer.uint32(10).fork()).join();\n }\n if (message.documentData !== undefined) {\n DocumentData.encode(message.documentData, writer.uint32(18).fork()).join();\n }\n if (message.addressData !== undefined) {\n AddressData.encode(message.addressData, writer.uint32(26).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Document {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDocument();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.personalData = PersonalData.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.documentData = DocumentData.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.addressData = AddressData.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Document {\n return {\n personalData: isSet(object.personalData) ? PersonalData.fromJSON(object.personalData) : undefined,\n documentData: isSet(object.documentData) ? DocumentData.fromJSON(object.documentData) : undefined,\n addressData: isSet(object.addressData) ? AddressData.fromJSON(object.addressData) : undefined,\n };\n },\n\n toJSON(message: Document): unknown {\n const obj: any = {};\n if (message.personalData !== undefined) {\n obj.personalData = PersonalData.toJSON(message.personalData);\n }\n if (message.documentData !== undefined) {\n obj.documentData = DocumentData.toJSON(message.documentData);\n }\n if (message.addressData !== undefined) {\n obj.addressData = AddressData.toJSON(message.addressData);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Document>, I>>(base?: I): Document {\n return Document.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Document>, I>>(object: I): Document {\n const message = createBaseDocument();\n message.personalData = (object.personalData !== undefined && object.personalData !== null)\n ? PersonalData.fromPartial(object.personalData)\n : undefined;\n message.documentData = (object.documentData !== undefined && object.documentData !== null)\n ? DocumentData.fromPartial(object.documentData)\n : undefined;\n message.addressData = (object.addressData !== undefined && object.addressData !== null)\n ? AddressData.fromPartial(object.addressData)\n : undefined;\n return message;\n },\n};\n\nfunction createBaseDetails(): Details {\n return { status: 0, docreaderRequestLog: \"\", docreaderResponseLog: \"\", faceapiResponseLog: \"\" };\n}\n\nexport const Details: MessageFns<Details> = {\n encode(message: Details, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.status !== 0) {\n writer.uint32(8).int32(message.status);\n }\n if (message.docreaderRequestLog !== \"\") {\n writer.uint32(18).string(message.docreaderRequestLog);\n }\n if (message.docreaderResponseLog !== \"\") {\n writer.uint32(26).string(message.docreaderResponseLog);\n }\n if (message.faceapiResponseLog !== \"\") {\n writer.uint32(34).string(message.faceapiResponseLog);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Details {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseDetails();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.status = reader.int32() as any;\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.docreaderRequestLog = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.docreaderResponseLog = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.faceapiResponseLog = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Details {\n return {\n status: isSet(object.status) ? resultStatusFromJSON(object.status) : 0,\n docreaderRequestLog: isSet(object.docreaderRequestLog) ? globalThis.String(object.docreaderRequestLog) : \"\",\n docreaderResponseLog: isSet(object.docreaderResponseLog) ? globalThis.String(object.docreaderResponseLog) : \"\",\n faceapiResponseLog: isSet(object.faceapiResponseLog) ? globalThis.String(object.faceapiResponseLog) : \"\",\n };\n },\n\n toJSON(message: Details): unknown {\n const obj: any = {};\n if (message.status !== 0) {\n obj.status = resultStatusToJSON(message.status);\n }\n if (message.docreaderRequestLog !== \"\") {\n obj.docreaderRequestLog = message.docreaderRequestLog;\n }\n if (message.docreaderResponseLog !== \"\") {\n obj.docreaderResponseLog = message.docreaderResponseLog;\n }\n if (message.faceapiResponseLog !== \"\") {\n obj.faceapiResponseLog = message.faceapiResponseLog;\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Details>, I>>(base?: I): Details {\n return Details.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Details>, I>>(object: I): Details {\n const message = createBaseDetails();\n message.status = object.status ?? 0;\n message.docreaderRequestLog = object.docreaderRequestLog ?? \"\";\n message.docreaderResponseLog = object.docreaderResponseLog ?? \"\";\n message.faceapiResponseLog = object.faceapiResponseLog ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMessage(): Message {\n return {\n document: undefined,\n frontImage: undefined,\n backImage: undefined,\n otherImage: undefined,\n details: undefined,\n liveness: undefined,\n };\n}\n\nexport const Message: MessageFns<Message> = {\n encode(message: Message, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.document !== undefined) {\n Document.encode(message.document, writer.uint32(10).fork()).join();\n }\n if (message.frontImage !== undefined) {\n Image.encode(message.frontImage, writer.uint32(18).fork()).join();\n }\n if (message.backImage !== undefined) {\n Image.encode(message.backImage, writer.uint32(26).fork()).join();\n }\n if (message.otherImage !== undefined) {\n Image.encode(message.otherImage, writer.uint32(34).fork()).join();\n }\n if (message.details !== undefined) {\n Details.encode(message.details, writer.uint32(42).fork()).join();\n }\n if (message.liveness !== undefined) {\n Video.encode(message.liveness, writer.uint32(50).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Message {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMessage();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.document = Document.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.frontImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.backImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.otherImage = Image.decode(reader, reader.uint32());\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.details = Details.decode(reader, reader.uint32());\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.liveness = Video.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n fromJSON(object: any): Message {\n return {\n document: isSet(object.document) ? Document.fromJSON(object.document) : undefined,\n frontImage: isSet(object.frontImage) ? Image.fromJSON(object.frontImage) : undefined,\n backImage: isSet(object.backImage) ? Image.fromJSON(object.backImage) : undefined,\n otherImage: isSet(object.otherImage) ? Image.fromJSON(object.otherImage) : undefined,\n details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,\n liveness: isSet(object.liveness) ? Video.fromJSON(object.liveness) : undefined,\n };\n },\n\n toJSON(message: Message): unknown {\n const obj: any = {};\n if (message.document !== undefined) {\n obj.document = Document.toJSON(message.document);\n }\n if (message.frontImage !== undefined) {\n obj.frontImage = Image.toJSON(message.frontImage);\n }\n if (message.backImage !== undefined) {\n obj.backImage = Image.toJSON(message.backImage);\n }\n if (message.otherImage !== undefined) {\n obj.otherImage = Image.toJSON(message.otherImage);\n }\n if (message.details !== undefined) {\n obj.details = Details.toJSON(message.details);\n }\n if (message.liveness !== undefined) {\n obj.liveness = Video.toJSON(message.liveness);\n }\n return obj;\n },\n\n create<I extends Exact<DeepPartial<Message>, I>>(base?: I): Message {\n return Message.fromPartial(base ?? ({} as any));\n },\n fromPartial<I extends Exact<DeepPartial<Message>, I>>(object: I): Message {\n const message = createBaseMessage();\n message.document = (object.document !== undefined && object.document !== null)\n ? Document.fromPartial(object.document)\n : undefined;\n message.frontImage = (object.frontImage !== undefined && object.frontImage !== null)\n ? Image.fromPartial(object.frontImage)\n : undefined;\n message.backImage = (object.backImage !== undefined && object.backImage !== null)\n ? Image.fromPartial(object.backImage)\n : undefined;\n message.otherImage = (object.otherImage !== undefined && object.otherImage !== null)\n ? Image.fromPartial(object.otherImage)\n : undefined;\n message.details = (object.details !== undefined && object.details !== null)\n ? Details.fromPartial(object.details)\n : undefined;\n message.liveness = (object.liveness !== undefined && object.liveness !== null)\n ? Video.fromPartial(object.liveness)\n : undefined;\n return message;\n },\n};\n\nfunction bytesFromBase64(b64: string): Uint8Array {\n if ((globalThis as any).Buffer) {\n return Uint8Array.from(globalThis.Buffer.from(b64, \"base64\"));\n } else {\n const bin = globalThis.atob(b64);\n const arr = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; ++i) {\n arr[i] = bin.charCodeAt(i);\n }\n return arr;\n }\n}\n\nfunction base64FromBytes(arr: Uint8Array): string {\n if ((globalThis as any).Buffer) {\n return globalThis.Buffer.from(arr).toString(\"base64\");\n } else {\n const bin: string[] = [];\n arr.forEach((byte) => {\n bin.push(globalThis.String.fromCharCode(byte));\n });\n return globalThis.btoa(bin.join(\"\"));\n }\n}\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;\n\nexport type DeepPartial<T> = T extends Builtin ? T\n : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\ntype KeysOfUnion<T> = T extends T ? keyof T : never;\nexport type Exact<P, I extends P> = P extends Builtin ? P\n : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };\n\nfunction isSet(value: any): boolean {\n return value !== null && value !== undefined;\n}\n\nexport interface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n fromJSON(object: any): T;\n toJSON(message: T): unknown;\n create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;\n fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;\n}\n","import { type Image, type ImageProvenance, Message } from \"../gen/dv_result\";\n\nexport interface ParsedKycMessages\n extends Pick<Message, \"document\" | \"frontImage\" | \"backImage\" | \"details\"> {\n otherImages?: Image[];\n}\n\nexport function decodeLengthPrefixedMessages(\n buffer: Uint8Array,\n): ParsedKycMessages {\n const result: ParsedKycMessages = {};\n let currentOffset = 0;\n\n while (currentOffset < buffer.length) {\n // Read the length prefix\n const { length, offset } = readVarint(buffer.slice(currentOffset));\n const messageStart = currentOffset + offset;\n const messageEnd = messageStart + length;\n\n // Check if we have enough bytes for the complete message\n if (buffer.length < messageEnd) {\n throw new Error(\"Incomplete Protobuf Message\");\n }\n\n // Extract and decode the message\n const messageBuffer = buffer.slice(messageStart, messageEnd);\n const message = Message.decode(messageBuffer);\n\n // Organize by message type\n if (message.document) {\n result.document = message.document;\n } else if (message.frontImage) {\n result.frontImage = message.frontImage;\n } else if (message.backImage) {\n result.backImage = message.backImage;\n } else if (message.otherImage) {\n result.otherImages = result.otherImages ?? [];\n result.otherImages.push(message.otherImage);\n } else if (message.details) {\n result.details = message.details;\n }\n\n // Move to the next message\n currentOffset = messageEnd;\n }\n\n return result;\n}\n\nexport function readVarint(buffer: Uint8Array): {\n length: number;\n offset: number;\n} {\n let result = 0,\n shift = 0,\n offset = 0;\n const maxBytes = Math.min(buffer.length, 5);\n\n for (let i = 0; i < maxBytes; i++) {\n const byte = buffer[offset];\n if (byte === undefined) {\n break;\n }\n\n offset++;\n result |= (byte & 0x7f) << shift;\n\n if ((byte & 0x80) === 0) {\n return { length: result, offset };\n }\n\n shift += 7;\n }\n\n throw new Error(\"Malformed Varint: Too many bytes without termination.\");\n}\n\nexport interface SDKDvImageData {\n fileBuffer: Uint8Array;\n contentType: string;\n provenance: ImageProvenance;\n}\n\nexport function processDvImage(image: Image): SDKDvImageData {\n return {\n fileBuffer: image.data,\n contentType: image.contentType,\n provenance: image.provenance,\n };\n}\n","import { ensureApiKeyType } from \"./utils/guards\";\nimport { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER } from \"./constants\";\nimport type { SDKOptions } from \"./types\";\nimport type { components } from \"../public/openapi\";\nimport { decodeLengthPrefixedMessages } from \"./utils/protobuf\";\n\ninterface GetFlowResultParams {\n organizationId: string;\n flowResultId: string;\n isSandbox: boolean;\n}\n\ninterface ListFlowResultsParams {\n organizationId: string;\n flowSlug: string;\n isSandbox: boolean;\n pagination?: components[\"schemas\"][\"Pagination\"];\n locale?: components[\"schemas\"][\"Locale\"];\n}\n\nexport async function listFlowResults(\n {\n organizationId,\n flowSlug,\n isSandbox,\n pagination,\n locale,\n }: ListFlowResultsParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n return client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/flow/{flow_slug}/list\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_slug: flowSlug,\n },\n query: {\n pagination,\n sandbox: isSandbox,\n locale,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n },\n );\n}\n\nexport async function getFlowResult(\n { organizationId, flowResultId, isSandbox }: GetFlowResultParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n const response = await client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/{flow_result_id}/details\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_result_id: flowResultId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n },\n );\n\n const { data, ...rest } = response;\n\n return {\n ...rest,\n data: {\n ...data,\n dvResults: data?.dvResults.toSorted((a, b) => {\n return b.createdAt?.localeCompare(a.createdAt ?? \"\") ?? 0;\n }),\n amlResults: data?.amlResults.toSorted((a, b) => {\n return b.createdAt.localeCompare(a.createdAt);\n }),\n poaResults: data?.poaResults.toSorted((a, b) => {\n return b.createdAt.localeCompare(a.createdAt);\n }),\n },\n };\n}\n\ninterface GetDvResultParams extends GetFlowResultParams {\n dvResultId: string;\n}\n\nexport async function getDvResult(\n { organizationId, flowResultId, dvResultId, isSandbox }: GetDvResultParams,\n opts: SDKOptions,\n) {\n ensureApiKeyType(opts.apiKey, [\"SECRET\"]);\n\n const client = zypheApiClient(opts);\n\n const response = await client.GET(\n \"/sdk/organizations/{organization_id}/flow-results/{flow_result_id}/dv/{dv_result_id}/details\",\n {\n params: {\n path: {\n organization_id: organizationId,\n flow_result_id: flowResultId,\n dv_result_id: dvResultId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n Accept: \"application/x-protobuf\",\n },\n parseAs: \"arrayBuffer\",\n },\n );\n\n const { data, ...rest } = response;\n\n return {\n ...rest,\n data: data ? decodeLengthPrefixedMessages(new Uint8Array(data)) : undefined,\n };\n}\n","import type { components, paths } from \"../public/openapi\";\nimport type { Environment } from \"./constants\";\n\nexport type SdkCreateVerificationRequestResponse =\n components[\"schemas\"][\"SdkCreateVerificationRequestResponse\"];\n\nexport type Locale = components[\"schemas\"][\"Locale\"];\n\nexport type GetLivenessChallengeResponse =\n components[\"schemas\"][\"GetLivenessChallengeResponse\"];\n\nexport type ProcessDocumentSelectionPayload =\n components[\"schemas\"][\"ProcessDocumentSelectionPayload\"];\n\nexport type ProcessDocumentSelectionResponse =\n components[\"schemas\"][\"ProcessDocumentSelectionResponse\"];\n\nexport type ProcessIdentityDocumentPayload =\n components[\"schemas\"][\"ProcessIdentityDocumentPayload\"];\n\nexport type ProcessIdentityDocumentResponse =\n components[\"schemas\"][\"ProcessIdentityDocumentResponse\"];\n\nexport type ProcessLivenessPayload =\n components[\"schemas\"][\"ProcessLivenessPayload\"];\n\nexport type ProcessDvDocumentPayload =\n paths[\"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-document\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\nexport type ProcessDocumentSelectionRequestPayload =\n paths[\"/sdk/flow/{flow_id}/vr/{verification_request_id}/dv/process-dv-selection\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\nexport type ProcessLivenessResponse =\n components[\"schemas\"][\"ProcessLivenessResponse\"];\n\nexport type ApiKeyType = components[\"schemas\"][\"ApiKeyType\"];\n\nexport type FlowStepType = components[\"schemas\"][\"FlowStepType\"];\n\nexport type Flow = components[\"schemas\"][\"Flow\"];\n\nexport type FlowStep = components[\"schemas\"][\"FlowStep\"];\n\nexport type VerificationRequest = components[\"schemas\"][\"VerificationRequest\"];\n\nexport type BaxeError = components[\"schemas\"][\"BaxeError\"];\n\n/**\n * Parameters for initializing the Zyphe iframe for a Flow.\n * These will remain constant for each user that visits the Flow URL.\n */\nexport interface InitializeZypheFlowParams {\n /**\n * The ID of the Flow\n * UUID v4 format\n * @example \"4810bc63-bfdd-4487-ae57-c939046f56b6\"\n */\n flowId: string;\n /**\n * The ID of the FlowStep\n * UUID v4 format\n * @example \"4810bc63-bfdd-4487-ae57-c939046f56b6\"\n */\n flowStepId: string;\n /**\n * The email of the user.\n * @example \"user@example.com\"\n */\n email: string;\n /**\n * The type of Flow URL.\n * The third path segment of your Flow URL.\n * @example \"http://localhost:5173/flow/flowSlug/kyc/stepSlug\"\n */\n product: \"kyc\"; //| \"kyb\";\n /**\n * Whether the Flow is a \"sandbox\" Flow.\n *\n * This will prepend \"sandbox\" to the final URL.\n * @example \"http://localhost:5173/sandbox/flow/flowSlug/kyc/stepSlug\"\n */\n isSandbox: boolean;\n /**\n * Custom data to be passed to the Flow.\n * @example { \"custom_data\": \"custom_value\" }\n */\n customData?: Record<string, string>;\n}\n\nexport type GetNextStepDetailsParams = Pick<\n InitializeZypheFlowParams,\n \"flowId\" | \"isSandbox\" | \"email\"\n>;\n\nexport interface VerificationRequestParams {\n flowId: string;\n verificationRequestId: string;\n isSandbox: boolean;\n}\n\nexport interface ProcessDvLivenessParams extends VerificationRequestParams {\n payload: ProcessLivenessPayload;\n}\n\nexport interface SDKOptions {\n apiKey: string;\n /**\n * The environment to use for the SDK.\n * This will determine the base URL for the API and the Flow URL.\n *\n * If not provided, we will default to \"production\".\n *\n * @default \"production\"\n */\n environment?: Environment;\n /**\n * If set, the QR code displayed on desktop devices of a Document Verification flow will direct to this URL.\n * If not set, the QR code will direct to the corresponding zyphe.com URL, depending upon your configured environment.\n *\n * The URL will include the query parameters `zypheVr`, `zypheToken`, and\n * `zypheAccessSig`.\n *\n * @default \"https://app-dev.zyphe.com\" || \"https://verify.zyphe.com\"\n * @example \"http://example.com\"\n */\n handoffBaseUrl?: string;\n /**\n * The main background color of the page.\n * This will override the primary color configured in verify.zyphe.com\n *\n * The accepted values are flexible, but we recommend a hex code.\n * @example \"#000000\"\n */\n primaryColor?: string;\n /**\n * The accent color of the page, used for buttons, icons, etc.\n * This will override the secondary color configured in verify.zyphe.com\n *\n * The accepted values are flexible, but we recommend a hex code.\n * @example \"#000000\"\n */\n secondaryColor?: string;\n /**\n * If true, the verification session will be displayed in \"fullscreen\" mode.\n */\n isFullscreen?: boolean;\n}\n\nexport interface VerificationSessionRequestOptions {\n verificationSession: SdkCreateVerificationRequestResponse;\n options: SDKOptions;\n}\n\nexport interface ProcessDvDocumentOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessDvDocumentPayload;\n}\n\nexport interface ProcessDocumentSelectionOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessDocumentSelectionRequestPayload;\n}\n\nexport interface ProcessDvLivenessOptions\n extends VerificationSessionRequestOptions {\n payload: ProcessLivenessPayload;\n}\n\nexport interface GetLivenessChallengeOptions\n extends VerificationSessionRequestOptions {}\n\nexport interface CreateVerificationSessionParams {\n email: string;\n flowId: string;\n flowStepId: string;\n isSandbox: boolean;\n customData?: Record<string, string>;\n}\n\nexport const DocumentType = {\n IDENTITY_CARD: 12,\n DRIVING_LICENSE: 49,\n PASSPORT: 11,\n} as const;\n\nexport type DocumentType = (typeof DocumentType)[keyof typeof DocumentType];\n","import { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER, EnvironmentConfigs, Environments } from \"./constants\";\nimport type {\n CreateVerificationSessionParams,\n GetNextStepDetailsParams,\n InitializeZypheFlowParams,\n SdkCreateVerificationRequestResponse,\n SDKOptions,\n} from \"./types\";\n\nexport function createVerificationSession(\n {\n email,\n flowId,\n flowStepId,\n isSandbox,\n customData,\n }: CreateVerificationSessionParams,\n opts: SDKOptions,\n) {\n const client = zypheApiClient(opts);\n\n return client.POST(\"/sdk/flow/{flow_id}/vr/create\", {\n body: { email, flowStepId, customData },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n params: {\n path: {\n flow_id: flowId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n });\n}\n\nfunction getFlowUrlOrigin(\n environment: SDKOptions[\"environment\"] = Environments.PRODUCTION,\n) {\n return EnvironmentConfigs[environment].appUrl;\n}\n\nexport function constructVerificationSessionUrl({\n flowParams,\n verificationSession,\n opts,\n}: {\n flowParams: InitializeZypheFlowParams;\n verificationSession: SdkCreateVerificationRequestResponse;\n opts: SDKOptions;\n}) {\n const origin = getFlowUrlOrigin(opts.environment);\n const { email, isSandbox, product } = flowParams;\n const { handoffBaseUrl, primaryColor, secondaryColor, isFullscreen } = opts;\n\n if (!verificationSession) {\n throw new Error(\"Failed to create verification session\");\n }\n\n const zypheEmail = verificationSession.email || email;\n\n let baseUrl = `${origin}${isSandbox ? \"/sandbox\" : \"\"}/flow/${verificationSession.flowSlug}/${product}/${verificationSession.flowStepSlug}?zypheVr=${encodeURIComponent(verificationSession.verificationRequest.id)}&zypheEmail=${encodeURIComponent(zypheEmail)}&zypheToken=${encodeURIComponent(verificationSession.zypheToken)}`;\n\n if (handoffBaseUrl) {\n baseUrl += `&zypheHandoffBaseUrl=${encodeURIComponent(handoffBaseUrl)}`;\n }\n\n if (primaryColor) {\n baseUrl += `&zyphePrimaryColor=${encodeURIComponent(primaryColor)}`;\n }\n\n if (secondaryColor) {\n baseUrl += `&zypheSecondaryColor=${encodeURIComponent(secondaryColor)}`;\n }\n\n if (isFullscreen) {\n baseUrl += `&zypheFullscreen=${encodeURIComponent(isFullscreen)}`;\n }\n\n if(verificationSession.zypheAccessSig) {\n baseUrl += `&zypheAccessSig=${encodeURIComponent(verificationSession.zypheAccessSig)}`;\n }\n\n return baseUrl;\n}\n\nexport function getNextStepDetails(\n flowParams: GetNextStepDetailsParams,\n opts: SDKOptions,\n) {\n const client = zypheApiClient(opts);\n\n return client.GET(\"/sdk/flow/{flow_id}/vr/next-step\", {\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n params: {\n path: {\n flow_id: flowParams.flowId,\n },\n query: {\n sandbox: flowParams.isSandbox,\n email: flowParams.email,\n },\n },\n });\n}\n","export interface SignatureComponents {\n timestamp: string;\n signatureHex: string;\n}\n\n/**\n * Parses a webhook signature header of the form \"t=<timestamp>,v0=<signature>\"\n * @param signatureHeader - The header string, e.g. \"t=1234567890,v0=abcdef...\"\n * @returns The parsed timestamp and signature hex\n */\nexport function parseSignatureHeader(\n signatureHeader: string,\n): SignatureComponents {\n const match = signatureHeader.match(/^t=(\\d+),v0=([a-fA-F0-9]+)$/);\n if (!match) {\n throw new Error(\"Invalid signature header format\");\n }\n const [, timestamp, signatureHex] = match;\n\n if (!timestamp || !signatureHex) {\n throw new Error(\"Invalid signature header format\");\n }\n\n return { timestamp, signatureHex };\n}\n\n/**\n * Converts a hex string to a Uint8Array\n * @param hex - The hex string to convert\n * @returns The resulting Uint8Array\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (hex.length % 2 !== 0) throw new Error(\"Invalid hex string\");\n const bytes = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);\n }\n return bytes;\n}\n\n/**\n * Converts an ArrayBuffer to a hex string\n * @param buffer - The buffer to convert\n * @returns The hex string representation\n */\nexport function bufferToHex(buffer: ArrayBuffer): string {\n return Array.from(new Uint8Array(buffer))\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n\n/**\n * Compares two strings in constant time to prevent timing attacks\n * @param a - First string\n * @param b - Second string\n * @returns True if strings are equal, false otherwise\n */\nexport function timingSafeEqual(a: string, b: string): boolean {\n if (a.length !== b.length) return false;\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a.charCodeAt(i) ^ b.charCodeAt(i);\n }\n return result === 0;\n}\n\nexport const WebhookSignatureErrorCodes = {\n MISSING_SIGNATURE_HEADER: 1,\n INVALID_SIGNATURE_HEADER: 2,\n SIGNATURE_MISMATCH: 3,\n} as const;\n\nexport const WebhookSignatureErrorMessages = {\n [WebhookSignatureErrorCodes.MISSING_SIGNATURE_HEADER]:\n \"Missing signature header\",\n [WebhookSignatureErrorCodes.INVALID_SIGNATURE_HEADER]:\n \"Invalid signature header\",\n [WebhookSignatureErrorCodes.SIGNATURE_MISMATCH]: \"Signature mismatch\",\n} as const;\n\nexport interface WebhookVerifierOptions<T extends Function> {\n /**\n * The hex-encoded secret key used to verify the signature\n */\n secretHex: string;\n\n /**\n * The name of the header containing the signature\n * @default \"x-signature\"\n */\n signatureHeader?: string;\n\n /**\n * Optional function to handle unauthorized requests\n * @default Returns 401 Unauthorized with JSON error\n */\n onUnauthorized?: T;\n\n /**\n * Whether to make the raw body available on req.rawBody\n * @default true\n */\n exposeRawBody?: boolean;\n}\n"],"mappings":";AAAA,OAAO,kBAAuC;;;ACAvC,IAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,YAAY;AACd;AASO,IAAM,qBAAqB;AAAA,EAChC,CAAC,aAAa,KAAK,GAAG;AAAA,IACpB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,OAAO,GAAG;AAAA,IACtB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,UAAU,GAAG;AAAA,IACzB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;AAEO,IAAM,iBAAiB;;;ADvBvB,IAAM,iBAAiB,CAAC,SAAqB;AAElD,QAAM,cAAc,KAAK,eAAe,aAAa;AAErD,SAAO,aAAoB;AAAA,IACzB,SAAS,mBAAmB,WAAW,EAAE;AAAA,EAC3C,CAAC;AACH;;;AENO,IAAM,aAAN,MAAM,oBAAmB,MAAM;AAAA,EACpC;AAAA,EACA,YAAY,SAAiB,SAA6B;AACxD,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,WAAW,SAAS;AAAA,EAC3B;AAAA,EAEA,OAAO,cAAc,OAA8B;AACjD,WAAO,IAAI,YAAW,MAAM,WAAW,gCAAgC;AAAA,MACrE,UAAU,MAAM;AAAA,IAClB,CAAC;AAAA,EACH;AACF;;;ACgBA,eAAsB,eACpB,EAAE,qBAAqB,aAAa,OAAO,GAC3C,SAC0C;AAC1C,QAAM,SAAS,eAAe,OAAO;AAErC,QAAM,WAAW,MAAM,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,MACE,MAAM;AAAA,QACJ;AAAA,QACA,QACE,OAAO,SAAS,0BACZ;AAAA,UACE;AAAA,YACE,WAAW;AAAA,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,MAAM,oBAAoB;AAC9D,QAAM,QAAQ,IAAI,WAAW,IAAI,SAAS,CAAC;AAC3C,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,GAAG;AACtC,UAAM,IAAI,CAAC,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE;AAAA,EACjD;AACA,SAAO;AACT;AAOO,SAAS,YAAY,QAA6B;AACvD,SAAO,MAAM,KAAK,IAAI,WAAW,MAAM,CAAC,EACrC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAC1C,KAAK,EAAE;AACZ;AAQO,SAAS,gBAAgB,GAAW,GAAoB;AAC7D,MAAI,EAAE,WAAW,EAAE,OAAQ,QAAO;AAClC,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,cAAU,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC;AAAA,EAC5C;AACA,SAAO,WAAW;AACpB;AAEO,IAAM,6BAA6B;AAAA,EACxC,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,oBAAoB;AACtB;AAEO,IAAM,gCAAgC;AAAA,EAC3C,CAAC,2BAA2B,wBAAwB,GAClD;AAAA,EACF,CAAC,2BAA2B,wBAAwB,GAClD;AAAA,EACF,CAAC,2BAA2B,kBAAkB,GAAG;AACnD;","names":[]}
|
package/dist/openapi.d.ts
CHANGED
|
@@ -409,8 +409,6 @@ export interface components {
|
|
|
409
409
|
riskScore: components["schemas"]["RiskScore"];
|
|
410
410
|
riskTopics: string[];
|
|
411
411
|
};
|
|
412
|
-
/** @enum {string} */
|
|
413
|
-
AmlModerationStatus: "approved" | "rejected" | "escalated";
|
|
414
412
|
AmlOccupancy: {
|
|
415
413
|
endDate?: components["schemas"]["FieldWithControl"];
|
|
416
414
|
post?: components["schemas"]["AmlPosition"][];
|
|
@@ -444,9 +442,7 @@ export interface components {
|
|
|
444
442
|
AmlResult: {
|
|
445
443
|
/** Format: date-time */
|
|
446
444
|
createdAt: string;
|
|
447
|
-
data
|
|
448
|
-
[key: string]: unknown;
|
|
449
|
-
};
|
|
445
|
+
data?: components["schemas"]["AmlRiskResult"] | null;
|
|
450
446
|
/** Format: uuid */
|
|
451
447
|
id: string;
|
|
452
448
|
pep: boolean;
|
|
@@ -928,7 +924,7 @@ export interface components {
|
|
|
928
924
|
status: components["schemas"]["ResultStatus"];
|
|
929
925
|
};
|
|
930
926
|
/** @enum {string} */
|
|
931
|
-
ErrorTags: "unexpected" | "bad_request" | "permission_denied" | "request_deserialization" | "database" | "invalid_email_or_password" | "user_not_confirmed" | "verify_password" | "send_email" | "open_session" | "read_session" | "close_session" | "user_disabled" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_not_found" | "flow_step_not_found" | "organization_not_found" | "storage" | "verification_request_not_found" | "document_reader" | "websocket" | "organization_settings_not_found" | "start_job" | "result_not_found" | "kyc_grant_not_found" | "document_not_found" | "service_invocation" | "trigger_webhook" | "too_many_invites" | "invite_already_used" | "invite_already_accepted" | "invite_already_revoked" | "invite_revoked" | "invite_expired" | "invite_already_exists" | "share_already_revoked" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "identity_not_found" | "step_order_violation" | "serialization" | "mock_data" | "api_key_not_found" | "not_implemented" | "access_grant" | "rate_limit_exceeded" | "missing_api_key" | "invalid_api_key" | "origin_not_allowed" | "step_already_completed" | "send_sms" | "parse_error" | "inviter_organization_not_found" | "forbidden" | "passkey_authentication" | "internal" | "invalid_email" | "graph_validation" | "external_api" | "share_already_has_write_access" | "share_does_not_have_write_access" | "write_access_already_revoked" | "invite_required" | "billing";
|
|
927
|
+
ErrorTags: "unexpected" | "bad_request" | "permission_denied" | "request_deserialization" | "database" | "invalid_email_or_password" | "user_not_confirmed" | "verify_password" | "send_email" | "open_session" | "read_session" | "close_session" | "user_disabled" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_not_found" | "flow_step_not_found" | "organization_not_found" | "storage" | "verification_request_not_found" | "document_reader" | "websocket" | "organization_settings_not_found" | "start_job" | "result_not_found" | "kyc_grant_not_found" | "document_not_found" | "service_invocation" | "trigger_webhook" | "too_many_invites" | "invite_already_used" | "invite_already_accepted" | "invite_already_revoked" | "invite_revoked" | "invite_expired" | "invite_already_exists" | "share_already_revoked" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "identity_not_found" | "step_order_violation" | "serialization" | "mock_data" | "api_key_not_found" | "not_implemented" | "access_grant" | "rate_limit_exceeded" | "missing_api_key" | "invalid_api_key" | "origin_not_allowed" | "step_already_completed" | "send_sms" | "send_notification" | "parse_error" | "inviter_organization_not_found" | "forbidden" | "passkey_authentication" | "internal" | "invalid_email" | "graph_validation" | "external_api" | "share_already_has_write_access" | "share_does_not_have_write_access" | "write_access_already_revoked" | "invite_required" | "billing";
|
|
932
928
|
/** @description Represents an executed action with its ID and type. */
|
|
933
929
|
ExecutedAction: {
|
|
934
930
|
actionConfig: components["schemas"]["ActionConfig"];
|
|
@@ -1498,8 +1494,17 @@ export interface components {
|
|
|
1498
1494
|
email: string;
|
|
1499
1495
|
};
|
|
1500
1496
|
GetNextStepResponse: {
|
|
1497
|
+
/** @description Custom data associated with the flow result, if one exists. */
|
|
1498
|
+
customData?: {
|
|
1499
|
+
[key: string]: unknown;
|
|
1500
|
+
} | null;
|
|
1501
1501
|
/** @description Actions that were automatically executed as part of flow evaluation (e.g. status transitions). */
|
|
1502
1502
|
executedActions?: components["schemas"]["ExecutedAction"][];
|
|
1503
|
+
/**
|
|
1504
|
+
* Format: uuid
|
|
1505
|
+
* @description The ID of the flow result record, if one exists for this user.
|
|
1506
|
+
*/
|
|
1507
|
+
flowResultId?: string | null;
|
|
1503
1508
|
/** @description Whether the user has completed all required steps in the flow. */
|
|
1504
1509
|
isCompleted: boolean;
|
|
1505
1510
|
nextStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
|
|
@@ -1578,50 +1583,55 @@ export interface components {
|
|
|
1578
1583
|
};
|
|
1579
1584
|
name: string;
|
|
1580
1585
|
options: unknown;
|
|
1581
|
-
|
|
1586
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1582
1587
|
/** @enum {string} */
|
|
1583
1588
|
type: "date";
|
|
1584
1589
|
value?: unknown;
|
|
1590
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1585
1591
|
} | {
|
|
1586
1592
|
label: {
|
|
1587
1593
|
[key: string]: string;
|
|
1588
1594
|
};
|
|
1589
1595
|
name: string;
|
|
1590
1596
|
options: unknown;
|
|
1591
|
-
|
|
1597
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1592
1598
|
/** @enum {string} */
|
|
1593
1599
|
type: "text";
|
|
1594
1600
|
value?: unknown;
|
|
1601
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1595
1602
|
} | {
|
|
1596
1603
|
label: {
|
|
1597
1604
|
[key: string]: string;
|
|
1598
1605
|
};
|
|
1599
1606
|
name: string;
|
|
1600
1607
|
options: unknown;
|
|
1601
|
-
|
|
1608
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1602
1609
|
/** @enum {string} */
|
|
1603
1610
|
type: "textarea";
|
|
1604
1611
|
value?: unknown;
|
|
1612
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1605
1613
|
} | {
|
|
1606
1614
|
label: {
|
|
1607
1615
|
[key: string]: string;
|
|
1608
1616
|
};
|
|
1609
1617
|
name: string;
|
|
1610
1618
|
options: unknown;
|
|
1611
|
-
|
|
1619
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1612
1620
|
/** @enum {string} */
|
|
1613
1621
|
type: "checkbox";
|
|
1614
1622
|
value?: unknown;
|
|
1623
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1615
1624
|
} | {
|
|
1616
1625
|
label: {
|
|
1617
1626
|
[key: string]: string;
|
|
1618
1627
|
};
|
|
1619
1628
|
name: string;
|
|
1620
1629
|
options: components["schemas"]["FileOptions"];
|
|
1621
|
-
|
|
1630
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1622
1631
|
/** @enum {string} */
|
|
1623
1632
|
type: "file";
|
|
1624
1633
|
value?: unknown;
|
|
1634
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1625
1635
|
} | {
|
|
1626
1636
|
label: {
|
|
1627
1637
|
[key: string]: string;
|
|
@@ -1634,20 +1644,22 @@ export interface components {
|
|
|
1634
1644
|
};
|
|
1635
1645
|
};
|
|
1636
1646
|
options: components["schemas"]["SelectOptions"];
|
|
1637
|
-
|
|
1647
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1638
1648
|
/** @enum {string} */
|
|
1639
1649
|
type: "select";
|
|
1640
1650
|
value?: unknown;
|
|
1651
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1641
1652
|
} | {
|
|
1642
1653
|
label: {
|
|
1643
1654
|
[key: string]: string;
|
|
1644
1655
|
};
|
|
1645
1656
|
name: string;
|
|
1646
1657
|
options: unknown;
|
|
1647
|
-
|
|
1658
|
+
requiredWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1648
1659
|
/** @enum {string} */
|
|
1649
1660
|
type: "place";
|
|
1650
1661
|
value?: unknown;
|
|
1662
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
1651
1663
|
};
|
|
1652
1664
|
InputFieldOptions: components["schemas"]["FileOptions"] | components["schemas"]["SelectOptions"] | unknown;
|
|
1653
1665
|
/** @enum {string} */
|
|
@@ -2103,6 +2115,7 @@ export interface components {
|
|
|
2103
2115
|
text: {
|
|
2104
2116
|
[key: string]: string;
|
|
2105
2117
|
};
|
|
2118
|
+
visibleWhen?: Omit<components["schemas"]["Condition"], "op"> | null;
|
|
2106
2119
|
};
|
|
2107
2120
|
PoaConfig: {
|
|
2108
2121
|
documentFilter: components["schemas"]["PoaDocumentType"][];
|
|
@@ -2184,6 +2197,13 @@ export interface components {
|
|
|
2184
2197
|
autoOneClickKycData?: components["schemas"]["AutoOneClickKycData"] | null;
|
|
2185
2198
|
/** @description Biometric check data (for face matching results) */
|
|
2186
2199
|
biometricCheckData?: unknown;
|
|
2200
|
+
/**
|
|
2201
|
+
* Format: date
|
|
2202
|
+
* @description Date on which a DocumentExpired webhook was last sent for this DV result.
|
|
2203
|
+
* Used by the AML worker to deduplicate repeated expiry notifications across
|
|
2204
|
+
* refresh ticks — once set, the webhook is not re-enqueued.
|
|
2205
|
+
*/
|
|
2206
|
+
documentExpiredWebhookSentAt?: string | null;
|
|
2187
2207
|
/** @description Image quality check results */
|
|
2188
2208
|
imageQuality?: components["schemas"]["ImageQualityCheckResult"][] | null;
|
|
2189
2209
|
/** @description Raw liveness data from face verification */
|
|
@@ -2470,7 +2490,7 @@ export interface components {
|
|
|
2470
2490
|
*/
|
|
2471
2491
|
Uuid: string;
|
|
2472
2492
|
/** @enum {string} */
|
|
2473
|
-
ValidationMessages: "validation_unexpected" | "validation_invalid_file_format" | "validation_organization_slug_exists" | "validation_flow_slug_exists" | "validation_flow_id_mismatch" | "validation_flow_step_name_exists" | "validation_consents_not_granted" | "validation_kyb_config_match" | "validation_kyb_config_already_uses_this_kyc_flow_id" | "validation_kyb_moderation_status_wrong" | "validation_form_name_exists" | "validation_database_error" | "validation_flow_name_invalid" | "validation_flow_slug_name_invalid" | "validation_flow_step_name_invalid" | "validation_flow_step_order_duplicate" | "validation_flow_step_order_invalid" | "validation_flow_step_id_mismatch" | "validation_password_too_short" | "validation_password_no_uppercase" | "validation_password_no_lowercase" | "validation_password_no_number" | "validation_password_no_special_character" | "validation_password_contains_whitespace_or_control" | "validation_emails_empty" | "validation_email_invalid" | "validation_emails_too_many" | "validation_emails_duplicate" | "validation_invite_to_self" | "validation_e164_format" | "validation_flow_step_already_has_reference" | "validation_flow_not_found" | "validation_empty_parameter" | "validation_form_not_found" | "validation_workflow_graph_invalid" | "validation_invalid_role_for_invitation";
|
|
2493
|
+
ValidationMessages: "validation_unexpected" | "validation_invalid_file_format" | "validation_organization_slug_exists" | "validation_flow_slug_exists" | "validation_flow_id_mismatch" | "validation_flow_step_name_exists" | "validation_consents_not_granted" | "validation_kyb_config_match" | "validation_kyb_config_already_uses_this_kyc_flow_id" | "validation_kyb_moderation_status_wrong" | "validation_form_name_exists" | "validation_database_error" | "validation_flow_name_invalid" | "validation_flow_slug_name_invalid" | "validation_flow_step_name_invalid" | "validation_flow_step_order_duplicate" | "validation_flow_step_order_invalid" | "validation_flow_step_id_mismatch" | "validation_password_too_short" | "validation_password_no_uppercase" | "validation_password_no_lowercase" | "validation_password_no_number" | "validation_password_no_special_character" | "validation_password_contains_whitespace_or_control" | "validation_emails_empty" | "validation_email_invalid" | "validation_emails_too_many" | "validation_emails_duplicate" | "validation_invite_to_self" | "validation_e164_format" | "validation_flow_step_already_has_reference" | "validation_flow_not_found" | "validation_empty_parameter" | "validation_form_not_found" | "validation_organization_not_found" | "validation_workflow_graph_invalid" | "validation_invalid_role_for_invitation" | "validation_form_condition_forward_ref";
|
|
2474
2494
|
VaultUnlockPasskeyData: {
|
|
2475
2495
|
/** @description Passkey challenge for vault unlock (base64url) */
|
|
2476
2496
|
challenge: string;
|
package/dist/openapi.json
CHANGED
|
@@ -2125,14 +2125,6 @@
|
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
2127
|
},
|
|
2128
|
-
"AmlModerationStatus": {
|
|
2129
|
-
"type": "string",
|
|
2130
|
-
"enum": [
|
|
2131
|
-
"approved",
|
|
2132
|
-
"rejected",
|
|
2133
|
-
"escalated"
|
|
2134
|
-
]
|
|
2135
|
-
},
|
|
2136
2128
|
"AmlOccupancy": {
|
|
2137
2129
|
"type": "object",
|
|
2138
2130
|
"properties": {
|
|
@@ -2241,7 +2233,6 @@
|
|
|
2241
2233
|
"type": "object",
|
|
2242
2234
|
"required": [
|
|
2243
2235
|
"id",
|
|
2244
|
-
"data",
|
|
2245
2236
|
"pep",
|
|
2246
2237
|
"sanctions",
|
|
2247
2238
|
"createdAt",
|
|
@@ -2253,8 +2244,12 @@
|
|
|
2253
2244
|
"format": "date-time"
|
|
2254
2245
|
},
|
|
2255
2246
|
"data": {
|
|
2256
|
-
"
|
|
2257
|
-
|
|
2247
|
+
"allOf": [
|
|
2248
|
+
{
|
|
2249
|
+
"$ref": "#/components/schemas/AmlRiskResult"
|
|
2250
|
+
}
|
|
2251
|
+
],
|
|
2252
|
+
"nullable": true
|
|
2258
2253
|
},
|
|
2259
2254
|
"id": {
|
|
2260
2255
|
"type": "string",
|
|
@@ -3779,6 +3774,7 @@
|
|
|
3779
3774
|
"origin_not_allowed",
|
|
3780
3775
|
"step_already_completed",
|
|
3781
3776
|
"send_sms",
|
|
3777
|
+
"send_notification",
|
|
3782
3778
|
"parse_error",
|
|
3783
3779
|
"inviter_organization_not_found",
|
|
3784
3780
|
"forbidden",
|
|
@@ -5787,6 +5783,12 @@
|
|
|
5787
5783
|
"isCompleted"
|
|
5788
5784
|
],
|
|
5789
5785
|
"properties": {
|
|
5786
|
+
"customData": {
|
|
5787
|
+
"type": "object",
|
|
5788
|
+
"description": "Custom data associated with the flow result, if one exists.",
|
|
5789
|
+
"additionalProperties": {},
|
|
5790
|
+
"nullable": true
|
|
5791
|
+
},
|
|
5790
5792
|
"executedActions": {
|
|
5791
5793
|
"type": "array",
|
|
5792
5794
|
"items": {
|
|
@@ -5794,6 +5796,12 @@
|
|
|
5794
5796
|
},
|
|
5795
5797
|
"description": "Actions that were automatically executed as part of flow evaluation (e.g. status transitions)."
|
|
5796
5798
|
},
|
|
5799
|
+
"flowResultId": {
|
|
5800
|
+
"type": "string",
|
|
5801
|
+
"format": "uuid",
|
|
5802
|
+
"description": "The ID of the flow result record, if one exists for this user.",
|
|
5803
|
+
"nullable": true
|
|
5804
|
+
},
|
|
5797
5805
|
"isCompleted": {
|
|
5798
5806
|
"type": "boolean",
|
|
5799
5807
|
"description": "Whether the user has completed all required steps in the flow."
|
|
@@ -5952,7 +5960,6 @@
|
|
|
5952
5960
|
{
|
|
5953
5961
|
"type": "object",
|
|
5954
5962
|
"required": [
|
|
5955
|
-
"required",
|
|
5956
5963
|
"label",
|
|
5957
5964
|
"name",
|
|
5958
5965
|
"options",
|
|
@@ -5969,8 +5976,13 @@
|
|
|
5969
5976
|
"type": "string"
|
|
5970
5977
|
},
|
|
5971
5978
|
"options": {},
|
|
5972
|
-
"
|
|
5973
|
-
"
|
|
5979
|
+
"requiredWhen": {
|
|
5980
|
+
"allOf": [
|
|
5981
|
+
{
|
|
5982
|
+
"$ref": "#/components/schemas/Condition"
|
|
5983
|
+
}
|
|
5984
|
+
],
|
|
5985
|
+
"nullable": true
|
|
5974
5986
|
},
|
|
5975
5987
|
"type": {
|
|
5976
5988
|
"type": "string",
|
|
@@ -5980,13 +5992,20 @@
|
|
|
5980
5992
|
},
|
|
5981
5993
|
"value": {
|
|
5982
5994
|
"nullable": true
|
|
5995
|
+
},
|
|
5996
|
+
"visibleWhen": {
|
|
5997
|
+
"allOf": [
|
|
5998
|
+
{
|
|
5999
|
+
"$ref": "#/components/schemas/Condition"
|
|
6000
|
+
}
|
|
6001
|
+
],
|
|
6002
|
+
"nullable": true
|
|
5983
6003
|
}
|
|
5984
6004
|
}
|
|
5985
6005
|
},
|
|
5986
6006
|
{
|
|
5987
6007
|
"type": "object",
|
|
5988
6008
|
"required": [
|
|
5989
|
-
"required",
|
|
5990
6009
|
"label",
|
|
5991
6010
|
"name",
|
|
5992
6011
|
"options",
|
|
@@ -6003,8 +6022,13 @@
|
|
|
6003
6022
|
"type": "string"
|
|
6004
6023
|
},
|
|
6005
6024
|
"options": {},
|
|
6006
|
-
"
|
|
6007
|
-
"
|
|
6025
|
+
"requiredWhen": {
|
|
6026
|
+
"allOf": [
|
|
6027
|
+
{
|
|
6028
|
+
"$ref": "#/components/schemas/Condition"
|
|
6029
|
+
}
|
|
6030
|
+
],
|
|
6031
|
+
"nullable": true
|
|
6008
6032
|
},
|
|
6009
6033
|
"type": {
|
|
6010
6034
|
"type": "string",
|
|
@@ -6014,13 +6038,20 @@
|
|
|
6014
6038
|
},
|
|
6015
6039
|
"value": {
|
|
6016
6040
|
"nullable": true
|
|
6041
|
+
},
|
|
6042
|
+
"visibleWhen": {
|
|
6043
|
+
"allOf": [
|
|
6044
|
+
{
|
|
6045
|
+
"$ref": "#/components/schemas/Condition"
|
|
6046
|
+
}
|
|
6047
|
+
],
|
|
6048
|
+
"nullable": true
|
|
6017
6049
|
}
|
|
6018
6050
|
}
|
|
6019
6051
|
},
|
|
6020
6052
|
{
|
|
6021
6053
|
"type": "object",
|
|
6022
6054
|
"required": [
|
|
6023
|
-
"required",
|
|
6024
6055
|
"label",
|
|
6025
6056
|
"name",
|
|
6026
6057
|
"options",
|
|
@@ -6037,8 +6068,13 @@
|
|
|
6037
6068
|
"type": "string"
|
|
6038
6069
|
},
|
|
6039
6070
|
"options": {},
|
|
6040
|
-
"
|
|
6041
|
-
"
|
|
6071
|
+
"requiredWhen": {
|
|
6072
|
+
"allOf": [
|
|
6073
|
+
{
|
|
6074
|
+
"$ref": "#/components/schemas/Condition"
|
|
6075
|
+
}
|
|
6076
|
+
],
|
|
6077
|
+
"nullable": true
|
|
6042
6078
|
},
|
|
6043
6079
|
"type": {
|
|
6044
6080
|
"type": "string",
|
|
@@ -6048,13 +6084,20 @@
|
|
|
6048
6084
|
},
|
|
6049
6085
|
"value": {
|
|
6050
6086
|
"nullable": true
|
|
6087
|
+
},
|
|
6088
|
+
"visibleWhen": {
|
|
6089
|
+
"allOf": [
|
|
6090
|
+
{
|
|
6091
|
+
"$ref": "#/components/schemas/Condition"
|
|
6092
|
+
}
|
|
6093
|
+
],
|
|
6094
|
+
"nullable": true
|
|
6051
6095
|
}
|
|
6052
6096
|
}
|
|
6053
6097
|
},
|
|
6054
6098
|
{
|
|
6055
6099
|
"type": "object",
|
|
6056
6100
|
"required": [
|
|
6057
|
-
"required",
|
|
6058
6101
|
"label",
|
|
6059
6102
|
"name",
|
|
6060
6103
|
"options",
|
|
@@ -6071,8 +6114,13 @@
|
|
|
6071
6114
|
"type": "string"
|
|
6072
6115
|
},
|
|
6073
6116
|
"options": {},
|
|
6074
|
-
"
|
|
6075
|
-
"
|
|
6117
|
+
"requiredWhen": {
|
|
6118
|
+
"allOf": [
|
|
6119
|
+
{
|
|
6120
|
+
"$ref": "#/components/schemas/Condition"
|
|
6121
|
+
}
|
|
6122
|
+
],
|
|
6123
|
+
"nullable": true
|
|
6076
6124
|
},
|
|
6077
6125
|
"type": {
|
|
6078
6126
|
"type": "string",
|
|
@@ -6082,13 +6130,20 @@
|
|
|
6082
6130
|
},
|
|
6083
6131
|
"value": {
|
|
6084
6132
|
"nullable": true
|
|
6133
|
+
},
|
|
6134
|
+
"visibleWhen": {
|
|
6135
|
+
"allOf": [
|
|
6136
|
+
{
|
|
6137
|
+
"$ref": "#/components/schemas/Condition"
|
|
6138
|
+
}
|
|
6139
|
+
],
|
|
6140
|
+
"nullable": true
|
|
6085
6141
|
}
|
|
6086
6142
|
}
|
|
6087
6143
|
},
|
|
6088
6144
|
{
|
|
6089
6145
|
"type": "object",
|
|
6090
6146
|
"required": [
|
|
6091
|
-
"required",
|
|
6092
6147
|
"label",
|
|
6093
6148
|
"name",
|
|
6094
6149
|
"options",
|
|
@@ -6107,8 +6162,13 @@
|
|
|
6107
6162
|
"options": {
|
|
6108
6163
|
"$ref": "#/components/schemas/FileOptions"
|
|
6109
6164
|
},
|
|
6110
|
-
"
|
|
6111
|
-
"
|
|
6165
|
+
"requiredWhen": {
|
|
6166
|
+
"allOf": [
|
|
6167
|
+
{
|
|
6168
|
+
"$ref": "#/components/schemas/Condition"
|
|
6169
|
+
}
|
|
6170
|
+
],
|
|
6171
|
+
"nullable": true
|
|
6112
6172
|
},
|
|
6113
6173
|
"type": {
|
|
6114
6174
|
"type": "string",
|
|
@@ -6118,13 +6178,20 @@
|
|
|
6118
6178
|
},
|
|
6119
6179
|
"value": {
|
|
6120
6180
|
"nullable": true
|
|
6181
|
+
},
|
|
6182
|
+
"visibleWhen": {
|
|
6183
|
+
"allOf": [
|
|
6184
|
+
{
|
|
6185
|
+
"$ref": "#/components/schemas/Condition"
|
|
6186
|
+
}
|
|
6187
|
+
],
|
|
6188
|
+
"nullable": true
|
|
6121
6189
|
}
|
|
6122
6190
|
}
|
|
6123
6191
|
},
|
|
6124
6192
|
{
|
|
6125
6193
|
"type": "object",
|
|
6126
6194
|
"required": [
|
|
6127
|
-
"required",
|
|
6128
6195
|
"label",
|
|
6129
6196
|
"name",
|
|
6130
6197
|
"options",
|
|
@@ -6154,8 +6221,13 @@
|
|
|
6154
6221
|
"options": {
|
|
6155
6222
|
"$ref": "#/components/schemas/SelectOptions"
|
|
6156
6223
|
},
|
|
6157
|
-
"
|
|
6158
|
-
"
|
|
6224
|
+
"requiredWhen": {
|
|
6225
|
+
"allOf": [
|
|
6226
|
+
{
|
|
6227
|
+
"$ref": "#/components/schemas/Condition"
|
|
6228
|
+
}
|
|
6229
|
+
],
|
|
6230
|
+
"nullable": true
|
|
6159
6231
|
},
|
|
6160
6232
|
"type": {
|
|
6161
6233
|
"type": "string",
|
|
@@ -6165,13 +6237,20 @@
|
|
|
6165
6237
|
},
|
|
6166
6238
|
"value": {
|
|
6167
6239
|
"nullable": true
|
|
6240
|
+
},
|
|
6241
|
+
"visibleWhen": {
|
|
6242
|
+
"allOf": [
|
|
6243
|
+
{
|
|
6244
|
+
"$ref": "#/components/schemas/Condition"
|
|
6245
|
+
}
|
|
6246
|
+
],
|
|
6247
|
+
"nullable": true
|
|
6168
6248
|
}
|
|
6169
6249
|
}
|
|
6170
6250
|
},
|
|
6171
6251
|
{
|
|
6172
6252
|
"type": "object",
|
|
6173
6253
|
"required": [
|
|
6174
|
-
"required",
|
|
6175
6254
|
"label",
|
|
6176
6255
|
"name",
|
|
6177
6256
|
"options",
|
|
@@ -6188,8 +6267,13 @@
|
|
|
6188
6267
|
"type": "string"
|
|
6189
6268
|
},
|
|
6190
6269
|
"options": {},
|
|
6191
|
-
"
|
|
6192
|
-
"
|
|
6270
|
+
"requiredWhen": {
|
|
6271
|
+
"allOf": [
|
|
6272
|
+
{
|
|
6273
|
+
"$ref": "#/components/schemas/Condition"
|
|
6274
|
+
}
|
|
6275
|
+
],
|
|
6276
|
+
"nullable": true
|
|
6193
6277
|
},
|
|
6194
6278
|
"type": {
|
|
6195
6279
|
"type": "string",
|
|
@@ -6199,6 +6283,14 @@
|
|
|
6199
6283
|
},
|
|
6200
6284
|
"value": {
|
|
6201
6285
|
"nullable": true
|
|
6286
|
+
},
|
|
6287
|
+
"visibleWhen": {
|
|
6288
|
+
"allOf": [
|
|
6289
|
+
{
|
|
6290
|
+
"$ref": "#/components/schemas/Condition"
|
|
6291
|
+
}
|
|
6292
|
+
],
|
|
6293
|
+
"nullable": true
|
|
6202
6294
|
}
|
|
6203
6295
|
}
|
|
6204
6296
|
}
|
|
@@ -7660,6 +7752,14 @@
|
|
|
7660
7752
|
"additionalProperties": {
|
|
7661
7753
|
"type": "string"
|
|
7662
7754
|
}
|
|
7755
|
+
},
|
|
7756
|
+
"visibleWhen": {
|
|
7757
|
+
"allOf": [
|
|
7758
|
+
{
|
|
7759
|
+
"$ref": "#/components/schemas/Condition"
|
|
7760
|
+
}
|
|
7761
|
+
],
|
|
7762
|
+
"nullable": true
|
|
7663
7763
|
}
|
|
7664
7764
|
}
|
|
7665
7765
|
},
|
|
@@ -7822,6 +7922,12 @@
|
|
|
7822
7922
|
"description": "Biometric check data (for face matching results)",
|
|
7823
7923
|
"nullable": true
|
|
7824
7924
|
},
|
|
7925
|
+
"documentExpiredWebhookSentAt": {
|
|
7926
|
+
"type": "string",
|
|
7927
|
+
"format": "date",
|
|
7928
|
+
"description": "Date on which a DocumentExpired webhook was last sent for this DV result.\nUsed by the AML worker to deduplicate repeated expiry notifications across\nrefresh ticks — once set, the webhook is not re-enqueued.",
|
|
7929
|
+
"nullable": true
|
|
7930
|
+
},
|
|
7825
7931
|
"imageQuality": {
|
|
7826
7932
|
"type": "array",
|
|
7827
7933
|
"items": {
|
|
@@ -8836,8 +8942,10 @@
|
|
|
8836
8942
|
"validation_flow_not_found",
|
|
8837
8943
|
"validation_empty_parameter",
|
|
8838
8944
|
"validation_form_not_found",
|
|
8945
|
+
"validation_organization_not_found",
|
|
8839
8946
|
"validation_workflow_graph_invalid",
|
|
8840
|
-
"validation_invalid_role_for_invitation"
|
|
8947
|
+
"validation_invalid_role_for_invitation",
|
|
8948
|
+
"validation_form_condition_forward_ref"
|
|
8841
8949
|
]
|
|
8842
8950
|
},
|
|
8843
8951
|
"VaultUnlockPasskeyData": {
|
package/package.json
CHANGED