@zyphe-sdk/core 0.1.5 → 0.1.6

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 CHANGED
@@ -1,20 +1,1612 @@
1
- /**
2
- * Verifies a webhook signature header using the Web Crypto API (browser).
3
- * @param secretHex - The hex-encoded secret key.
4
- * @param rawBodyString - The raw request body as a string.
5
- * @param signatureHeader - The header string, e.g. "t=1234567890,v0=abcdef..."
6
- * @returns Promise resolving to true if the signature is valid, false otherwise.
7
- */
8
- declare function verifyWebhookSignatureHeader$1(secretHex: string, rawBodyString: string, signatureHeader: string): Promise<boolean>;
1
+ import * as openapi_fetch from 'openapi-fetch';
2
+
3
+ declare const Environments: {
4
+ readonly LOCAL: "local";
5
+ readonly STAGING: "staging";
6
+ readonly PRODUCTION: "production";
7
+ };
8
+ type Environment = (typeof Environments)[keyof typeof Environments];
9
+ interface EnvironmentConfig {
10
+ appUrl: string;
11
+ apiUrl: string;
12
+ }
13
+ declare const EnvironmentConfigs: Record<Environment, EnvironmentConfig>;
14
+ declare const API_KEY_HEADER = "x-api-key";
15
+
16
+ interface components$1 {
17
+ schemas: {
18
+ AddressData: {
19
+ addressLine?: string | null;
20
+ building: string;
21
+ city: string;
22
+ country: string;
23
+ flat: string;
24
+ houseNumber: string;
25
+ postalCode: string;
26
+ street: string;
27
+ };
28
+ AmlEntityResponse: {
29
+ address?: string[];
30
+ birthCountry?: string[];
31
+ birthDate?: string[];
32
+ birthPlace?: string[];
33
+ country?: string[];
34
+ email?: string[];
35
+ firstName?: string[];
36
+ gender?: string[];
37
+ lastName?: string[];
38
+ middleName?: string[];
39
+ name?: string[];
40
+ nationality?: string[];
41
+ occupancies?: components$1["schemas"]["AmlOccupancy"][];
42
+ phone?: string[];
43
+ position?: string[];
44
+ sanctions?: components$1["schemas"]["AmlSanction"][];
45
+ title?: string[];
46
+ topics?: string[];
47
+ };
48
+ AmlOccupancy: {
49
+ endDate?: string[];
50
+ post?: components$1["schemas"]["AmlPosition"][];
51
+ startDate?: string[];
52
+ status?: string[];
53
+ };
54
+ AmlOrganization: {
55
+ country?: string[];
56
+ description?: string[];
57
+ name?: string[];
58
+ summary?: string[];
59
+ };
60
+ AmlPosition: {
61
+ country?: string[];
62
+ description?: string[];
63
+ dissolutionDate?: string[];
64
+ inceptionDate?: string[];
65
+ name?: string[];
66
+ numberOfSeats?: number[];
67
+ organization?: components$1["schemas"]["AmlOrganization"][];
68
+ subnationalArea?: string[];
69
+ summary?: string[];
70
+ topics?: string[];
71
+ };
72
+ AmlResult: {
73
+ /** Format: date-time */
74
+ createdAt: string;
75
+ data: {
76
+ [key: string]: unknown;
77
+ };
78
+ id: string;
79
+ pep: boolean;
80
+ sanctions: boolean;
81
+ /** Format: date-time */
82
+ updatedAt: string;
83
+ verificationRequestId?: string | null;
84
+ };
85
+ AmlSanction: {
86
+ authority?: string[];
87
+ authorityId?: string[];
88
+ country?: string[];
89
+ date?: string[];
90
+ duration?: string[];
91
+ endDate?: string[];
92
+ listingDate?: string[];
93
+ program?: string[];
94
+ reason?: string[];
95
+ startDate?: string[];
96
+ status?: string[];
97
+ unscId?: string[];
98
+ };
99
+ AmlSearchResponse: components$1["schemas"]["AmlEntityResponse"][];
100
+ /** @enum {string} */
101
+ ApiKeyType: "PUBLISHABLE" | "SECRET";
102
+ BaxeError: {
103
+ /** Format: int32 */
104
+ code: number;
105
+ errorTag: components$1["schemas"]["ErrorTags"];
106
+ message?: string | null;
107
+ };
108
+ BusinessInformation: {
109
+ address: string;
110
+ businessActivity: string;
111
+ city: string;
112
+ companyName: string;
113
+ companyType: string;
114
+ contactEmail: string;
115
+ country: string;
116
+ incorporationDate: string;
117
+ postZipCode: string;
118
+ registrationNumber: string;
119
+ };
120
+ CountriesFilter: {
121
+ accepted: string[];
122
+ blocked: string[];
123
+ };
124
+ CreateVerificationRequestPayload: {
125
+ continueUrl?: string | null;
126
+ cookiesPolicyAccepted: boolean;
127
+ customData?: {
128
+ [key: string]: unknown;
129
+ } | null;
130
+ email: string;
131
+ flowStepId: string;
132
+ privacyPolicyAccepted: boolean;
133
+ termsAndConditionsAccepted: boolean;
134
+ };
135
+ CreateVerificationRequestResponse: {
136
+ verificationRequest: components$1["schemas"]["VerificationRequest"];
137
+ websocketNamespace: string;
138
+ };
139
+ Document: {
140
+ /** Format: date-time */
141
+ createdAt: string;
142
+ /** Format: date-time */
143
+ expiresAt?: string | null;
144
+ id: string;
145
+ metadata: unknown;
146
+ path: string;
147
+ /** Format: int32 */
148
+ type: number;
149
+ typeName: string;
150
+ /** Format: date-time */
151
+ updatedAt: string;
152
+ vaultId: string;
153
+ };
154
+ DocumentData: {
155
+ documentCan?: string;
156
+ documentClassCode?: string;
157
+ documentNumber: string;
158
+ /** Format: date */
159
+ expiryDate?: string | null;
160
+ issuingAuthority: string;
161
+ /** Format: date */
162
+ issuingDate?: string | null;
163
+ issuingState: string;
164
+ mrzStrings?: string;
165
+ };
166
+ DocumentFormatFilter: {
167
+ formats: string[];
168
+ };
169
+ DocumentImage: {
170
+ path: string;
171
+ type: string;
172
+ };
173
+ DocumentTypeFilter: {
174
+ types: string[];
175
+ };
176
+ DocumentUpload: {
177
+ filename: string;
178
+ presignedUrl?: string | null;
179
+ };
180
+ DvConfig: {
181
+ allowedDocumentsPerCountry?: {
182
+ [key: string]: string[];
183
+ } | null;
184
+ countriesFilter?: components$1["schemas"]["CountriesFilter"] | null;
185
+ documentFormatsFilter?: components$1["schemas"]["DocumentFormatFilter"] | null;
186
+ documentTypesFilter?: components$1["schemas"]["DocumentTypeFilter"] | null;
187
+ /** @example { "en_button_label": "Next step" } */
188
+ labels?: {
189
+ [key: string]: string;
190
+ };
191
+ /** Format: int32 */
192
+ minimumAge: number;
193
+ skipLiveness?: boolean;
194
+ thresholds?: {
195
+ documentScorePercent?: number;
196
+ portraitMatchPercent?: number;
197
+ } | null;
198
+ };
199
+ /** @enum {string} */
200
+ DvConfigThreshold: "documentScorePercent" | "portraitMatchPercent";
201
+ /** @enum {string} */
202
+ DvReason: "UNKNOWN" | "WRONG_DOCUMENT_TYPE" | "COUNTRY_FILTER" | "FACE_MATCH_CHECK" | "OVERALL_STATUS" | "DOCUMENT_COUNTRY_MISMATCH" | "DOCUMENT_COUNTRY_MISSING" | "DATE_OF_EXPIRY_NOT_VALID" | "DATE_OF_EXPIRY_NOT_READABLE" | "DATE_OF_EXPIRY_FIELD_MISSING" | "DOCUMENT_ALREADY_USED_BY_ANOTHER_USER" | "DOCUMENT_FINGERPRINT_COMPUTATION" | "SECURITY_CHECK_FAILED" | "DOCUMENT_SCORE_BELOW_THRESHOLD" | "DOCUMENT_TYPE_NOT_DEFINED" | "LIVENESS_CHECK_FAILED" | "DOCUMENT_NOT_FOUND" | "DATE_OF_BIRTH_BELOW_MINIMUM_AGE";
203
+ DvResult: {
204
+ browser?: string | null;
205
+ class?: string | null;
206
+ /** Format: date-time */
207
+ createdAt?: string | null;
208
+ data: {
209
+ [key: string]: unknown;
210
+ };
211
+ documentId?: string | null;
212
+ /** Format: int32 */
213
+ documentScorePercent?: number | null;
214
+ /** Format: int32 */
215
+ documentType?: number | null;
216
+ firstName?: string | null;
217
+ flowStep?: Omit<components$1["schemas"]["FlowStep"], "type"> | null;
218
+ id: string;
219
+ lastName?: string | null;
220
+ platform?: string | null;
221
+ /** Format: int32 */
222
+ portraitMatchPercent?: number | null;
223
+ processAdditionalData: {
224
+ [key: string]: unknown;
225
+ };
226
+ reasons: components$1["schemas"]["DvReason"][];
227
+ status: components$1["schemas"]["ResultStatus"];
228
+ /** Format: date-time */
229
+ updatedAt?: string | null;
230
+ verificationRequestId?: string | null;
231
+ };
232
+ /** @enum {string} */
233
+ 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" | "authentication_request_not_found" | "invalid_magic_link" | "user_disabled" | "invalid_verify_link" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "authentication_request_expired" | "authentication_request_already_used" | "verification_session_expired" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_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_revoked" | "invite_expired" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "organization_product_not_active" | "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";
234
+ /** @enum {string} */
235
+ FilterOperator: "unfiltered" | "in" | "equals" | "not-in" | "not-equals" | "contains";
236
+ Flow: {
237
+ /** Format: date-time */
238
+ createdAt?: string | null;
239
+ extendedWebhook: boolean;
240
+ id: string;
241
+ name: string;
242
+ slug: string;
243
+ steps: components$1["schemas"]["FlowStep"][];
244
+ successUrl: string;
245
+ /** Format: date-time */
246
+ updatedAt?: string | null;
247
+ webhookUrl: string;
248
+ };
249
+ FlowResult: {
250
+ amlResults: components$1["schemas"]["AmlResult"][];
251
+ /** Format: date-time */
252
+ createdAt?: string | null;
253
+ customData: {
254
+ [key: string]: unknown;
255
+ };
256
+ dvResults: components$1["schemas"]["DvResult"][];
257
+ flow?: components$1["schemas"]["Flow"] | null;
258
+ flowSlug: string;
259
+ formResults: components$1["schemas"]["FormResult"][];
260
+ id: string;
261
+ identity?: components$1["schemas"]["Identity"] | null;
262
+ kybResults: components$1["schemas"]["KybResult"][];
263
+ organization?: components$1["schemas"]["Organization"] | null;
264
+ organizationId: string;
265
+ poaResults: components$1["schemas"]["PoaResult"][];
266
+ spidResults: components$1["schemas"]["SpidResult"][];
267
+ /** Format: date-time */
268
+ updatedAt?: string | null;
269
+ };
270
+ FlowStep: {
271
+ config: components$1["schemas"]["DvConfig"];
272
+ /** Format: date-time */
273
+ createdAt?: string | null;
274
+ flowId: string;
275
+ gotoStepId?: string | null;
276
+ id: string;
277
+ name: string;
278
+ /** Format: int32 */
279
+ order: number;
280
+ slug: string;
281
+ successUrl?: string | null;
282
+ /** @enum {string} */
283
+ type: "DV";
284
+ /** Format: date-time */
285
+ updatedAt?: string | null;
286
+ } | {
287
+ config: components$1["schemas"]["FormConfig"];
288
+ /** Format: date-time */
289
+ createdAt?: string | null;
290
+ flowId: string;
291
+ gotoStepId?: string | null;
292
+ id: string;
293
+ name: string;
294
+ /** Format: int32 */
295
+ order: number;
296
+ slug: string;
297
+ successUrl?: string | null;
298
+ /** @enum {string} */
299
+ type: "FORM";
300
+ /** Format: date-time */
301
+ updatedAt?: string | null;
302
+ } | {
303
+ config: components$1["schemas"]["PoaConfig"];
304
+ /** Format: date-time */
305
+ createdAt?: string | null;
306
+ flowId: string;
307
+ gotoStepId?: string | null;
308
+ id: string;
309
+ name: string;
310
+ /** Format: int32 */
311
+ order: number;
312
+ slug: string;
313
+ successUrl?: string | null;
314
+ /** @enum {string} */
315
+ type: "POA";
316
+ /** Format: date-time */
317
+ updatedAt?: string | null;
318
+ } | {
319
+ config: components$1["schemas"]["KybConfig"];
320
+ /** Format: date-time */
321
+ createdAt?: string | null;
322
+ flowId: string;
323
+ gotoStepId?: string | null;
324
+ id: string;
325
+ name: string;
326
+ /** Format: int32 */
327
+ order: number;
328
+ slug: string;
329
+ successUrl?: string | null;
330
+ /** @enum {string} */
331
+ type: "KYB";
332
+ /** Format: date-time */
333
+ updatedAt?: string | null;
334
+ } | {
335
+ config: components$1["schemas"]["SpidConfig"];
336
+ /** Format: date-time */
337
+ createdAt?: string | null;
338
+ flowId: string;
339
+ gotoStepId?: string | null;
340
+ id: string;
341
+ name: string;
342
+ /** Format: int32 */
343
+ order: number;
344
+ slug: string;
345
+ successUrl?: string | null;
346
+ /** @enum {string} */
347
+ type: "SPID";
348
+ /** Format: date-time */
349
+ updatedAt?: string | null;
350
+ };
351
+ FlowStepConfig: components$1["schemas"]["DvConfig"] | components$1["schemas"]["FormConfig"] | components$1["schemas"]["PoaConfig"] | components$1["schemas"]["KybConfig"] | components$1["schemas"]["SpidConfig"];
352
+ Form: {
353
+ /** Format: date-time */
354
+ createdAt?: string | null;
355
+ description?: string | null;
356
+ id: string;
357
+ name: string;
358
+ organizationId: string;
359
+ sections: components$1["schemas"]["FormSection"][];
360
+ /** Format: date-time */
361
+ updatedAt?: string | null;
362
+ };
363
+ FormAnswerSection: {
364
+ answers: {
365
+ [key: string]: unknown;
366
+ };
367
+ name: string;
368
+ };
369
+ FormConfig: {
370
+ form?: components$1["schemas"]["Form"] | null;
371
+ formId: string;
372
+ /** @example { "default": "Next step" } */
373
+ labels?: {
374
+ [key: string]: string;
375
+ };
376
+ };
377
+ FormItem: {
378
+ content: components$1["schemas"]["InputField"];
379
+ /** @enum {string} */
380
+ type: "InputField";
381
+ } | {
382
+ content: components$1["schemas"]["Plaintext"];
383
+ /** @enum {string} */
384
+ type: "Plaintext";
385
+ } | {
386
+ /** @enum {string} */
387
+ type: "Separator";
388
+ };
389
+ /** @enum {string} */
390
+ FormReason: "UNKNOWN";
391
+ FormResult: {
392
+ /** Format: date-time */
393
+ createdAt?: string | null;
394
+ flowResultId: string;
395
+ flowStep?: Omit<components$1["schemas"]["FlowStep"], "type"> | null;
396
+ flowStepId?: string | null;
397
+ form?: components$1["schemas"]["Form"] | null;
398
+ id: string;
399
+ reason?: components$1["schemas"]["FormReason"] | null;
400
+ sections: components$1["schemas"]["FormSection"][];
401
+ status: components$1["schemas"]["ResultStatus"];
402
+ /** Format: date-time */
403
+ updatedAt?: string | null;
404
+ verificationRequestId?: string | null;
405
+ };
406
+ FormSection: {
407
+ items: components$1["schemas"]["FormItem"][];
408
+ label: {
409
+ [key: string]: string;
410
+ };
411
+ name: string;
412
+ };
413
+ GetApiKeyResponse: {
414
+ apiKey: components$1["schemas"]["ZypheApiKey"];
415
+ };
416
+ GetFlowResponse: {
417
+ flow: components$1["schemas"]["Flow"];
418
+ };
419
+ GetFormResponse: {
420
+ form: components$1["schemas"]["Form"];
421
+ };
422
+ GetFullFlowResponse: {
423
+ flow: components$1["schemas"]["Flow"];
424
+ organizationName: string;
425
+ settings: components$1["schemas"]["Settings"];
426
+ };
427
+ GetVerificationRequestResponse: {
428
+ identity: components$1["schemas"]["Identity"];
429
+ verificationRequest: components$1["schemas"]["VerificationRequest"];
430
+ };
431
+ Identity: {
432
+ /** Format: date-time */
433
+ createdAt?: string | null;
434
+ defaultOrganizationId?: string | null;
435
+ email: string;
436
+ emailVerified: boolean;
437
+ id: string;
438
+ isActive: boolean;
439
+ role: components$1["schemas"]["Role"];
440
+ /** Format: date-time */
441
+ updatedAt?: string | null;
442
+ zid: string;
443
+ };
444
+ Image: {
445
+ /** Format: int32 */
446
+ containerType: number;
447
+ /** Format: int64 */
448
+ lightIndex: number;
449
+ /** Format: int64 */
450
+ pageIndex: number;
451
+ source: string;
452
+ value: string;
453
+ };
454
+ InputField: {
455
+ label: {
456
+ [key: string]: string;
457
+ };
458
+ name: string;
459
+ options: {
460
+ [key: string]: string;
461
+ };
462
+ required: boolean;
463
+ type: components$1["schemas"]["InputFieldType"];
464
+ value?: unknown;
465
+ };
466
+ /** @enum {string} */
467
+ InputFieldType: "date" | "text" | "textarea" | "checkbox";
468
+ KybConfig: {
469
+ kycFlowId: string;
470
+ /** @example { "default": "Next step" } */
471
+ labels?: {
472
+ [key: string]: string;
473
+ };
474
+ /**
475
+ * Format: int32
476
+ * @default 10
477
+ * @example 5
478
+ */
479
+ maxFileUploads: number;
480
+ /**
481
+ * Format: int32
482
+ * @default 10
483
+ * @example 3
484
+ */
485
+ maxUbos: number;
486
+ };
487
+ KybResult: {
488
+ businessInformation?: components$1["schemas"]["BusinessInformation"] | null;
489
+ /** Format: date-time */
490
+ createdAt?: string | null;
491
+ documentUploads?: components$1["schemas"]["DocumentUpload"][] | null;
492
+ flowStep?: Omit<components$1["schemas"]["FlowStep"], "type"> | null;
493
+ id: string;
494
+ pepAndSanctionsStatus: components$1["schemas"]["PepAndSanctionsStatus"];
495
+ reason?: string | null;
496
+ report?: string | null;
497
+ status: components$1["schemas"]["ModerationResultStatus"];
498
+ uboDefinitions?: components$1["schemas"]["UboDefinition"][] | null;
499
+ /** Format: date-time */
500
+ updatedAt?: string | null;
501
+ verificationRequestId?: string | null;
502
+ };
503
+ /** @enum {string} */
504
+ Locale: "en";
505
+ ModerateKybResultPayload: {
506
+ pepAndSanctionsStatus?: components$1["schemas"]["PepAndSanctionsStatusField"] | null;
507
+ /** Format: binary */
508
+ reportFile?: Blob | null;
509
+ status?: components$1["schemas"]["ModerationResultStatusField"] | null;
510
+ };
511
+ ModerateKybResultResponse: {
512
+ success: boolean;
513
+ };
514
+ /** @enum {string} */
515
+ ModerationResultStatus: "ACQUIRING" | "PENDING_MODERATION" | "SUCCESS" | "FAILED";
516
+ ModerationResultStatusField: components$1["schemas"]["ModerationResultStatus"];
517
+ Organization: {
518
+ address: string;
519
+ country: string;
520
+ /** Format: date-time */
521
+ createdAt?: string | null;
522
+ email: string;
523
+ id: string;
524
+ industry?: string | null;
525
+ name: string;
526
+ phone: string;
527
+ postcode?: string | null;
528
+ registrationNumber: string;
529
+ settings?: components$1["schemas"]["Settings"] | null;
530
+ slug: string;
531
+ /** Format: date-time */
532
+ updatedAt?: string | null;
533
+ website: string;
534
+ };
535
+ Pagination: {
536
+ /** @example createdAt:in:2025-01-01,2025-01-02;updatedAt:gt:2025-01-02 */
537
+ filter?: string;
538
+ /**
539
+ * Format: int32
540
+ * @example 0
541
+ */
542
+ skip?: number;
543
+ /** @example createdAt:desc */
544
+ sort?: string;
545
+ /**
546
+ * Format: int32
547
+ * @example 100
548
+ */
549
+ take?: number;
550
+ };
551
+ /** @enum {string} */
552
+ PepAndSanctionsStatus: "REVIEW" | "PENDING" | "SUCCESS" | "FAILED" | "IN_PROGRESS";
553
+ PepAndSanctionsStatusField: components$1["schemas"]["PepAndSanctionsStatus"];
554
+ PersonalData: {
555
+ dateOfBirth: string;
556
+ gender: string;
557
+ givenName: string;
558
+ nationality: string;
559
+ personalNumber?: string;
560
+ placeOfBirth?: string;
561
+ surname: string;
562
+ };
563
+ Plaintext: {
564
+ text: {
565
+ [key: string]: string;
566
+ };
567
+ };
568
+ PoaConfig: {
569
+ documentFilter: components$1["schemas"]["PoaDocumentType"][];
570
+ /** @example { "default": "Next step" } */
571
+ labels?: {
572
+ [key: string]: string;
573
+ };
574
+ /**
575
+ * Format: int32
576
+ * @example 90
577
+ */
578
+ maxAgeDays?: number;
579
+ };
580
+ /** @enum {string} */
581
+ PoaDocumentType: "PAY_SLIP" | "UTILITY_BILL" | "FINANCIAL_DOCUMENT" | "RECEIPT" | "INVOICE" | "BANK_DOCUMENT";
582
+ /** @enum {string} */
583
+ PoaReason: "UNKNOWN" | "DOCUMENT_TYPE_NOT_ALLOWED" | "NAME_MISMATCH" | "DATE_TOO_OLD" | "INVALID_DOCUMENT";
584
+ PoaResult: {
585
+ /** Format: date-time */
586
+ checkedAt?: string | null;
587
+ /** Format: date-time */
588
+ createdAt: string;
589
+ documentId?: string | null;
590
+ documentType?: components$1["schemas"]["PoaDocumentType"] | null;
591
+ flowStep?: Omit<components$1["schemas"]["FlowStep"], "type"> | null;
592
+ id: string;
593
+ reason?: components$1["schemas"]["PoaReason"] | null;
594
+ status: components$1["schemas"]["ResultStatus"];
595
+ /** Format: date-time */
596
+ updatedAt: string;
597
+ verificationRequestId?: string | null;
598
+ };
599
+ ProcessAddressDocumentRequest: {
600
+ /** Format: binary */
601
+ file: Blob;
602
+ };
603
+ ProcessAddressDocumentResponse: {
604
+ jobId: string;
605
+ verificationRequestId: string;
606
+ websocketNamespace: string;
607
+ };
608
+ /** @enum {string} */
609
+ ProductType: "UNKNOWN" | "KYC" | "KYB" | "PRODUCTION_MODE" | "SPID";
610
+ /** @enum {string} */
611
+ ResultStatus: "PASSED" | "FAILED";
612
+ /** @enum {string} */
613
+ Role: "GUEST" | "USER" | "ADMIN";
614
+ SdkCreateVerificationRequestPayload: {
615
+ customData?: {
616
+ [key: string]: unknown;
617
+ } | null;
618
+ email: string;
619
+ flowStepId: string;
620
+ };
621
+ SdkCreateVerificationRequestResponse: {
622
+ email: string;
623
+ flowSlug: string;
624
+ flowStepSlug: string;
625
+ isSandbox: boolean;
626
+ verificationRequest: components$1["schemas"]["VerificationRequest"];
627
+ websocketNamespace: string;
628
+ zypheToken: string;
629
+ };
630
+ Settings: {
631
+ /** Format: date-time */
632
+ createdAt?: string | null;
633
+ extendedWebhook?: boolean | null;
634
+ primaryColor?: string | null;
635
+ profileImage?: string | null;
636
+ secondaryColor?: string | null;
637
+ /** Format: date-time */
638
+ updatedAt?: string | null;
639
+ webhookSecret?: string | null;
640
+ };
641
+ SpidConfig: {
642
+ /** @example { "default": "Next step" } */
643
+ labels?: {
644
+ [key: string]: string;
645
+ };
646
+ };
647
+ SpidResult: {
648
+ /** Format: date-time */
649
+ createdAt?: string | null;
650
+ flowStep?: Omit<components$1["schemas"]["FlowStep"], "type"> | null;
651
+ id: string;
652
+ path: string;
653
+ reason?: string | null;
654
+ status: components$1["schemas"]["ResultStatus"];
655
+ /** Format: date-time */
656
+ updatedAt?: string | null;
657
+ verificationRequestId?: string | null;
658
+ };
659
+ SpidResultDetails: {
660
+ address?: string | null;
661
+ companyName?: string | null;
662
+ companyVatNumber?: string | null;
663
+ countryOfBirth?: string | null;
664
+ dateOfBirth?: string | null;
665
+ digitalAddress?: string | null;
666
+ email?: string | null;
667
+ firstName?: string | null;
668
+ fiscalNumber?: string | null;
669
+ fullName?: string | null;
670
+ gender?: string | null;
671
+ id?: string | null;
672
+ lastName?: string | null;
673
+ mobilePhone?: string | null;
674
+ placeOfBirth?: string | null;
675
+ registeredOffice?: string | null;
676
+ spidCode?: string | null;
677
+ username?: string | null;
678
+ };
679
+ UboDefinition: {
680
+ country: string;
681
+ dateOfBirth: string;
682
+ emailAddress: string;
683
+ firstName: string;
684
+ gender: string;
685
+ lastName: string;
686
+ };
687
+ /** @enum {string} */
688
+ 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";
689
+ VerificationRequest: {
690
+ amlResult?: components$1["schemas"]["AmlResult"] | null;
691
+ /** Format: int32 */
692
+ attemptsCount: number;
693
+ /** Format: date-time */
694
+ createdAt?: string | null;
695
+ customData: {
696
+ [key: string]: unknown;
697
+ };
698
+ dvResult?: components$1["schemas"]["DvResult"] | null;
699
+ flowId: string;
700
+ flowStepId: string;
701
+ formResult?: components$1["schemas"]["FormResult"] | null;
702
+ id: string;
703
+ identity?: components$1["schemas"]["Identity"] | null;
704
+ identityId: string;
705
+ kybResult?: components$1["schemas"]["KybResult"] | null;
706
+ organizationId: string;
707
+ poaResult?: components$1["schemas"]["PoaResult"] | null;
708
+ reason?: string | null;
709
+ spidResult?: components$1["schemas"]["SpidResult"] | null;
710
+ status: components$1["schemas"]["VerificationRequestStatus"];
711
+ /** Format: date-time */
712
+ updatedAt?: string | null;
713
+ };
714
+ /** @enum {string} */
715
+ VerificationRequestStatus: "PENDING" | "COMPLETED" | "FAILED" | "CANCELLED" | "QUEUED" | "PROCESSING";
716
+ ZypheApiKey: {
717
+ allowedOrigins: string[];
718
+ /** Format: date-time */
719
+ createdAt?: string | null;
720
+ description?: string | null;
721
+ id: string;
722
+ key: string;
723
+ keyType: string;
724
+ name?: string | null;
725
+ options: {
726
+ [key: string]: unknown;
727
+ };
728
+ organization?: components$1["schemas"]["Organization"] | null;
729
+ organizationId: string;
730
+ /** Format: date-time */
731
+ updatedAt?: string | null;
732
+ };
733
+ };
734
+ responses: never;
735
+ parameters: never;
736
+ requestBodies: never;
737
+ headers: never;
738
+ pathItems: never;
739
+ }
9
740
 
