@timbro/invoices 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +20 -0
  2. package/dist/admin.d.ts +1 -1
  3. package/dist/admin.d.ts.map +1 -1
  4. package/dist/generated/hosted/index.d.ts +3 -3
  5. package/dist/generated/hosted/index.d.ts.map +1 -1
  6. package/dist/generated/hosted/index.js +2 -2
  7. package/dist/generated/hosted/sdk.gen.d.ts +19 -1
  8. package/dist/generated/hosted/sdk.gen.d.ts.map +1 -1
  9. package/dist/generated/hosted/sdk.gen.js +225 -1
  10. package/dist/generated/hosted/types.gen.d.ts +544 -4
  11. package/dist/generated/hosted/types.gen.d.ts.map +1 -1
  12. package/dist/generated/hosted/zod-response.gen.d.ts +5734 -223
  13. package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
  14. package/dist/generated/hosted/zod-response.gen.js +628 -201
  15. package/dist/generated/hosted/zod.gen.d.ts +1406 -7
  16. package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
  17. package/dist/generated/hosted/zod.gen.js +724 -237
  18. package/dist/generated/index.d.ts +2 -2
  19. package/dist/generated/index.d.ts.map +1 -1
  20. package/dist/generated/index.js +1 -1
  21. package/dist/generated/types.gen.d.ts +11 -2
  22. package/dist/generated/types.gen.d.ts.map +1 -1
  23. package/dist/generated/zod-response.gen.d.ts +18 -0
  24. package/dist/generated/zod-response.gen.d.ts.map +1 -1
  25. package/dist/generated/zod-response.gen.js +11 -1
  26. package/dist/generated/zod.gen.d.ts +23 -0
  27. package/dist/generated/zod.gen.d.ts.map +1 -1
  28. package/dist/generated/zod.gen.js +16 -2
  29. package/dist/hosted-tenant.d.ts +9 -0
  30. package/dist/hosted-tenant.d.ts.map +1 -1
  31. package/dist/hosted-tenant.js +7 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/invoice-hosted-controls.d.ts +22 -3
  35. package/dist/invoice-hosted-controls.d.ts.map +1 -1
  36. package/dist/invoice-hosted-controls.js +48 -12
  37. package/package.json +2 -2