741
+ type SdkCreateVerificationRequestResponse = components$1["schemas"]["SdkCreateVerificationRequestResponse"];
10
742
  /**
11
- * Verifies a webhook signature header using Node.js crypto.
12
- * @param secretHex - The hex-encoded secret key.
13
- * @param rawBodyString - The raw request body as a string.
14
- * @param signatureHeader - The header string, e.g. "t=1234567890,v0=abcdef..."
15
- * @returns True if the signature is valid, false otherwise.
743
+ * Parameters for initializing the Zyphe iframe for a Flow.
744
+ * These will remain constant for each user that visits the Flow URL.
16
745
  */
17
- declare function verifyWebhookSignatureHeader(secretHex: string, rawBodyString: string, signatureHeader: string): boolean;
746
+ interface InitializeZypheFlowParams {
747
+ /**
748
+ * The ID of the Flow
749
+ * UUID v4 format
750
+ * @example "4810bc63-bfdd-4487-ae57-c939046f56b6"
751
+ */
752
+ flowId: string;
753
+ /**
754
+ * The ID of the FlowStep
755
+ * UUID v4 format
756
+ * @example "4810bc63-bfdd-4487-ae57-c939046f56b6"
757
+ */
758
+ flowStepId: string;
759
+ /**
760
+ * The email of the user.
761
+ * @example "user@example.com"
762
+ */
763
+ email: string;
764
+ /**
765
+ * The type of Flow URL.
766
+ * The third path segment of your Flow URL.
767
+ * @example "http://localhost:5173/flow/flowSlug/kyc/stepSlug"
768
+ */
769
+ product: "kyc";
770
+ /**
771
+ * Whether the Flow is a "sandbox" Flow.
772
+ *
773
+ * This will prepend "sandbox" to the final URL.
774
+ * @example "http://localhost:5173/sandbox/flow/flowSlug/kyc/stepSlug"
775
+ */
776
+ isSandbox: boolean;
777
+ }
778
+ interface SDKOptions {
779
+ apiKey: string;
780
+ environment: Environment;
781
+ /**
782
+ * If set, the QR code displayed on desktop devices of a Document Verification flow will direct to this URL.
783
+ * If not set, the QR code will direct to the corresponding zyphe.com URL, depending upon your configured environment.
784
+ *
785
+ * The URL will include the query parameters `zypheVr` and `zypheToken`.
786
+ *
787
+ * @default "https://app-dev.zyphe.com" || "https://verify.zyphe.com"
788
+ * @example "http://example.com"
789
+ */
790
+ handoffBaseUrl?: string;
791
+ /**
792
+ * The main background color of the page.
793
+ * This will override the primary color configured in verify.zyphe.com
794
+ *
795
+ * The accepted values are flexible, but we recommend a hex code.
796
+ * @example "#000000"
797
+ */
798
+ primaryColor?: string;
799
+ /**
800
+ * The accent color of the page, used for buttons, icons, etc.
801
+ * This will override the secondary color configured in verify.zyphe.com
802
+ *
803
+ * The accepted values are flexible, but we recommend a hex code.
804
+ * @example "#000000"
805
+ */
806
+ secondaryColor?: string;
807
+ /**
808
+ * If true, the verification session will be displayed in "fullscreen" mode.
809
+ */
810
+ isFullscreen?: boolean;
811
+ }
812
+
813
+ interface components {
814
+ schemas: {
815
+ AddressData: {
816
+ addressLine?: string | null;
817
+ building: string;
818
+ city: string;
819
+ country: string;
820
+ flat: string;
821
+ houseNumber: string;
822
+ postalCode: string;
823
+ street: string;
824
+ };
825
+ AmlEntityResponse: {
826
+ address?: string[];
827
+ birthCountry?: string[];
828
+ birthDate?: string[];
829
+ birthPlace?: string[];
830
+ country?: string[];
831
+ email?: string[];
832
+ firstName?: string[];
833
+ gender?: string[];
834
+ lastName?: string[];
835
+ middleName?: string[];
836
+ name?: string[];
837
+ nationality?: string[];
838
+ occupancies?: components["schemas"]["AmlOccupancy"][];
839
+ phone?: string[];
840
+ position?: string[];
841
+ sanctions?: components["schemas"]["AmlSanction"][];
842
+ title?: string[];
843
+ topics?: string[];
844
+ };
845
+ AmlOccupancy: {
846
+ endDate?: string[];
847
+ post?: components["schemas"]["AmlPosition"][];
848
+ startDate?: string[];
849
+ status?: string[];
850
+ };
851
+ AmlOrganization: {
852
+ country?: string[];
853
+ description?: string[];
854
+ name?: string[];
855
+ summary?: string[];
856
+ };
857
+ AmlPosition: {
858
+ country?: string[];
859
+ description?: string[];
860
+ dissolutionDate?: string[];
861
+ inceptionDate?: string[];
862
+ name?: string[];
863
+ numberOfSeats?: number[];
864
+ organization?: components["schemas"]["AmlOrganization"][];
865
+ subnationalArea?: string[];
866
+ summary?: string[];
867
+ topics?: string[];
868
+ };
869
+ AmlResult: {
870
+ /** Format: date-time */
871
+ createdAt: string;
872
+ data: {
873
+ [key: string]: unknown;
874
+ };
875
+ id: string;
876
+ pep: boolean;
877
+ sanctions: boolean;
878
+ /** Format: date-time */
879
+ updatedAt: string;
880
+ verificationRequestId?: string | null;
881
+ };
882
+ AmlSanction: {
883
+ authority?: string[];
884
+ authorityId?: string[];
885
+ country?: string[];
886
+ date?: string[];
887
+ duration?: string[];
888
+ endDate?: string[];
889
+ listingDate?: string[];
890
+ program?: string[];
891
+ reason?: string[];
892
+ startDate?: string[];
893
+ status?: string[];
894
+ unscId?: string[];
895
+ };
896
+ AmlSearchResponse: components["schemas"]["AmlEntityResponse"][];
897
+ /** @enum {string} */
898
+ ApiKeyType: "PUBLISHABLE" | "SECRET";
899
+ BaxeError: {
900
+ /** Format: int32 */
901
+ code: number;
902
+ errorTag: components["schemas"]["ErrorTags"];
903
+ message?: string | null;
904
+ };
905
+ BusinessInformation: {
906
+ address: string;
907
+ businessActivity: string;
908
+ city: string;
909
+ companyName: string;
910
+ companyType: string;
911
+ contactEmail: string;
912
+ country: string;
913
+ incorporationDate: string;
914
+ postZipCode: string;
915
+ registrationNumber: string;
916
+ };
917
+ CountriesFilter: {
918
+ accepted: string[];
919
+ blocked: string[];
920
+ };
921
+ CreateVerificationRequestPayload: {
922
+ continueUrl?: string | null;
923
+ cookiesPolicyAccepted: boolean;
924
+ customData?: {
925
+ [key: string]: unknown;
926
+ } | null;
927
+ email: string;
928
+ flowStepId: string;
929
+ privacyPolicyAccepted: boolean;
930
+ termsAndConditionsAccepted: boolean;
931
+ };
932
+ CreateVerificationRequestResponse: {
933
+ verificationRequest: components["schemas"]["VerificationRequest"];
934
+ websocketNamespace: string;
935
+ };
936
+ Document: {
937
+ /** Format: date-time */
938
+ createdAt: string;
939
+ /** Format: date-time */
940
+ expiresAt?: string | null;
941
+ id: string;
942
+ metadata: unknown;
943
+ path: string;
944
+ /** Format: int32 */
945
+ type: number;
946
+ typeName: string;
947
+ /** Format: date-time */
948
+ updatedAt: string;
949
+ vaultId: string;
950
+ };
951
+ DocumentData: {
952
+ documentCan?: string;
953
+ documentClassCode?: string;
954
+ documentNumber: string;
955
+ /** Format: date */
956
+ expiryDate?: string | null;
957
+ issuingAuthority: string;
958
+ /** Format: date */
959
+ issuingDate?: string | null;
960
+ issuingState: string;
961
+ mrzStrings?: string;
962
+ };
963
+ DocumentFormatFilter: {
964
+ formats: string[];
965
+ };
966
+ DocumentImage: {
967
+ path: string;
968
+ type: string;
969
+ };
970
+ DocumentTypeFilter: {
971
+ types: string[];
972
+ };
973
+ DocumentUpload: {
974
+ filename: string;
975
+ presignedUrl?: string | null;
976
+ };
977
+ DvConfig: {
978
+ allowedDocumentsPerCountry?: {
979
+ [key: string]: string[];
980
+ } | null;
981
+ countriesFilter?: components["schemas"]["CountriesFilter"] | null;
982
+ documentFormatsFilter?: components["schemas"]["DocumentFormatFilter"] | null;
983
+ documentTypesFilter?: components["schemas"]["DocumentTypeFilter"] | null;
984
+ /** @example { "en_button_label": "Next step" } */
985
+ labels?: {
986
+ [key: string]: string;
987
+ };
988
+ /** Format: int32 */
989
+ minimumAge: number;
990
+ skipLiveness?: boolean;
991
+ thresholds?: {
992
+ documentScorePercent?: number;
993
+ portraitMatchPercent?: number;
994
+ } | null;
995
+ };
996
+ /** @enum {string} */
997
+ DvConfigThreshold: "documentScorePercent" | "portraitMatchPercent";
998
+ /** @enum {string} */
999
+ DvReason: "UNKNOWN" | "WRONG_DOCUMENT_TYPE" | "COUNTRY_FILTER" | "FACE_MATCH_CHECK" | "OVERALL_STATUS" | "DOCUMENT_COUNTRY_MISMATCH" | "DOCUMENT_COUNTRY_MISSING" | "DATE_OF_EXPIRY_NOT_VALID" | "DATE_OF_EXPIRY_NOT_READABLE" | "DATE_OF_EXPIRY_FIELD_MISSING" | "DOCUMENT_ALREADY_USED_BY_ANOTHER_USER" | "DOCUMENT_FINGERPRINT_COMPUTATION" | "SECURITY_CHECK_FAILED" | "DOCUMENT_SCORE_BELOW_THRESHOLD" | "DOCUMENT_TYPE_NOT_DEFINED" | "LIVENESS_CHECK_FAILED" | "DOCUMENT_NOT_FOUND" | "DATE_OF_BIRTH_BELOW_MINIMUM_AGE";
1000
+ DvResult: {
1001
+ browser?: string | null;
1002
+ class?: string | null;
1003
+ /** Format: date-time */
1004
+ createdAt?: string | null;
1005
+ data: {
1006
+ [key: string]: unknown;
1007
+ };
1008
+ documentId?: string | null;
1009
+ /** Format: int32 */
1010
+ documentScorePercent?: number | null;
1011
+ /** Format: int32 */
1012
+ documentType?: number | null;
1013
+ firstName?: string | null;
1014
+ flowStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
1015
+ id: string;
1016
+ lastName?: string | null;
1017
+ platform?: string | null;
1018
+ /** Format: int32 */
1019
+ portraitMatchPercent?: number | null;
1020
+ processAdditionalData: {
1021
+ [key: string]: unknown;
1022
+ };
1023
+ reasons: components["schemas"]["DvReason"][];
1024
+ status: components["schemas"]["ResultStatus"];
1025
+ /** Format: date-time */
1026
+ updatedAt?: string | null;
1027
+ verificationRequestId?: string | null;
1028
+ };
1029
+ /** @enum {string} */
1030
+ 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" | "authentication_request_not_found" | "invalid_magic_link" | "user_disabled" | "invalid_verify_link" | "missing_authorization_header" | "invalid_authorization_header" | "token_generation" | "user_not_found" | "authentication_request_expired" | "authentication_request_already_used" | "verification_session_expired" | "email_already_taken" | "invalid_invite" | "wrong_invite_user" | "invite_not_found" | "email_already_verified" | "flow_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_revoked" | "invite_expired" | "form_not_found" | "form_in_use" | "flow_step_configuration_not_found" | "organization_product_not_active" | "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";
1031
+ /** @enum {string} */
1032
+ FilterOperator: "unfiltered" | "in" | "equals" | "not-in" | "not-equals" | "contains";
1033
+ Flow: {
1034
+ /** Format: date-time */
1035
+ createdAt?: string | null;
1036
+ extendedWebhook: boolean;
1037
+ id: string;
1038
+ name: string;
1039
+ slug: string;
1040
+ steps: components["schemas"]["FlowStep"][];
1041
+ successUrl: string;
1042
+ /** Format: date-time */
1043
+ updatedAt?: string | null;
1044
+ webhookUrl: string;
1045
+ };
1046
+ FlowResult: {
1047
+ amlResults: components["schemas"]["AmlResult"][];
1048
+ /** Format: date-time */
1049
+ createdAt?: string | null;
1050
+ customData: {
1051
+ [key: string]: unknown;
1052
+ };
1053
+ dvResults: components["schemas"]["DvResult"][];
1054
+ flow?: components["schemas"]["Flow"] | null;
1055
+ flowSlug: string;
1056
+ formResults: components["schemas"]["FormResult"][];
1057
+ id: string;
1058
+ identity?: components["schemas"]["Identity"] | null;
1059
+ kybResults: components["schemas"]["KybResult"][];
1060
+ organization?: components["schemas"]["Organization"] | null;
1061
+ organizationId: string;
1062
+ poaResults: components["schemas"]["PoaResult"][];
1063
+ spidResults: components["schemas"]["SpidResult"][];
1064
+ /** Format: date-time */
1065
+ updatedAt?: string | null;
1066
+ };
1067
+ FlowStep: {
1068
+ config: components["schemas"]["DvConfig"];
1069
+ /** Format: date-time */
1070
+ createdAt?: string | null;
1071
+ flowId: string;
1072
+ gotoStepId?: string | null;
1073
+ id: string;
1074
+ name: string;
1075
+ /** Format: int32 */
1076
+ order: number;
1077
+ slug: string;
1078
+ successUrl?: string | null;
1079
+ /** @enum {string} */
1080
+ type: "DV";
1081
+ /** Format: date-time */
1082
+ updatedAt?: string | null;
1083
+ } | {
1084
+ config: components["schemas"]["FormConfig"];
1085
+ /** Format: date-time */
1086
+ createdAt?: string | null;
1087
+ flowId: string;
1088
+ gotoStepId?: string | null;
1089
+ id: string;
1090
+ name: string;
1091
+ /** Format: int32 */
1092
+ order: number;
1093
+ slug: string;
1094
+ successUrl?: string | null;
1095
+ /** @enum {string} */
1096
+ type: "FORM";
1097
+ /** Format: date-time */
1098
+ updatedAt?: string | null;
1099
+ } | {
1100
+ config: components["schemas"]["PoaConfig"];
1101
+ /** Format: date-time */
1102
+ createdAt?: string | null;
1103
+ flowId: string;
1104
+ gotoStepId?: string | null;
1105
+ id: string;
1106
+ name: string;
1107
+ /** Format: int32 */
1108
+ order: number;
1109
+ slug: string;
1110
+ successUrl?: string | null;
1111
+ /** @enum {string} */
1112
+ type: "POA";
1113
+ /** Format: date-time */
1114
+ updatedAt?: string | null;
1115
+ } | {
1116
+ config: components["schemas"]["KybConfig"];
1117
+ /** Format: date-time */
1118
+ createdAt?: string | null;
1119
+ flowId: string;
1120
+ gotoStepId?: string | null;
1121
+ id: string;
1122
+ name: string;
1123
+ /** Format: int32 */
1124
+ order: number;
1125
+ slug: string;
1126
+ successUrl?: string | null;
1127
+ /** @enum {string} */
1128
+ type: "KYB";
1129
+ /** Format: date-time */
1130
+ updatedAt?: string | null;
1131
+ } | {
1132
+ config: components["schemas"]["SpidConfig"];
1133
+ /** Format: date-time */
1134
+ createdAt?: string | null;
1135
+ flowId: string;
1136
+ gotoStepId?: string | null;
1137
+ id: string;
1138
+ name: string;
1139
+ /** Format: int32 */
1140
+ order: number;
1141
+ slug: string;
1142
+ successUrl?: string | null;
1143
+ /** @enum {string} */
1144
+ type: "SPID";
1145
+ /** Format: date-time */
1146
+ updatedAt?: string | null;
1147
+ };
1148
+ FlowStepConfig: components["schemas"]["DvConfig"] | components["schemas"]["FormConfig"] | components["schemas"]["PoaConfig"] | components["schemas"]["KybConfig"] | components["schemas"]["SpidConfig"];
1149
+ Form: {
1150
+ /** Format: date-time */
1151
+ createdAt?: string | null;
1152
+ description?: string | null;
1153
+ id: string;
1154
+ name: string;
1155
+ organizationId: string;
1156
+ sections: components["schemas"]["FormSection"][];
1157
+ /** Format: date-time */
1158
+ updatedAt?: string | null;
1159
+ };
1160
+ FormAnswerSection: {
1161
+ answers: {
1162
+ [key: string]: unknown;
1163
+ };
1164
+ name: string;
1165
+ };
1166
+ FormConfig: {
1167
+ form?: components["schemas"]["Form"] | null;
1168
+ formId: string;
1169
+ /** @example { "default": "Next step" } */
1170
+ labels?: {
1171
+ [key: string]: string;
1172
+ };
1173
+ };
1174
+ FormItem: {
1175
+ content: components["schemas"]["InputField"];
1176
+ /** @enum {string} */
1177
+ type: "InputField";
1178
+ } | {
1179
+ content: components["schemas"]["Plaintext"];
1180
+ /** @enum {string} */
1181
+ type: "Plaintext";
1182
+ } | {
1183
+ /** @enum {string} */
1184
+ type: "Separator";
1185
+ };
1186
+ /** @enum {string} */
1187
+ FormReason: "UNKNOWN";
1188
+ FormResult: {
1189
+ /** Format: date-time */
1190
+ createdAt?: string | null;
1191
+ flowResultId: string;
1192
+ flowStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
1193
+ flowStepId?: string | null;
1194
+ form?: components["schemas"]["Form"] | null;
1195
+ id: string;
1196
+ reason?: components["schemas"]["FormReason"] | null;
1197
+ sections: components["schemas"]["FormSection"][];
1198
+ status: components["schemas"]["ResultStatus"];
1199
+ /** Format: date-time */
1200
+ updatedAt?: string | null;
1201
+ verificationRequestId?: string | null;
1202
+ };
1203
+ FormSection: {
1204
+ items: components["schemas"]["FormItem"][];
1205
+ label: {
1206
+ [key: string]: string;
1207
+ };
1208
+ name: string;
1209
+ };
1210
+ GetApiKeyResponse: {
1211
+ apiKey: components["schemas"]["ZypheApiKey"];
1212
+ };
1213
+ GetFlowResponse: {
1214
+ flow: components["schemas"]["Flow"];
1215
+ };
1216
+ GetFormResponse: {
1217
+ form: components["schemas"]["Form"];
1218
+ };
1219
+ GetFullFlowResponse: {
1220
+ flow: components["schemas"]["Flow"];
1221
+ organizationName: string;
1222
+ settings: components["schemas"]["Settings"];
1223
+ };
1224
+ GetVerificationRequestResponse: {
1225
+ identity: components["schemas"]["Identity"];
1226
+ verificationRequest: components["schemas"]["VerificationRequest"];
1227
+ };
1228
+ Identity: {
1229
+ /** Format: date-time */
1230
+ createdAt?: string | null;
1231
+ defaultOrganizationId?: string | null;
1232
+ email: string;
1233
+ emailVerified: boolean;
1234
+ id: string;
1235
+ isActive: boolean;
1236
+ role: components["schemas"]["Role"];
1237
+ /** Format: date-time */
1238
+ updatedAt?: string | null;
1239
+ zid: string;
1240
+ };
1241
+ Image: {
1242
+ /** Format: int32 */
1243
+ containerType: number;
1244
+ /** Format: int64 */
1245
+ lightIndex: number;
1246
+ /** Format: int64 */
1247
+ pageIndex: number;
1248
+ source: string;
1249
+ value: string;
1250
+ };
1251
+ InputField: {
1252
+ label: {
1253
+ [key: string]: string;
1254
+ };
1255
+ name: string;
1256
+ options: {
1257
+ [key: string]: string;
1258
+ };
1259
+ required: boolean;
1260
+ type: components["schemas"]["InputFieldType"];
1261
+ value?: unknown;
1262
+ };
1263
+ /** @enum {string} */
1264
+ InputFieldType: "date" | "text" | "textarea" | "checkbox";
1265
+ KybConfig: {
1266
+ kycFlowId: string;
1267
+ /** @example { "default": "Next step" } */
1268
+ labels?: {
1269
+ [key: string]: string;
1270
+ };
1271
+ /**
1272
+ * Format: int32
1273
+ * @default 10
1274
+ * @example 5
1275
+ */
1276
+ maxFileUploads: number;
1277
+ /**
1278
+ * Format: int32
1279
+ * @default 10
1280
+ * @example 3
1281
+ */
1282
+ maxUbos: number;
1283
+ };
1284
+ KybResult: {
1285
+ businessInformation?: components["schemas"]["BusinessInformation"] | null;
1286
+ /** Format: date-time */
1287
+ createdAt?: string | null;
1288
+ documentUploads?: components["schemas"]["DocumentUpload"][] | null;
1289
+ flowStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
1290
+ id: string;
1291
+ pepAndSanctionsStatus: components["schemas"]["PepAndSanctionsStatus"];
1292
+ reason?: string | null;
1293
+ report?: string | null;
1294
+ status: components["schemas"]["ModerationResultStatus"];
1295
+ uboDefinitions?: components["schemas"]["UboDefinition"][] | null;
1296
+ /** Format: date-time */
1297
+ updatedAt?: string | null;
1298
+ verificationRequestId?: string | null;
1299
+ };
1300
+ /** @enum {string} */
1301
+ Locale: "en";
1302
+ ModerateKybResultPayload: {
1303
+ pepAndSanctionsStatus?: components["schemas"]["PepAndSanctionsStatusField"] | null;
1304
+ /** Format: binary */
1305
+ reportFile?: Blob | null;
1306
+ status?: components["schemas"]["ModerationResultStatusField"] | null;
1307
+ };
1308
+ ModerateKybResultResponse: {
1309
+ success: boolean;
1310
+ };
1311
+ /** @enum {string} */
1312
+ ModerationResultStatus: "ACQUIRING" | "PENDING_MODERATION" | "SUCCESS" | "FAILED";
1313
+ ModerationResultStatusField: components["schemas"]["ModerationResultStatus"];
1314
+ Organization: {
1315
+ address: string;
1316
+ country: string;
1317
+ /** Format: date-time */
1318
+ createdAt?: string | null;
1319
+ email: string;
1320
+ id: string;
1321
+ industry?: string | null;
1322
+ name: string;
1323
+ phone: string;
1324
+ postcode?: string | null;
1325
+ registrationNumber: string;
1326
+ settings?: components["schemas"]["Settings"] | null;
1327
+ slug: string;
1328
+ /** Format: date-time */
1329
+ updatedAt?: string | null;
1330
+ website: string;
1331
+ };
1332
+ Pagination: {
1333
+ /** @example createdAt:in:2025-01-01,2025-01-02;updatedAt:gt:2025-01-02 */
1334
+ filter?: string;
1335
+ /**
1336
+ * Format: int32
1337
+ * @example 0
1338
+ */
1339
+ skip?: number;
1340
+ /** @example createdAt:desc */
1341
+ sort?: string;
1342
+ /**
1343
+ * Format: int32
1344
+ * @example 100
1345
+ */
1346
+ take?: number;
1347
+ };
1348
+ /** @enum {string} */
1349
+ PepAndSanctionsStatus: "REVIEW" | "PENDING" | "SUCCESS" | "FAILED" | "IN_PROGRESS";
1350
+ PepAndSanctionsStatusField: components["schemas"]["PepAndSanctionsStatus"];
1351
+ PersonalData: {
1352
+ dateOfBirth: string;
1353
+ gender: string;
1354
+ givenName: string;
1355
+ nationality: string;
1356
+ personalNumber?: string;
1357
+ placeOfBirth?: string;
1358
+ surname: string;
1359
+ };
1360
+ Plaintext: {
1361
+ text: {
1362
+ [key: string]: string;
1363
+ };
1364
+ };
1365
+ PoaConfig: {
1366
+ documentFilter: components["schemas"]["PoaDocumentType"][];
1367
+ /** @example { "default": "Next step" } */
1368
+ labels?: {
1369
+ [key: string]: string;
1370
+ };
1371
+ /**
1372
+ * Format: int32
1373
+ * @example 90
1374
+ */
1375
+ maxAgeDays?: number;
1376
+ };
1377
+ /** @enum {string} */
1378
+ PoaDocumentType: "PAY_SLIP" | "UTILITY_BILL" | "FINANCIAL_DOCUMENT" | "RECEIPT" | "INVOICE" | "BANK_DOCUMENT";
1379
+ /** @enum {string} */
1380
+ PoaReason: "UNKNOWN" | "DOCUMENT_TYPE_NOT_ALLOWED" | "NAME_MISMATCH" | "DATE_TOO_OLD" | "INVALID_DOCUMENT";
1381
+ PoaResult: {
1382
+ /** Format: date-time */
1383
+ checkedAt?: string | null;
1384
+ /** Format: date-time */
1385
+ createdAt: string;
1386
+ documentId?: string | null;
1387
+ documentType?: components["schemas"]["PoaDocumentType"] | null;
1388
+ flowStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
1389
+ id: string;
1390
+ reason?: components["schemas"]["PoaReason"] | null;
1391
+ status: components["schemas"]["ResultStatus"];
1392
+ /** Format: date-time */
1393
+ updatedAt: string;
1394
+ verificationRequestId?: string | null;
1395
+ };
1396
+ ProcessAddressDocumentRequest: {
1397
+ /** Format: binary */
1398
+ file: Blob;
1399
+ };
1400
+ ProcessAddressDocumentResponse: {
1401
+ jobId: string;
1402
+ verificationRequestId: string;
1403
+ websocketNamespace: string;
1404
+ };
1405
+ /** @enum {string} */
1406
+ ProductType: "UNKNOWN" | "KYC" | "KYB" | "PRODUCTION_MODE" | "SPID";
1407
+ /** @enum {string} */
1408
+ ResultStatus: "PASSED" | "FAILED";
1409
+ /** @enum {string} */
1410
+ Role: "GUEST" | "USER" | "ADMIN";
1411
+ SdkCreateVerificationRequestPayload: {
1412
+ customData?: {
1413
+ [key: string]: unknown;
1414
+ } | null;
1415
+ email: string;
1416
+ flowStepId: string;
1417
+ };
1418
+ SdkCreateVerificationRequestResponse: {
1419
+ email: string;
1420
+ flowSlug: string;
1421
+ flowStepSlug: string;
1422
+ isSandbox: boolean;
1423
+ verificationRequest: components["schemas"]["VerificationRequest"];
1424
+ websocketNamespace: string;
1425
+ zypheToken: string;
1426
+ };
1427
+ Settings: {
1428
+ /** Format: date-time */
1429
+ createdAt?: string | null;
1430
+ extendedWebhook?: boolean | null;
1431
+ primaryColor?: string | null;
1432
+ profileImage?: string | null;
1433
+ secondaryColor?: string | null;
1434
+ /** Format: date-time */
1435
+ updatedAt?: string | null;
1436
+ webhookSecret?: string | null;
1437
+ };
1438
+ SpidConfig: {
1439
+ /** @example { "default": "Next step" } */
1440
+ labels?: {
1441
+ [key: string]: string;
1442
+ };
1443
+ };
1444
+ SpidResult: {
1445
+ /** Format: date-time */
1446
+ createdAt?: string | null;
1447
+ flowStep?: Omit<components["schemas"]["FlowStep"], "type"> | null;
1448
+ id: string;
1449
+ path: string;
1450
+ reason?: string | null;
1451
+ status: components["schemas"]["ResultStatus"];
1452
+ /** Format: date-time */
1453
+ updatedAt?: string | null;
1454
+ verificationRequestId?: string | null;
1455
+ };
1456
+ SpidResultDetails: {
1457
+ address?: string | null;
1458
+ companyName?: string | null;
1459
+ companyVatNumber?: string | null;
1460
+ countryOfBirth?: string | null;
1461
+ dateOfBirth?: string | null;
1462
+ digitalAddress?: string | null;
1463
+ email?: string | null;
1464
+ firstName?: string | null;
1465
+ fiscalNumber?: string | null;
1466
+ fullName?: string | null;
1467
+ gender?: string | null;
1468
+ id?: string | null;
1469
+ lastName?: string | null;
1470
+ mobilePhone?: string | null;
1471
+ placeOfBirth?: string | null;
1472
+ registeredOffice?: string | null;
1473
+ spidCode?: string | null;
1474
+ username?: string | null;
1475
+ };
1476
+ UboDefinition: {
1477
+ country: string;
1478
+ dateOfBirth: string;
1479
+ emailAddress: string;
1480
+ firstName: string;
1481
+ gender: string;
1482
+ lastName: string;
1483
+ };
1484
+ /** @enum {string} */
1485
+ 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";
1486
+ VerificationRequest: {
1487
+ amlResult?: components["schemas"]["AmlResult"] | null;
1488
+ /** Format: int32 */
1489
+ attemptsCount: number;
1490
+ /** Format: date-time */
1491
+ createdAt?: string | null;
1492
+ customData: {
1493
+ [key: string]: unknown;
1494
+ };
1495
+ dvResult?: components["schemas"]["DvResult"] | null;
1496
+ flowId: string;
1497
+ flowStepId: string;
1498
+ formResult?: components["schemas"]["FormResult"] | null;
1499
+ id: string;
1500
+ identity?: components["schemas"]["Identity"] | null;
1501
+ identityId: string;
1502
+ kybResult?: components["schemas"]["KybResult"] | null;
1503
+ organizationId: string;
1504
+ poaResult?: components["schemas"]["PoaResult"] | null;
1505
+ reason?: string | null;
1506
+ spidResult?: components["schemas"]["SpidResult"] | null;
1507
+ status: components["schemas"]["VerificationRequestStatus"];
1508
+ /** Format: date-time */
1509
+ updatedAt?: string | null;
1510
+ };
1511
+ /** @enum {string} */
1512
+ VerificationRequestStatus: "PENDING" | "COMPLETED" | "FAILED" | "CANCELLED" | "QUEUED" | "PROCESSING";
1513
+ ZypheApiKey: {
1514
+ allowedOrigins: string[];
1515
+ /** Format: date-time */
1516
+ createdAt?: string | null;
1517
+ description?: string | null;
1518
+ id: string;
1519
+ key: string;
1520
+ keyType: string;
1521
+ name?: string | null;
1522
+ options: {
1523
+ [key: string]: unknown;
1524
+ };
1525
+ organization?: components["schemas"]["Organization"] | null;
1526
+ organizationId: string;
1527
+ /** Format: date-time */
1528
+ updatedAt?: string | null;
1529
+ };
1530
+ };
1531
+ responses: never;
1532
+ parameters: never;
1533
+ requestBodies: never;
1534
+ headers: never;
1535
+ pathItems: never;
1536
+ }
1537
+
1538
+ declare function createVerificationSession(email: string, flowId: string, flowStepId: string, isSandbox: boolean, opts: SDKOptions): Promise<openapi_fetch.FetchResponse<{
1539
+ parameters: {
1540
+ query?: {
1541
+ sandbox?: boolean | null;
1542
+ };
1543
+ header?: never;
1544
+ path: {
1545
+ flow_id: string;
1546
+ };
1547
+ cookie?: never;
1548
+ };
1549
+ requestBody: {
1550
+ content: {
1551
+ "application/json": components["schemas"]["SdkCreateVerificationRequestPayload"];
1552
+ };
1553
+ };
1554
+ responses: {
1555
+ 200: {
1556
+ headers: {
1557
+ [name: string]: unknown;
1558
+ };
1559
+ content: {
1560
+ "application/json": components["schemas"]["SdkCreateVerificationRequestResponse"];
1561
+ };
1562
+ };
1563
+ 400: {
1564
+ headers: {
1565
+ [name: string]: unknown;
1566
+ };
1567
+ content: {
1568
+ "application/json": components["schemas"]["BaxeError"];
1569
+ };
1570
+ };
1571
+ 409: {
1572
+ headers: {
1573
+ [name: string]: unknown;
1574
+ };
1575
+ content: {
1576
+ "application/json": components["schemas"]["BaxeError"];
1577
+ };
1578
+ };
1579
+ 500: {
1580
+ headers: {
1581
+ [name: string]: unknown;
1582
+ };
1583
+ content: {
1584
+ "application/json": components["schemas"]["BaxeError"];
1585
+ };
1586
+ };
1587
+ };
1588
+ }, {
1589
+ body: {
1590
+ email: string;
1591
+ flowStepId: string;
1592
+ };
1593
+ headers: {
1594
+ "x-api-key": string;
1595
+ };
1596
+ params: {
1597
+ path: {
1598
+ flow_id: string;
1599
+ };
1600
+ query: {
1601
+ sandbox: boolean;
1602
+ };
1603
+ };
1604
+ }, `${string}/${string}`>>;
1605
+ declare function constructVerificationSessionUrl({ flowParams, verificationSession, opts, }: {
1606
+ flowParams: InitializeZypheFlowParams;
1607
+ verificationSession: SdkCreateVerificationRequestResponse;
1608
+ opts: SDKOptions;
1609
+ }): string;
18
1610
 
19
1611
  interface SignatureComponents {
20
1612
  timestamp: string;
@@ -55,16 +1647,6 @@ declare const WebhookSignatureErrorMessages: {
55
1647
  readonly 2: "Invalid signature header";
56
1648
  readonly 3: "Signature mismatch";
57
1649
  };
58
-
59
- /**
60
- * Verifies a webhook signature header in either browser or Node.js environment.
61
- * @param secretHex - The hex-encoded secret key.
62
- * @param rawBodyString - The raw request body as a string.
63
- * @param signatureHeader - The header string, e.g. "t=1234567890,v0=abcdef..."
64
- * @returns Promise resolving to true if the signature is valid, false otherwise.
65
- */
66
- declare function verifyWebhookSignature(secretHex: string, rawBodyString: string, signatureHeader: string): Promise<boolean>;
67
-
68
1650
  interface WebhookVerifierOptions<T extends Function> {
69
1651
  /**
70
1652
  * The hex-encoded secret key used to verify the signature
@@ -87,4 +1669,4 @@ interface WebhookVerifierOptions<T extends Function> {
87
1669
  exposeRawBody?: boolean;
88
1670
  }
89
1671
 
90
- export { type SignatureComponents, WebhookSignatureErrorCodes, WebhookSignatureErrorMessages, type WebhookVerifierOptions, bufferToHex, hexToBytes, parseSignatureHeader, timingSafeEqual, verifyWebhookSignature, verifyWebhookSignatureHeader$1 as verifyWebhookSignatureHeaderBrowser, verifyWebhookSignatureHeader as verifyWebhookSignatureHeaderNode };
1672
+ export { API_KEY_HEADER, type Environment, EnvironmentConfigs, Environments, type InitializeZypheFlowParams, type SDKOptions, type SdkCreateVerificationRequestResponse, type SignatureComponents, WebhookSignatureErrorCodes, WebhookSignatureErrorMessages, type WebhookVerifierOptions, bufferToHex, constructVerificationSessionUrl, createVerificationSession, hexToBytes, parseSignatureHeader, timingSafeEqual };