@@ -268,6 +268,20 @@ export const zMerchantBusinessLiveFiscalSetup = lenientUnion([
268
268
  */
269
269
  export const zProblem = z.object({
270
270
  code: z.enum([
271
+ "authorization_not_found",
272
+ "authorization_checkout_reference_invalid",
273
+ "authorization_reference_conflict",
274
+ "authorization_capture_conflict",
275
+ "authorization_capture_exceeds_hold",
276
+ "authorization_not_capturable",
277
+ "authorization_not_cancelable",
278
+ "authorization_not_editable",
279
+ "authorization_submission_invalid",
280
+ "authorization_authentication_pending",
281
+ "authorization_credentials_unavailable",
282
+ "authorization_dispatch_refused",
283
+ "authorization_hold_evidence_missing",
284
+ "provider_qualification_required",
271
285
  "merchant_authentication_unavailable",
272
286
  "platform_test_profile_unavailable",
273
287
  "merchant_fiscal_binding_unavailable",
@@ -308,6 +322,10 @@ export const zProblem = z.object({
308
322
  "merchant_business_not_member",
309
323
  "merchant_business_revision_conflict",
310
324
  "merchant_business_capabilities_required",
325
+ "merchant_business_certification_path_unavailable",
326
+ "merchant_business_certification_requirements_unmet",
327
+ "merchant_business_certification_revision_conflict",
328
+ "merchant_business_certification_evidence_not_found",
311
329
  "merchant_fiscal_setup_incomplete",
312
330
  "merchant_payment_setup_assessment_incomplete",
313
331
  "merchant_certificate_conflict",
@@ -467,6 +485,9 @@ export const zProblem = z.object({
467
485
  "refund_tip_amount_invalid",
468
486
  "refund_tip_allocation_unknown",
469
487
  "refund_amount_invalid",
488
+ "refund_tax_amount_invalid",
489
+ "refund_tax_amount_required",
490
+ "refund_tax_allocation_unknown",
470
491
  "refund_currency_mismatch",
471
492
  "payer_fiscal_profile_invalid",
472
493
  "rate_limit_exceeded",
@@ -622,6 +643,97 @@ export const zProblem = z.object({
622
643
  title: z.string(),
623
644
  type: z.enum(["about:blank"]),
624
645
  });
646
+ /**
647
+ * MerchantBusinessCertificationRequirement
648
+ */
649
+ export const zMerchantBusinessCertificationRequirement = z.object({
650
+ code: lenientUnion([
651
+ z.literal("invoices_not_requested"),
652
+ z.literal("fiscal_details_incomplete"),
653
+ z.literal("certification_binding_required"),
654
+ z.literal("certification_certificate_required"),
655
+ z.literal("provider_eligibility_unverified"),
656
+ z.literal("certification_receiver_urls_pending"),
657
+ z.literal("certification_test_set_processing_unavailable"),
658
+ ]),
659
+ owner: lenientUnion([
660
+ z.literal("merchant"),
661
+ z.literal("dgii"),
662
+ z.literal("timbro"),
663
+ z.literal("operator"),
664
+ ]),
665
+ blocks: z
666
+ .array(lenientUnion([
667
+ z.literal("start"),
668
+ z.literal("step_1"),
669
+ z.literal("step_2"),
670
+ z.literal("step_7"),
671
+ ]))
672
+ .max(4),
673
+ field: z.string().optional(),
674
+ });
675
+ /**
676
+ * MerchantBusinessCertificationEvidence
677
+ *
678
+ * A business-reported DGII outcome. It remains unverified until an authorized evidence review confirms it.
679
+ */
680
+ export const zMerchantBusinessCertificationEvidence = z.object({
681
+ id: z.string().refine((text) => Array.from(text).length >= 1),
682
+ outcome: lenientUnion([
683
+ z.literal("submitted"),
684
+ z.literal("approved"),
685
+ z.literal("rejected"),
686
+ z.literal("needs_correction"),
687
+ ]),
688
+ verification: lenientUnion([
689
+ z.literal("user_reported"),
690
+ z.literal("operator_verified"),
691
+ z.literal("operator_rejected"),
692
+ ]),
693
+ reference: z
694
+ .string()
695
+ .refine((text) => Array.from(text).length <= 255)
696
+ .nullable(),
697
+ createdAt: z.iso.datetime(),
698
+ reviewedAt: z.iso.datetime().optional(),
699
+ reviewReference: z
700
+ .string()
701
+ .refine((text) => Array.from(text).length <= 512)
702
+ .optional(),
703
+ });
704
+ /**
705
+ * MerchantBusinessCertificationStep
706
+ */
707
+ export const zMerchantBusinessCertificationStep = z.object({
708
+ number: lenientUnion([
709
+ z.literal(1),
710
+ z.literal(2),
711
+ z.literal(3),
712
+ z.literal(4),
713
+ z.literal(5),
714
+ z.literal(6),
715
+ z.literal(7),
716
+ z.literal(8),
717
+ z.literal(9),
718
+ z.literal(10),
719
+ z.literal(11),
720
+ z.literal(12),
721
+ z.literal(13),
722
+ z.literal(14),
723
+ z.literal(15),
724
+ ]),
725
+ code: z.string().refine((text) => Array.from(text).length >= 1),
726
+ title: z.string().refine((text) => Array.from(text).length >= 1),
727
+ actor: lenientUnion([z.literal("merchant"), z.literal("dgii"), z.literal("timbro")]),
728
+ status: lenientUnion([
729
+ z.literal("blocked"),
730
+ z.literal("action_required"),
731
+ z.literal("awaiting_dgii"),
732
+ z.literal("reported"),
733
+ z.literal("verified"),
734
+ ]),
735
+ evidence: z.array(zMerchantBusinessCertificationEvidence),
736
+ });
625
737
  /**
626
738
  * MerchantBusiness
627
739
  *
@@ -1116,6 +1228,259 @@ export const zUpdateBusinessResponse = z.object({
1116
1228
  })),
1117
1229
  onboardingUrl: z.url(),
1118
1230
  });
1231
+ /**
1232
+ * MerchantBusinessCertification
1233
+ *
1234
+ * Durable certification preparation and user-reported DGII progress for the authenticated business.
1235
+ */
1236
+ export const zRetrieveMerchantBusinessCertificationResponse = lenientUnion([
1237
+ z.object({
1238
+ object: z.literal("merchant_business_certification"),
1239
+ status: z.literal("not_started"),
1240
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1241
+ availablePaths: z
1242
+ .array(lenientUnion([z.literal("own_software"), z.literal("external_software")]))
1243
+ .min(1),
1244
+ recommendedPath: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1245
+ actions: z.array(z.literal("start")).max(1),
1246
+ }),
1247
+ z.object({
1248
+ object: z.literal("merchant_business_certification"),
1249
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1250
+ revision: z.int().gte(1),
1251
+ status: z.literal("in_progress"),
1252
+ path: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1253
+ software: z.object({
1254
+ name: z
1255
+ .string()
1256
+ .refine((text) => Array.from(text).length >= 1)
1257
+ .refine((text) => Array.from(text).length <= 128),
1258
+ version: z
1259
+ .string()
1260
+ .refine((text) => Array.from(text).length >= 1)
1261
+ .refine((text) => Array.from(text).length <= 64),
1262
+ }),
1263
+ phase: lenientUnion([
1264
+ z.literal("preparation"),
1265
+ z.literal("application"),
1266
+ z.literal("tests"),
1267
+ z.literal("authorization"),
1268
+ ]),
1269
+ serviceUrls: z
1270
+ .object({
1271
+ reception: z.url(),
1272
+ commercialApproval: z.url(),
1273
+ })
1274
+ .nullable(),
1275
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1276
+ actions: z.array(lenientUnion([z.literal("report_evidence"), z.literal("import_certificate")])),
1277
+ steps: z.tuple([
1278
+ zMerchantBusinessCertificationStep,
1279
+ zMerchantBusinessCertificationStep,
1280
+ zMerchantBusinessCertificationStep,
1281
+ zMerchantBusinessCertificationStep,
1282
+ zMerchantBusinessCertificationStep,
1283
+ zMerchantBusinessCertificationStep,
1284
+ zMerchantBusinessCertificationStep,
1285
+ zMerchantBusinessCertificationStep,
1286
+ zMerchantBusinessCertificationStep,
1287
+ zMerchantBusinessCertificationStep,
1288
+ zMerchantBusinessCertificationStep,
1289
+ zMerchantBusinessCertificationStep,
1290
+ zMerchantBusinessCertificationStep,
1291
+ zMerchantBusinessCertificationStep,
1292
+ zMerchantBusinessCertificationStep,
1293
+ ]),
1294
+ }),
1295
+ ]);
1296
+ /**
1297
+ * MerchantBusinessCertificationStartRequest
1298
+ */
1299
+ export const zStartMerchantBusinessCertificationResponse = lenientUnion([
1300
+ lenientUnion([
1301
+ z.object({
1302
+ object: z.literal("merchant_business_certification"),
1303
+ status: z.literal("not_started"),
1304
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1305
+ availablePaths: z
1306
+ .array(lenientUnion([z.literal("own_software"), z.literal("external_software")]))
1307
+ .min(1),
1308
+ recommendedPath: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1309
+ actions: z.array(z.literal("start")).max(1),
1310
+ }),
1311
+ z.object({
1312
+ object: z.literal("merchant_business_certification"),
1313
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1314
+ revision: z.int().gte(1),
1315
+ status: z.literal("in_progress"),
1316
+ path: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1317
+ software: z.object({
1318
+ name: z
1319
+ .string()
1320
+ .refine((text) => Array.from(text).length >= 1)
1321
+ .refine((text) => Array.from(text).length <= 128),
1322
+ version: z
1323
+ .string()
1324
+ .refine((text) => Array.from(text).length >= 1)
1325
+ .refine((text) => Array.from(text).length <= 64),
1326
+ }),
1327
+ phase: lenientUnion([
1328
+ z.literal("preparation"),
1329
+ z.literal("application"),
1330
+ z.literal("tests"),
1331
+ z.literal("authorization"),
1332
+ ]),
1333
+ serviceUrls: z
1334
+ .object({
1335
+ reception: z.url(),
1336
+ commercialApproval: z.url(),
1337
+ })
1338
+ .nullable(),
1339
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1340
+ actions: z.array(lenientUnion([z.literal("report_evidence"), z.literal("import_certificate")])),
1341
+ steps: z.tuple([
1342
+ zMerchantBusinessCertificationStep,
1343
+ zMerchantBusinessCertificationStep,
1344
+ zMerchantBusinessCertificationStep,
1345
+ zMerchantBusinessCertificationStep,
1346
+ zMerchantBusinessCertificationStep,
1347
+ zMerchantBusinessCertificationStep,
1348
+ zMerchantBusinessCertificationStep,
1349
+ zMerchantBusinessCertificationStep,
1350
+ zMerchantBusinessCertificationStep,
1351
+ zMerchantBusinessCertificationStep,
1352
+ zMerchantBusinessCertificationStep,
1353
+ zMerchantBusinessCertificationStep,
1354
+ zMerchantBusinessCertificationStep,
1355
+ zMerchantBusinessCertificationStep,
1356
+ zMerchantBusinessCertificationStep,
1357
+ ]),
1358
+ }),
1359
+ ]),
1360
+ lenientUnion([
1361
+ z.object({
1362
+ object: z.literal("merchant_business_certification"),
1363
+ status: z.literal("not_started"),
1364
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1365
+ availablePaths: z
1366
+ .array(lenientUnion([z.literal("own_software"), z.literal("external_software")]))
1367
+ .min(1),
1368
+ recommendedPath: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1369
+ actions: z.array(z.literal("start")).max(1),
1370
+ }),
1371
+ z.object({
1372
+ object: z.literal("merchant_business_certification"),
1373
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1374
+ revision: z.int().gte(1),
1375
+ status: z.literal("in_progress"),
1376
+ path: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1377
+ software: z.object({
1378
+ name: z
1379
+ .string()
1380
+ .refine((text) => Array.from(text).length >= 1)
1381
+ .refine((text) => Array.from(text).length <= 128),
1382
+ version: z
1383
+ .string()
1384
+ .refine((text) => Array.from(text).length >= 1)
1385
+ .refine((text) => Array.from(text).length <= 64),
1386
+ }),
1387
+ phase: lenientUnion([
1388
+ z.literal("preparation"),
1389
+ z.literal("application"),
1390
+ z.literal("tests"),
1391
+ z.literal("authorization"),
1392
+ ]),
1393
+ serviceUrls: z
1394
+ .object({
1395
+ reception: z.url(),
1396
+ commercialApproval: z.url(),
1397
+ })
1398
+ .nullable(),
1399
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1400
+ actions: z.array(lenientUnion([z.literal("report_evidence"), z.literal("import_certificate")])),
1401
+ steps: z.tuple([
1402
+ zMerchantBusinessCertificationStep,
1403
+ zMerchantBusinessCertificationStep,
1404
+ zMerchantBusinessCertificationStep,
1405
+ zMerchantBusinessCertificationStep,
1406
+ zMerchantBusinessCertificationStep,
1407
+ zMerchantBusinessCertificationStep,
1408
+ zMerchantBusinessCertificationStep,
1409
+ zMerchantBusinessCertificationStep,
1410
+ zMerchantBusinessCertificationStep,
1411
+ zMerchantBusinessCertificationStep,
1412
+ zMerchantBusinessCertificationStep,
1413
+ zMerchantBusinessCertificationStep,
1414
+ zMerchantBusinessCertificationStep,
1415
+ zMerchantBusinessCertificationStep,
1416
+ zMerchantBusinessCertificationStep,
1417
+ ]),
1418
+ }),
1419
+ ]),
1420
+ ]);
1421
+ /**
1422
+ * MerchantBusinessCertificationEvidenceRequest
1423
+ */
1424
+ export const zSubmitMerchantBusinessCertificationEvidenceResponse = lenientUnion([
1425
+ z.object({
1426
+ object: z.literal("merchant_business_certification"),
1427
+ status: z.literal("not_started"),
1428
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1429
+ availablePaths: z
1430
+ .array(lenientUnion([z.literal("own_software"), z.literal("external_software")]))
1431
+ .min(1),
1432
+ recommendedPath: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1433
+ actions: z.array(z.literal("start")).max(1),
1434
+ }),
1435
+ z.object({
1436
+ object: z.literal("merchant_business_certification"),
1437
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1438
+ revision: z.int().gte(1),
1439
+ status: z.literal("in_progress"),
1440
+ path: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1441
+ software: z.object({
1442
+ name: z
1443
+ .string()
1444
+ .refine((text) => Array.from(text).length >= 1)
1445
+ .refine((text) => Array.from(text).length <= 128),
1446
+ version: z
1447
+ .string()
1448
+ .refine((text) => Array.from(text).length >= 1)
1449
+ .refine((text) => Array.from(text).length <= 64),
1450
+ }),
1451
+ phase: lenientUnion([
1452
+ z.literal("preparation"),
1453
+ z.literal("application"),
1454
+ z.literal("tests"),
1455
+ z.literal("authorization"),
1456
+ ]),
1457
+ serviceUrls: z
1458
+ .object({
1459
+ reception: z.url(),
1460
+ commercialApproval: z.url(),
1461
+ })
1462
+ .nullable(),
1463
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1464
+ actions: z.array(lenientUnion([z.literal("report_evidence"), z.literal("import_certificate")])),
1465
+ steps: z.tuple([
1466
+ zMerchantBusinessCertificationStep,
1467
+ zMerchantBusinessCertificationStep,
1468
+ zMerchantBusinessCertificationStep,
1469
+ zMerchantBusinessCertificationStep,
1470
+ zMerchantBusinessCertificationStep,
1471
+ zMerchantBusinessCertificationStep,
1472
+ zMerchantBusinessCertificationStep,
1473
+ zMerchantBusinessCertificationStep,
1474
+ zMerchantBusinessCertificationStep,
1475
+ zMerchantBusinessCertificationStep,
1476
+ zMerchantBusinessCertificationStep,
1477
+ zMerchantBusinessCertificationStep,
1478
+ zMerchantBusinessCertificationStep,
1479
+ zMerchantBusinessCertificationStep,
1480
+ zMerchantBusinessCertificationStep,
1481
+ ]),
1482
+ }),
1483
+ ]);
1119
1484
  /**
1120
1485
  * MerchantBusinessConfigureInvoicingRequest
1121
1486
  */
@@ -1126,92 +1491,66 @@ export const zConfigureInvoicingResponse = z.object({
1126
1491
  /**
1127
1492
  * MerchantBusinessSigningCertificateRequest
1128
1493
  */
1129
- export const zImportSigningCertificateResponse = z.object({
1130
- object: z.literal("merchant_business"),
1131
- id: z.string().regex(/^mbiz_[0-9a-hjkmnp-tv-z]{24,}$/),
1132
- rnc: z.string().regex(/^[0-9]{9}$/),
1133
- legalName: z.string().refine((text) => Array.from(text).length >= 1),
1134
- revision: z.int().gte(0),
1135
- capabilities: z.object({
1136
- payments: z.object({
1137
- requested: z.boolean(),
1138
- test: z.object({
1139
- status: lenientUnion([
1140
- z.literal("active"),
1141
- z.literal("pending"),
1142
- z.literal("inactive"),
1143
- z.literal("unavailable"),
1144
- ]),
1145
- }),
1146
- live: z.object({
1147
- status: lenientUnion([
1148
- z.literal("active"),
1149
- z.literal("pending"),
1150
- z.literal("inactive"),
1151
- z.literal("unavailable"),
1152
- ]),
1153
- }),
1154
- }),
1155
- invoices: z.object({
1156
- requested: z.boolean(),
1157
- test: z.object({
1158
- status: lenientUnion([
1159
- z.literal("active"),
1160
- z.literal("pending"),
1161
- z.literal("inactive"),
1162
- z.literal("unavailable"),
1163
- ]),
1494
+ export const zImportSigningCertificateResponse = lenientUnion([
1495
+ z.object({
1496
+ object: z.literal("merchant_business"),
1497
+ id: z.string().regex(/^mbiz_[0-9a-hjkmnp-tv-z]{24,}$/),
1498
+ rnc: z.string().regex(/^[0-9]{9}$/),
1499
+ legalName: z.string().refine((text) => Array.from(text).length >= 1),
1500
+ revision: z.int().gte(0),
1501
+ capabilities: z.object({
1502
+ payments: z.object({
1503
+ requested: z.boolean(),
1504
+ test: z.object({
1505
+ status: lenientUnion([
1506
+ z.literal("active"),
1507
+ z.literal("pending"),
1508
+ z.literal("inactive"),
1509
+ z.literal("unavailable"),
1510
+ ]),
1511
+ }),
1512
+ live: z.object({
1513
+ status: lenientUnion([
1514
+ z.literal("active"),
1515
+ z.literal("pending"),
1516
+ z.literal("inactive"),
1517
+ z.literal("unavailable"),
1518
+ ]),
1519
+ }),
1164
1520
  }),
1165
- live: z.object({
1166
- status: lenientUnion([
1167
- z.literal("active"),
1168
- z.literal("pending"),
1169
- z.literal("inactive"),
1170
- z.literal("unavailable"),
1171
- ]),
1521
+ invoices: z.object({
1522
+ requested: z.boolean(),
1523
+ test: z.object({
1524
+ status: lenientUnion([
1525
+ z.literal("active"),
1526
+ z.literal("pending"),
1527
+ z.literal("inactive"),
1528
+ z.literal("unavailable"),
1529
+ ]),
1530
+ }),
1531
+ live: z.object({
1532
+ status: lenientUnion([
1533
+ z.literal("active"),
1534
+ z.literal("pending"),
1535
+ z.literal("inactive"),
1536
+ z.literal("unavailable"),
1537
+ ]),
1538
+ }),
1172
1539
  }),
1173
1540
  }),
1174
- }),
1175
- fiscalDetails: z.object({
1176
- commercialName: z.string().nullable(),
1177
- address: z.string().nullable(),
1178
- location: z
1179
- .object({
1180
- placeId: z
1181
- .string()
1182
- .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1183
- catalogReleaseId: z.string().regex(/^dr_[A-Za-z0-9._-]+$/),
1184
- municipalityCode: z
1185
- .string()
1186
- .regex(/^[0-9]{6}$/)
1187
- .nullable(),
1188
- name: z
1189
- .string()
1190
- .refine((text) => Array.from(text).length >= 1)
1191
- .refine((text) => Array.from(text).length <= 160),
1192
- kind: lenientUnion([
1193
- z.literal("country"),
1194
- z.literal("region"),
1195
- z.literal("national_district"),
1196
- z.literal("province"),
1197
- z.literal("municipality"),
1198
- z.literal("municipal_district"),
1199
- z.literal("urban_zone"),
1200
- z.literal("section"),
1201
- z.literal("barrio"),
1202
- z.literal("paraje"),
1203
- z.literal("subbarrio"),
1204
- ]),
1205
- qualityStatus: lenientUnion([
1206
- z.literal("verified"),
1207
- z.literal("provisional"),
1208
- z.literal("conflicted"),
1209
- ]),
1210
- ancestors: z
1211
- .array(z.object({
1541
+ fiscalDetails: z.object({
1542
+ commercialName: z.string().nullable(),
1543
+ address: z.string().nullable(),
1544
+ location: z
1545
+ .object({
1212
1546
  placeId: z
1213
1547
  .string()
1214
1548
  .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1549
+ catalogReleaseId: z.string().regex(/^dr_[A-Za-z0-9._-]+$/),
1550
+ municipalityCode: z
1551
+ .string()
1552
+ .regex(/^[0-9]{6}$/)
1553
+ .nullable(),
1215
1554
  name: z
1216
1555
  .string()
1217
1556
  .refine((text) => Array.from(text).length >= 1)
@@ -1234,140 +1573,228 @@ export const zImportSigningCertificateResponse = z.object({
1234
1573
  z.literal("provisional"),
1235
1574
  z.literal("conflicted"),
1236
1575
  ]),
1237
- }))
1238
- .max(32),
1239
- })
1240
- .nullable(),
1241
- phone: z.string().nullable(),
1242
- email: z.string().nullable(),
1243
- defaultIncomeType: z.string().nullable(),
1244
- }),
1245
- paymentsProfile: z
1246
- .object({
1247
- displayName: z
1248
- .string()
1249
- .refine((text) => Array.from(text).length >= 1)
1250
- .refine((text) => Array.from(text).length <= 80)
1251
- .regex(/\S/),
1252
- statementDescriptor: z
1253
- .string()
1254
- .refine((text) => Array.from(text).length >= 1)
1255
- .refine((text) => Array.from(text).length <= 22)
1256
- .regex(/\S/),
1257
- permanentAddress: z.object({
1258
- line1: z
1259
- .string()
1260
- .refine((text) => Array.from(text).length >= 1)
1261
- .refine((text) => Array.from(text).length <= 160)
1262
- .regex(/\S/),
1263
- line2: z
1264
- .string()
1265
- .refine((text) => Array.from(text).length >= 1)
1266
- .refine((text) => Array.from(text).length <= 160)
1267
- .regex(/\S/)
1268
- .optional(),
1269
- city: z
1576
+ ancestors: z
1577
+ .array(z.object({
1578
+ placeId: z
1579
+ .string()
1580
+ .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1581
+ name: z
1582
+ .string()
1583
+ .refine((text) => Array.from(text).length >= 1)
1584
+ .refine((text) => Array.from(text).length <= 160),
1585
+ kind: lenientUnion([
1586
+ z.literal("country"),
1587
+ z.literal("region"),
1588
+ z.literal("national_district"),
1589
+ z.literal("province"),
1590
+ z.literal("municipality"),
1591
+ z.literal("municipal_district"),
1592
+ z.literal("urban_zone"),
1593
+ z.literal("section"),
1594
+ z.literal("barrio"),
1595
+ z.literal("paraje"),
1596
+ z.literal("subbarrio"),
1597
+ ]),
1598
+ qualityStatus: lenientUnion([
1599
+ z.literal("verified"),
1600
+ z.literal("provisional"),
1601
+ z.literal("conflicted"),
1602
+ ]),
1603
+ }))
1604
+ .max(32),
1605
+ })
1606
+ .nullable(),
1607
+ phone: z.string().nullable(),
1608
+ email: z.string().nullable(),
1609
+ defaultIncomeType: z.string().nullable(),
1610
+ }),
1611
+ paymentsProfile: z
1612
+ .object({
1613
+ displayName: z
1270
1614
  .string()
1271
1615
  .refine((text) => Array.from(text).length >= 1)
1272
1616
  .refine((text) => Array.from(text).length <= 80)
1273
1617
  .regex(/\S/),
1274
- province: z
1275
- .string()
1276
- .refine((text) => Array.from(text).length >= 1)
1277
- .refine((text) => Array.from(text).length <= 80)
1278
- .regex(/\S/)
1279
- .optional(),
1280
- postalCode: z
1618
+ statementDescriptor: z
1281
1619
  .string()
1282
1620
  .refine((text) => Array.from(text).length >= 1)
1283
- .refine((text) => Array.from(text).length <= 20)
1284
- .regex(/\S/)
1285
- .optional(),
1286
- countryCode: z.string().regex(/^[A-Z]{2}$/),
1287
- }),
1288
- supportEmail: z.email().refine((text) => Array.from(text).length <= 254),
1289
- supportPhone: z.string().regex(/^\+[1-9][0-9]{7,14}$/),
1290
- deliveryPolicy: lenientUnion([
1291
- z.object({
1292
- kind: z.literal("not_offered"),
1293
- }),
1294
- z.object({
1295
- kind: z.literal("merchant_managed"),
1296
- summary: z
1621
+ .refine((text) => Array.from(text).length <= 22)
1622
+ .regex(/\S/),
1623
+ permanentAddress: z.object({
1624
+ line1: z
1297
1625
  .string()
1298
1626
  .refine((text) => Array.from(text).length >= 1)
1299
1627
  .refine((text) => Array.from(text).length <= 160)
1300
1628
  .regex(/\S/),
1301
- url: z
1302
- .url()
1303
- .refine((text) => Array.from(text).length <= 2048)
1304
- .regex(/^https?:\/\//)
1629
+ line2: z
1630
+ .string()
1631
+ .refine((text) => Array.from(text).length >= 1)
1632
+ .refine((text) => Array.from(text).length <= 160)
1633
+ .regex(/\S/)
1634
+ .optional(),
1635
+ city: z
1636
+ .string()
1637
+ .refine((text) => Array.from(text).length >= 1)
1638
+ .refine((text) => Array.from(text).length <= 80)
1639
+ .regex(/\S/),
1640
+ province: z
1641
+ .string()
1642
+ .refine((text) => Array.from(text).length >= 1)
1643
+ .refine((text) => Array.from(text).length <= 80)
1644
+ .regex(/\S/)
1305
1645
  .optional(),
1646
+ postalCode: z
1647
+ .string()
1648
+ .refine((text) => Array.from(text).length >= 1)
1649
+ .refine((text) => Array.from(text).length <= 20)
1650
+ .regex(/\S/)
1651
+ .optional(),
1652
+ countryCode: z.string().regex(/^[A-Z]{2}$/),
1306
1653
  }),
1307
- ]),
1308
- })
1309
- .nullable(),
1310
- invoicing: z.object({
1311
- test: zMerchantBusinessFiscalSetup,
1312
- live: zMerchantBusinessLiveFiscalSetup,
1654
+ supportEmail: z.email().refine((text) => Array.from(text).length <= 254),
1655
+ supportPhone: z.string().regex(/^\+[1-9][0-9]{7,14}$/),
1656
+ deliveryPolicy: lenientUnion([
1657
+ z.object({
1658
+ kind: z.literal("not_offered"),
1659
+ }),
1660
+ z.object({
1661
+ kind: z.literal("merchant_managed"),
1662
+ summary: z
1663
+ .string()
1664
+ .refine((text) => Array.from(text).length >= 1)
1665
+ .refine((text) => Array.from(text).length <= 160)
1666
+ .regex(/\S/),
1667
+ url: z
1668
+ .url()
1669
+ .refine((text) => Array.from(text).length <= 2048)
1670
+ .regex(/^https?:\/\//)
1671
+ .optional(),
1672
+ }),
1673
+ ]),
1674
+ })
1675
+ .nullable(),
1676
+ invoicing: z.object({
1677
+ test: zMerchantBusinessFiscalSetup,
1678
+ live: zMerchantBusinessLiveFiscalSetup,
1679
+ }),
1680
+ requirements: z.array(z.object({
1681
+ code: lenientUnion([
1682
+ z.literal("capabilities_required"),
1683
+ z.literal("commercial_name_required"),
1684
+ z.literal("address_required"),
1685
+ z.literal("location_required"),
1686
+ z.literal("phone_required"),
1687
+ z.literal("default_income_type_required"),
1688
+ z.literal("contact_email_verification_required"),
1689
+ z.literal("fiscal_details_rejected"),
1690
+ z.literal("taxpayer_registration_required"),
1691
+ z.literal("signing_certificate_required"),
1692
+ z.literal("signing_certificate_expiring"),
1693
+ z.literal("test_fiscal_document_rejected"),
1694
+ z.literal("test_fiscal_document_pending"),
1695
+ z.literal("test_fiscal_document_send_pending"),
1696
+ z.literal("fiscal_binding_pending"),
1697
+ z.literal("legal_issuer_sync_pending"),
1698
+ z.literal("fiscal_setup_unavailable"),
1699
+ z.literal("fiscal_binding_conflict"),
1700
+ z.literal("fiscal_issuer_rejected"),
1701
+ z.literal("test_fiscal_document_operator_required"),
1702
+ z.literal("payments_profile_required"),
1703
+ z.literal("test_payments_unavailable"),
1704
+ z.literal("merchant_account_required"),
1705
+ z.literal("merchant_account_disabled"),
1706
+ z.literal("active_credential_required"),
1707
+ z.literal("credential_material_invalid"),
1708
+ z.literal("test_live_mode_mismatch"),
1709
+ z.literal("callback_configuration_failed"),
1710
+ z.literal("callback_configuration_required"),
1711
+ z.literal("connectivity_check_failed"),
1712
+ z.literal("connectivity_check_required"),
1713
+ z.literal("provider_qualification_failed"),
1714
+ z.literal("provider_qualification_required"),
1715
+ z.literal("provider_adapter_unavailable"),
1716
+ ]),
1717
+ owner: lenientUnion([
1718
+ z.literal("merchant"),
1719
+ z.literal("dgii"),
1720
+ z.literal("timbro"),
1721
+ z.literal("provider"),
1722
+ z.literal("operator"),
1723
+ ]),
1724
+ blocks: z.array(lenientUnion([z.literal("payments"), z.literal("invoices")])).max(2),
1725
+ mode: lenientUnion([z.literal("test"), z.literal("live")]).optional(),
1726
+ field: z.string().optional(),
1727
+ errors: z
1728
+ .array(z.object({
1729
+ code: z.string(),
1730
+ message: z.string(),
1731
+ }))
1732
+ .min(1)
1733
+ .optional(),
1734
+ })),
1735
+ onboardingUrl: z.url(),
1313
1736
  }),
1314
- requirements: z.array(z.object({
1315
- code: lenientUnion([
1316
- z.literal("capabilities_required"),
1317
- z.literal("commercial_name_required"),
1318
- z.literal("address_required"),
1319
- z.literal("location_required"),
1320
- z.literal("phone_required"),
1321
- z.literal("default_income_type_required"),
1322
- z.literal("contact_email_verification_required"),
1323
- z.literal("fiscal_details_rejected"),
1324
- z.literal("taxpayer_registration_required"),
1325
- z.literal("signing_certificate_required"),
1326
- z.literal("signing_certificate_expiring"),
1327
- z.literal("test_fiscal_document_rejected"),
1328
- z.literal("test_fiscal_document_pending"),
1329
- z.literal("test_fiscal_document_send_pending"),
1330
- z.literal("fiscal_binding_pending"),
1331
- z.literal("legal_issuer_sync_pending"),
1332
- z.literal("fiscal_setup_unavailable"),
1333
- z.literal("fiscal_binding_conflict"),
1334
- z.literal("fiscal_issuer_rejected"),
1335
- z.literal("test_fiscal_document_operator_required"),
1336
- z.literal("payments_profile_required"),
1337
- z.literal("test_payments_unavailable"),
1338
- z.literal("merchant_account_required"),
1339
- z.literal("merchant_account_disabled"),
1340
- z.literal("active_credential_required"),
1341
- z.literal("credential_material_invalid"),
1342
- z.literal("test_live_mode_mismatch"),
1343
- z.literal("callback_configuration_failed"),
1344
- z.literal("callback_configuration_required"),
1345
- z.literal("connectivity_check_failed"),
1346
- z.literal("connectivity_check_required"),
1347
- z.literal("provider_qualification_failed"),
1348
- z.literal("provider_qualification_required"),
1349
- z.literal("provider_adapter_unavailable"),
1350
- ]),
1351
- owner: lenientUnion([
1352
- z.literal("merchant"),
1353
- z.literal("dgii"),
1354
- z.literal("timbro"),
1355
- z.literal("provider"),
1356
- z.literal("operator"),
1357
- ]),
1358
- blocks: z.array(lenientUnion([z.literal("payments"), z.literal("invoices")])).max(2),
1359
- mode: lenientUnion([z.literal("test"), z.literal("live")]).optional(),
1360
- field: z.string().optional(),
1361
- errors: z
1362
- .array(z.object({
1363
- code: z.string(),
1364
- message: z.string(),
1365
- }))
1366
- .min(1)
1367
- .optional(),
1368
- })),
1369
- onboardingUrl: z.url(),
1370
- });
1737
+ lenientUnion([
1738
+ z.object({
1739
+ object: z.literal("merchant_business_certification"),
1740
+ status: z.literal("not_started"),
1741
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1742
+ availablePaths: z
1743
+ .array(lenientUnion([z.literal("own_software"), z.literal("external_software")]))
1744
+ .min(1),
1745
+ recommendedPath: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1746
+ actions: z.array(z.literal("start")).max(1),
1747
+ }),
1748
+ z.object({
1749
+ object: z.literal("merchant_business_certification"),
1750
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1751
+ revision: z.int().gte(1),
1752
+ status: z.literal("in_progress"),
1753
+ path: lenientUnion([z.literal("own_software"), z.literal("external_software")]),
1754
+ software: z.object({
1755
+ name: z
1756
+ .string()
1757
+ .refine((text) => Array.from(text).length >= 1)
1758
+ .refine((text) => Array.from(text).length <= 128),
1759
+ version: z
1760
+ .string()
1761
+ .refine((text) => Array.from(text).length >= 1)
1762
+ .refine((text) => Array.from(text).length <= 64),
1763
+ }),
1764
+ phase: lenientUnion([
1765
+ z.literal("preparation"),
1766
+ z.literal("application"),
1767
+ z.literal("tests"),
1768
+ z.literal("authorization"),
1769
+ ]),
1770
+ serviceUrls: z
1771
+ .object({
1772
+ reception: z.url(),
1773
+ commercialApproval: z.url(),
1774
+ })
1775
+ .nullable(),
1776
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1777
+ actions: z.array(lenientUnion([z.literal("report_evidence"), z.literal("import_certificate")])),
1778
+ steps: z.tuple([
1779
+ zMerchantBusinessCertificationStep,
1780
+ zMerchantBusinessCertificationStep,
1781
+ zMerchantBusinessCertificationStep,
1782
+ zMerchantBusinessCertificationStep,
1783
+ zMerchantBusinessCertificationStep,
1784
+ zMerchantBusinessCertificationStep,
1785
+ zMerchantBusinessCertificationStep,
1786
+ zMerchantBusinessCertificationStep,
1787
+ zMerchantBusinessCertificationStep,
1788
+ zMerchantBusinessCertificationStep,
1789
+ zMerchantBusinessCertificationStep,
1790
+ zMerchantBusinessCertificationStep,
1791
+ zMerchantBusinessCertificationStep,
1792
+ zMerchantBusinessCertificationStep,
1793
+ zMerchantBusinessCertificationStep,
1794
+ ]),
1795
+ }),
1796
+ ]),
1797
+ ]);
1371
1798
  /**
1372
1799
  * MerchantBusinessTestFiscalDocumentRequest
1373
1800
  */