@timbro/invoices 0.10.3 → 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.
- package/README.md +58 -2
- package/dist/admin.d.ts +2 -3
- package/dist/admin.d.ts.map +1 -1
- package/dist/generated/hosted/index.d.ts +3 -3
- package/dist/generated/hosted/index.d.ts.map +1 -1
- package/dist/generated/hosted/index.js +2 -2
- package/dist/generated/hosted/sdk.gen.d.ts +19 -1
- package/dist/generated/hosted/sdk.gen.d.ts.map +1 -1
- package/dist/generated/hosted/sdk.gen.js +225 -1
- package/dist/generated/hosted/types.gen.d.ts +583 -5
- package/dist/generated/hosted/types.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.d.ts +6678 -208
- package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.js +694 -207
- package/dist/generated/hosted/zod.gen.d.ts +1661 -14
- package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod.gen.js +772 -222
- package/dist/generated/index.d.ts +3 -3
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -2
- package/dist/generated/invoice-api-contract.d.ts +186 -2
- package/dist/generated/invoice-api-contract.d.ts.map +1 -1
- package/dist/generated/invoice-api-contract.js +211 -1
- package/dist/generated/sdk.gen.d.ts +5 -5
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.js +93 -93
- package/dist/generated/types.gen.d.ts +288 -139
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/generated/zod-response.gen.d.ts +2304 -2548
- package/dist/generated/zod-response.gen.d.ts.map +1 -1
- package/dist/generated/zod-response.gen.js +179 -109
- package/dist/generated/zod.gen.d.ts +1252 -2188
- package/dist/generated/zod.gen.d.ts.map +1 -1
- package/dist/generated/zod.gen.js +215 -115
- package/dist/hosted-tenant.d.ts +9 -0
- package/dist/hosted-tenant.d.ts.map +1 -1
- package/dist/hosted-tenant.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/invoice-hosted-controls.d.ts +22 -3
- package/dist/invoice-hosted-controls.d.ts.map +1 -1
- package/dist/invoice-hosted-controls.js +48 -12
- package/dist/invoice.d.ts +5 -0
- package/dist/invoice.d.ts.map +1 -1
- package/dist/invoice.js +1 -0
- package/dist/issuance-readiness.d.ts +9 -0
- package/dist/issuance-readiness.d.ts.map +1 -0
- package/dist/issuance-readiness.js +19 -0
- package/dist/timbro-client.d.ts +6 -8
- package/dist/timbro-client.d.ts.map +1 -1
- package/dist/timbro-client.js +3 -5
- package/dist/webhook-event.d.ts +392 -0
- package/dist/webhook-event.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/certificate-custody-readiness.d.ts +0 -6
- package/dist/certificate-custody-readiness.d.ts.map +0 -1
- package/dist/certificate-custody-readiness.js +0 -13
- package/dist/fiscal-numbering-readiness.d.ts +0 -6
- package/dist/fiscal-numbering-readiness.d.ts.map +0 -1
- package/dist/fiscal-numbering-readiness.js +0 -13
|
@@ -25,14 +25,6 @@ function lenientUnion(options) {
|
|
|
25
25
|
return rest.reduce((best, match) => (propertyCount(match) > propertyCount(best) ? match : best), first);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
export const zActiveCertificateCustodyBindingResource = z.object({
|
|
29
|
-
binding_id: z.uuid(),
|
|
30
|
-
certificate_version: z.string().regex(/^[1-9][0-9]*$/),
|
|
31
|
-
expected_certificate_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Buyer identity alternatives admitted by official conditional Type 33 and Type 34 `Comprador`.
|
|
35
|
-
*/
|
|
36
28
|
export const zAffectedFiscalDocumentAttributionResource = lenientUnion([
|
|
37
29
|
z.object({
|
|
38
30
|
fiscal_operation_id: z.uuid(),
|
|
@@ -109,20 +101,6 @@ export const zBuyerDeliveryTerminalResultCode = z.enum([
|
|
|
109
101
|
/**
|
|
110
102
|
* Exporter classification retained as a caller declaration, not authority confirmation.
|
|
111
103
|
*/
|
|
112
|
-
export const zCertificateCustodyCertificateResource = z.object({
|
|
113
|
-
certificate_expires_at: z.iso.datetime(),
|
|
114
|
-
certificate_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
115
|
-
certificate_subject_serial_number: z
|
|
116
|
-
.string()
|
|
117
|
-
.regex(/^(?:[0-9]{9}|[0-9]{11}|IDCDO-(?:[0-9]{9}|[0-9]{11})|PAS[A-Z]{2}-[A-Za-z0-9]{5,20})$/),
|
|
118
|
-
effect_replay_retention_seconds: z
|
|
119
|
-
.int()
|
|
120
|
-
.gte(1)
|
|
121
|
-
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
122
|
-
});
|
|
123
|
-
/**
|
|
124
|
-
* Signature algorithm pinned with a certificate-custody binding.
|
|
125
|
-
*/
|
|
126
104
|
export const zCertificateCustodySignatureAlgorithm = z.enum(["rsa_sha256"]);
|
|
127
105
|
/**
|
|
128
106
|
* The wire family a Collection page announces.
|
|
@@ -246,9 +224,6 @@ export const zEngineProblem = z.object({
|
|
|
246
224
|
path: z.string(),
|
|
247
225
|
});
|
|
248
226
|
export const zEngineProtocol = z.enum(["timbro.fiscal-engine.v3"]);
|
|
249
|
-
export const zEnrolledCertificateCustodyBindingResource = z.object({
|
|
250
|
-
binding_id: z.uuid(),
|
|
251
|
-
});
|
|
252
227
|
/**
|
|
253
228
|
* One e-CF document type implemented by this engine protocol revision.
|
|
254
229
|
*/
|
|
@@ -319,7 +294,8 @@ export const zFiscalAuthorityRoute = z.enum([
|
|
|
319
294
|
"consumer_summary_reception",
|
|
320
295
|
]);
|
|
321
296
|
/**
|
|
322
|
-
*
|
|
297
|
+
* Whether the buyer may receive the e-CF: ready once DGII received it and answered `Aceptado` or
|
|
298
|
+
* `Aceptado Condicional`, projected from the immutable lifecycle event ledger.
|
|
323
299
|
*/
|
|
324
300
|
export const zBuyerDeliveryReadinessResource = lenientUnion([
|
|
325
301
|
z.object({
|
|
@@ -407,29 +383,6 @@ export const zAffectedFiscalDocumentResource = z.object({
|
|
|
407
383
|
issued_on: z.string().regex(/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/),
|
|
408
384
|
issuer_tax_id: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
409
385
|
});
|
|
410
|
-
export const zCertificateCustodyReadiness = lenientUnion([
|
|
411
|
-
z.object({
|
|
412
|
-
environment: zFiscalEnvironment,
|
|
413
|
-
legal_issuer_id: z.uuid(),
|
|
414
|
-
organization_id: z.uuid(),
|
|
415
|
-
status: z.enum(["not_configured"]),
|
|
416
|
-
}),
|
|
417
|
-
z.object({
|
|
418
|
-
binding: zEnrolledCertificateCustodyBindingResource,
|
|
419
|
-
environment: zFiscalEnvironment,
|
|
420
|
-
legal_issuer_id: z.uuid(),
|
|
421
|
-
organization_id: z.uuid(),
|
|
422
|
-
status: z.enum(["awaiting_certificate_registration"]),
|
|
423
|
-
}),
|
|
424
|
-
z.object({
|
|
425
|
-
binding: zActiveCertificateCustodyBindingResource,
|
|
426
|
-
certificate: zCertificateCustodyCertificateResource,
|
|
427
|
-
environment: zFiscalEnvironment,
|
|
428
|
-
legal_issuer_id: z.uuid(),
|
|
429
|
-
organization_id: z.uuid(),
|
|
430
|
-
status: z.enum(["ready"]),
|
|
431
|
-
}),
|
|
432
|
-
]);
|
|
433
386
|
export const zDirectConnectionPreviewResource = z.object({
|
|
434
387
|
company_id: z.string(),
|
|
435
388
|
company_name: z.string(),
|
|
@@ -565,7 +518,6 @@ export const zFiscalLineTotal = z.object({
|
|
|
565
518
|
* One ordinary fiscal line whose profile admits only the legal-tip code.
|
|
566
519
|
*/
|
|
567
520
|
export const zFiscalNumberAuthorizationKnowledge = z.enum(["verified", "reported"]);
|
|
568
|
-
export const zFiscalNumberAuthorizationReadinessStatus = z.enum(["ready", "action_required"]);
|
|
569
521
|
/**
|
|
570
522
|
* Origin of a fiscal-number authorization fact.
|
|
571
523
|
*/
|
|
@@ -585,16 +537,6 @@ export const zFiscalNumberAuthorizationState = z.enum([
|
|
|
585
537
|
"exhausted",
|
|
586
538
|
"conflicting",
|
|
587
539
|
]);
|
|
588
|
-
export const zFiscalNumberAuthorizationUnavailableReason = z.enum([
|
|
589
|
-
"authorization_missing",
|
|
590
|
-
"authorization_not_active",
|
|
591
|
-
"authorization_not_verified",
|
|
592
|
-
"authorization_not_observed",
|
|
593
|
-
"range_exhausted",
|
|
594
|
-
"authorization_expiration_invalid",
|
|
595
|
-
"authorization_expired",
|
|
596
|
-
"authorization_range_overlap",
|
|
597
|
-
]);
|
|
598
540
|
/**
|
|
599
541
|
* Caller instruction that selects how a Fiscal operation obtains its e-NCF.
|
|
600
542
|
*
|
|
@@ -736,17 +678,27 @@ export const zHostedImportResponse = z.object({
|
|
|
736
678
|
object: z.string(),
|
|
737
679
|
signer_subject_serial_number: z.string(),
|
|
738
680
|
});
|
|
739
|
-
export const zHostedInvoiceCredentialEnvironment = z.enum([
|
|
681
|
+
export const zHostedInvoiceCredentialEnvironment = z.enum([
|
|
682
|
+
"sandbox",
|
|
683
|
+
"certification",
|
|
684
|
+
"production",
|
|
685
|
+
]);
|
|
740
686
|
export const zHostedInvoiceCredentialResponse = z.object({
|
|
741
687
|
credential: z.string(),
|
|
742
688
|
environment: zHostedInvoiceCredentialEnvironment,
|
|
743
689
|
object: z.string(),
|
|
744
690
|
source_connection_id: z.uuid(),
|
|
745
691
|
});
|
|
692
|
+
export const zHostedReceiverUrls = z.object({
|
|
693
|
+
base_url: z.string(),
|
|
694
|
+
commercial_approval_url: z.string(),
|
|
695
|
+
reception_url: z.string(),
|
|
696
|
+
});
|
|
746
697
|
export const zHostedTenantResource = z.object({
|
|
747
698
|
hosted_tenant_binding_id: z.uuid(),
|
|
748
699
|
legal_issuer_id: z.uuid(),
|
|
749
700
|
organization_id: z.uuid(),
|
|
701
|
+
receiver_urls: zHostedReceiverUrls,
|
|
750
702
|
source_connection_id: z.uuid(),
|
|
751
703
|
webhook_endpoint_id: z.uuid(),
|
|
752
704
|
webhook_signing_secret: z.string().nullable(),
|
|
@@ -830,7 +782,12 @@ export const zInvoiceCorrection = z.object({
|
|
|
830
782
|
reason: z.string(),
|
|
831
783
|
relationshipKind: zFiscalDocumentRelationshipKind,
|
|
832
784
|
});
|
|
785
|
+
export const zInvoiceDeliveryAttachments = z.object({
|
|
786
|
+
pdf: z.boolean(),
|
|
787
|
+
xml: z.boolean(),
|
|
788
|
+
});
|
|
833
789
|
export const zInvoiceDeliveryResource = z.object({
|
|
790
|
+
attachments: zInvoiceDeliveryAttachments,
|
|
834
791
|
createdAt: z.iso.datetime(),
|
|
835
792
|
id: z.uuid(),
|
|
836
793
|
invoiceId: z.uuid(),
|
|
@@ -1014,6 +971,17 @@ export const zInvoiceReceiptAccess = z.object({
|
|
|
1014
971
|
});
|
|
1015
972
|
export const zInvoiceReceiptCurrency = z.enum(["DOP"]);
|
|
1016
973
|
export const zInvoiceReceiptStatus = z.enum(["accepted", "acceptedWithObservations"]);
|
|
974
|
+
/**
|
|
975
|
+
* The signature facts DGII requires on every printed e-CF, read from the signed document.
|
|
976
|
+
*
|
|
977
|
+
* Print the buyer's copy after DGII accepts the Invoice; DGII sequences the printed e-CF after
|
|
978
|
+
* its validation result, including the Type 32 below DOP 250,000 it validates by RFCE summary.
|
|
979
|
+
*/
|
|
980
|
+
export const zInvoiceSignature = z.object({
|
|
981
|
+
securityCode: z.string().regex(/^[A-Za-z0-9+/]{6}$/),
|
|
982
|
+
signedAt: z.string().regex(/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}-04:00$/),
|
|
983
|
+
verificationUrl: z.url().regex(/^https:\/\/(ecf|fc)\.dgii\.gov\.do\//),
|
|
984
|
+
});
|
|
1017
985
|
export const zInvoiceSource = z.object({
|
|
1018
986
|
contentSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
1019
987
|
id: z.string(),
|
|
@@ -2268,6 +2236,7 @@ export const zInvoiceType = z.enum([
|
|
|
2268
2236
|
]);
|
|
2269
2237
|
export const zInvoiceFiscalIdentity = z.object({
|
|
2270
2238
|
eNcf: z.string().regex(/^E(31|32|33|34|41|43|44|45|46|47)[0-9]{10}$/),
|
|
2239
|
+
signature: zInvoiceSignature.nullable(),
|
|
2271
2240
|
type: zInvoiceType,
|
|
2272
2241
|
});
|
|
2273
2242
|
export const zInvoiceWebhookEvent = lenientUnion([
|
|
@@ -2299,6 +2268,22 @@ export const zInvoiceWebhookEvent = lenientUnion([
|
|
|
2299
2268
|
}),
|
|
2300
2269
|
type: z.enum(["invoice.ready"]),
|
|
2301
2270
|
}),
|
|
2271
|
+
z.object({
|
|
2272
|
+
data: z.object({
|
|
2273
|
+
deliveryId: z.uuid(),
|
|
2274
|
+
id: z.uuid(),
|
|
2275
|
+
sourceConnectionId: z.uuid(),
|
|
2276
|
+
}),
|
|
2277
|
+
type: z.enum(["invoice.deliverySent"]),
|
|
2278
|
+
}),
|
|
2279
|
+
z.object({
|
|
2280
|
+
data: z.object({
|
|
2281
|
+
deliveryId: z.uuid(),
|
|
2282
|
+
id: z.uuid(),
|
|
2283
|
+
sourceConnectionId: z.uuid(),
|
|
2284
|
+
}),
|
|
2285
|
+
type: z.enum(["invoice.deliveryFailed"]),
|
|
2286
|
+
}),
|
|
2302
2287
|
]);
|
|
2303
2288
|
export const zInvoiceXmlReadiness = lenientUnion([
|
|
2304
2289
|
z.object({
|
|
@@ -2346,6 +2331,20 @@ export const zIssuanceBlocker = z.enum([
|
|
|
2346
2331
|
"fiscal_number_before_verified_floor",
|
|
2347
2332
|
"sequence_expiration_mismatch",
|
|
2348
2333
|
]);
|
|
2334
|
+
export const zIssuanceReadinessReason = z.enum([
|
|
2335
|
+
"legal_issuer_profile_incomplete",
|
|
2336
|
+
"signing_certificate_missing",
|
|
2337
|
+
"signing_certificate_expired",
|
|
2338
|
+
"signing_certificate_not_yet_valid",
|
|
2339
|
+
"authorization_missing",
|
|
2340
|
+
"authorization_not_active",
|
|
2341
|
+
"authorization_not_verified",
|
|
2342
|
+
"authorization_not_observed",
|
|
2343
|
+
"range_exhausted",
|
|
2344
|
+
"authorization_expiration_invalid",
|
|
2345
|
+
"authorization_expired",
|
|
2346
|
+
"authorization_range_overlap",
|
|
2347
|
+
]);
|
|
2349
2348
|
export const zLedgerCounter = z.string().regex(/^(0|[1-9][0-9]*)$/);
|
|
2350
2349
|
export const zCertificateCustodyCertificateVersionResource = z.object({
|
|
2351
2350
|
certificate_custody_certificate_version: zLedgerCounter,
|
|
@@ -2428,46 +2427,6 @@ export const zFiscalNumberAuthorizationHistoryResource = z.object({
|
|
|
2428
2427
|
environment: zFiscalEnvironment,
|
|
2429
2428
|
legal_issuer_id: z.uuid(),
|
|
2430
2429
|
});
|
|
2431
|
-
export const zFiscalNumberAuthorizationSelection = z.object({
|
|
2432
|
-
authorization_id: z.uuid(),
|
|
2433
|
-
ends_at: zLedgerCounter,
|
|
2434
|
-
expires_on: z
|
|
2435
|
-
.string()
|
|
2436
|
-
.regex(/^\d{2}-\d{2}-\d{4}$/)
|
|
2437
|
-
.nullable(),
|
|
2438
|
-
next_available_sequence: zLedgerCounter,
|
|
2439
|
-
remaining_capacity: z.number().gte(0),
|
|
2440
|
-
starts_at: zLedgerCounter,
|
|
2441
|
-
state: zFiscalNumberAuthorizationState,
|
|
2442
|
-
verified_next_unused: zFiscalNumberAuthorizationNextUnused,
|
|
2443
|
-
});
|
|
2444
|
-
export const zFiscalNumberAuthorizationTypeReadiness = z.object({
|
|
2445
|
-
document_type: zElectronicFiscalDocumentType,
|
|
2446
|
-
selected: zFiscalNumberAuthorizationSelection.nullable(),
|
|
2447
|
-
status: zFiscalNumberAuthorizationReadinessStatus,
|
|
2448
|
-
unavailable_reason: zFiscalNumberAuthorizationUnavailableReason.nullable(),
|
|
2449
|
-
});
|
|
2450
|
-
export const zFiscalNumberAuthorizationDocumentReadiness = z.object({
|
|
2451
|
-
e31: zFiscalNumberAuthorizationTypeReadiness,
|
|
2452
|
-
e32: zFiscalNumberAuthorizationTypeReadiness,
|
|
2453
|
-
e33: zFiscalNumberAuthorizationTypeReadiness,
|
|
2454
|
-
e34: zFiscalNumberAuthorizationTypeReadiness,
|
|
2455
|
-
e41: zFiscalNumberAuthorizationTypeReadiness,
|
|
2456
|
-
e43: zFiscalNumberAuthorizationTypeReadiness,
|
|
2457
|
-
e44: zFiscalNumberAuthorizationTypeReadiness,
|
|
2458
|
-
e45: zFiscalNumberAuthorizationTypeReadiness,
|
|
2459
|
-
e46: zFiscalNumberAuthorizationTypeReadiness,
|
|
2460
|
-
e47: zFiscalNumberAuthorizationTypeReadiness,
|
|
2461
|
-
});
|
|
2462
|
-
export const zFiscalNumberAuthorizationReadiness = z.object({
|
|
2463
|
-
documents: zFiscalNumberAuthorizationDocumentReadiness,
|
|
2464
|
-
effective_on: z.iso.date(),
|
|
2465
|
-
environment: zFiscalEnvironment,
|
|
2466
|
-
issuer_tax_id: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
2467
|
-
legal_issuer_id: z.uuid(),
|
|
2468
|
-
object: z.string(),
|
|
2469
|
-
source_connection_id: z.uuid(),
|
|
2470
|
-
});
|
|
2471
2430
|
export const zLegalIssuerVerification = z.enum(["verified", "unverified"]);
|
|
2472
2431
|
export const zLegalIssuer = z.object({
|
|
2473
2432
|
address: z
|
|
@@ -2593,6 +2552,23 @@ export const zNotReceivedReason = z.enum([
|
|
|
2593
2552
|
/**
|
|
2594
2553
|
* Numbering values resolved before deterministic fiscal-document construction.
|
|
2595
2554
|
*/
|
|
2555
|
+
export const zNumberingRange = z.object({
|
|
2556
|
+
expiresOn: z.iso.date().nullable(),
|
|
2557
|
+
remaining: z.int().gte(1).lte(9999999999),
|
|
2558
|
+
});
|
|
2559
|
+
export const zDocumentTypeIssuanceReadiness = lenientUnion([
|
|
2560
|
+
z.object({
|
|
2561
|
+
numbering: zNumberingRange,
|
|
2562
|
+
status: z.enum(["ready"]),
|
|
2563
|
+
type: zInvoiceType,
|
|
2564
|
+
}),
|
|
2565
|
+
z.object({
|
|
2566
|
+
numbering: zNumberingRange.nullable(),
|
|
2567
|
+
reasons: z.array(zIssuanceReadinessReason).min(1),
|
|
2568
|
+
status: z.enum(["actionRequired"]),
|
|
2569
|
+
type: zInvoiceType,
|
|
2570
|
+
}),
|
|
2571
|
+
]);
|
|
2596
2572
|
export const zOnboardingLegalIssuerIdentityOutcome = lenientUnion([
|
|
2597
2573
|
z.object({
|
|
2598
2574
|
status: z.enum(["not_started"]),
|
|
@@ -3001,6 +2977,41 @@ export const zSignedDocumentReadinessResource = lenientUnion([
|
|
|
3001
2977
|
status: z.enum(["ready"]),
|
|
3002
2978
|
}),
|
|
3003
2979
|
]);
|
|
2980
|
+
/**
|
|
2981
|
+
* The active signing certificate, judged at the moment of the read.
|
|
2982
|
+
*/
|
|
2983
|
+
export const zSigningCertificateReadiness = lenientUnion([
|
|
2984
|
+
z.object({
|
|
2985
|
+
notAfter: z.iso.datetime(),
|
|
2986
|
+
notBefore: z.iso.datetime(),
|
|
2987
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2988
|
+
status: z.enum(["ready"]),
|
|
2989
|
+
}),
|
|
2990
|
+
z.object({
|
|
2991
|
+
notAfter: z.iso.datetime(),
|
|
2992
|
+
notBefore: z.iso.datetime(),
|
|
2993
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2994
|
+
status: z.enum(["expired"]),
|
|
2995
|
+
}),
|
|
2996
|
+
z.object({
|
|
2997
|
+
notAfter: z.iso.datetime(),
|
|
2998
|
+
notBefore: z.iso.datetime(),
|
|
2999
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3000
|
+
status: z.enum(["notYetValid"]),
|
|
3001
|
+
}),
|
|
3002
|
+
z.object({
|
|
3003
|
+
status: z.enum(["missing"]),
|
|
3004
|
+
}),
|
|
3005
|
+
]);
|
|
3006
|
+
/**
|
|
3007
|
+
* Whether the issuer can issue each e-CF type now in this environment.
|
|
3008
|
+
*/
|
|
3009
|
+
export const zIssuanceReadiness = z.object({
|
|
3010
|
+
certificate: zSigningCertificateReadiness,
|
|
3011
|
+
documentTypes: z.array(zDocumentTypeIssuanceReadiness),
|
|
3012
|
+
environment: zFiscalEnvironment,
|
|
3013
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3014
|
+
});
|
|
3004
3015
|
/**
|
|
3005
3016
|
* Named additional taxes supported by the common Source contract.
|
|
3006
3017
|
*/
|
|
@@ -4484,6 +4495,36 @@ export const zInvoiceWebhookEventEnvelope = lenientUnion([
|
|
|
4484
4495
|
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4485
4496
|
type: z.enum(["invoice.ready"]),
|
|
4486
4497
|
}),
|
|
4498
|
+
z.object({
|
|
4499
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4500
|
+
data: z.object({
|
|
4501
|
+
deliveryId: z.uuid(),
|
|
4502
|
+
id: z.uuid(),
|
|
4503
|
+
sourceConnectionId: z.uuid(),
|
|
4504
|
+
}),
|
|
4505
|
+
environment: zFiscalEnvironment,
|
|
4506
|
+
id: z.uuid(),
|
|
4507
|
+
object: zWebhookEventObject,
|
|
4508
|
+
occurredAt: z.iso.datetime(),
|
|
4509
|
+
organizationId: z.uuid(),
|
|
4510
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4511
|
+
type: z.enum(["invoice.deliverySent"]),
|
|
4512
|
+
}),
|
|
4513
|
+
z.object({
|
|
4514
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4515
|
+
data: z.object({
|
|
4516
|
+
deliveryId: z.uuid(),
|
|
4517
|
+
id: z.uuid(),
|
|
4518
|
+
sourceConnectionId: z.uuid(),
|
|
4519
|
+
}),
|
|
4520
|
+
environment: zFiscalEnvironment,
|
|
4521
|
+
id: z.uuid(),
|
|
4522
|
+
object: zWebhookEventObject,
|
|
4523
|
+
occurredAt: z.iso.datetime(),
|
|
4524
|
+
organizationId: z.uuid(),
|
|
4525
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4526
|
+
type: z.enum(["invoice.deliveryFailed"]),
|
|
4527
|
+
}),
|
|
4487
4528
|
]);
|
|
4488
4529
|
export const zReceptionWebhookEventEnvelope = lenientUnion([
|
|
4489
4530
|
z.object({
|
|
@@ -4617,6 +4658,36 @@ export const zWebhookEventEnvelope = lenientUnion([
|
|
|
4617
4658
|
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4618
4659
|
type: z.enum(["invoice.ready"]),
|
|
4619
4660
|
}),
|
|
4661
|
+
z.object({
|
|
4662
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4663
|
+
data: z.object({
|
|
4664
|
+
deliveryId: z.uuid(),
|
|
4665
|
+
id: z.uuid(),
|
|
4666
|
+
sourceConnectionId: z.uuid(),
|
|
4667
|
+
}),
|
|
4668
|
+
environment: zFiscalEnvironment,
|
|
4669
|
+
id: z.uuid(),
|
|
4670
|
+
object: zWebhookEventObject,
|
|
4671
|
+
occurredAt: z.iso.datetime(),
|
|
4672
|
+
organizationId: z.uuid(),
|
|
4673
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4674
|
+
type: z.enum(["invoice.deliverySent"]),
|
|
4675
|
+
}),
|
|
4676
|
+
z.object({
|
|
4677
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4678
|
+
data: z.object({
|
|
4679
|
+
deliveryId: z.uuid(),
|
|
4680
|
+
id: z.uuid(),
|
|
4681
|
+
sourceConnectionId: z.uuid(),
|
|
4682
|
+
}),
|
|
4683
|
+
environment: zFiscalEnvironment,
|
|
4684
|
+
id: z.uuid(),
|
|
4685
|
+
object: zWebhookEventObject,
|
|
4686
|
+
occurredAt: z.iso.datetime(),
|
|
4687
|
+
organizationId: z.uuid(),
|
|
4688
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4689
|
+
type: z.enum(["invoice.deliveryFailed"]),
|
|
4690
|
+
}),
|
|
4620
4691
|
z.object({
|
|
4621
4692
|
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4622
4693
|
data: z.object({
|
|
@@ -4886,6 +4957,7 @@ export const zDownloadHostedInvoicePdfResponse = zFiscalArtifactBytes;
|
|
|
4886
4957
|
export const zDownloadHostedInvoiceXmlResponse = zFiscalArtifactBytes;
|
|
4887
4958
|
export const zShareHostedInvoiceReceiptResponse = zInvoiceReceiptAccess;
|
|
4888
4959
|
export const zReplaceHostedInvoiceResponse = zInvoiceResource;
|
|
4960
|
+
export const zRetrieveHostedIssuanceReadinessResponse = zIssuanceReadiness;
|
|
4889
4961
|
export const zListFiscalOperationsResponse = zSourceFiscalOperationPage;
|
|
4890
4962
|
/**
|
|
4891
4963
|
* One immutable Source sales or correction command. A Source connection credential sends the command alone. A trusted first-party service sends it inside request beside checkout_tenant_id and environment, which name the hosted binding selecting the Source connection.
|
|
@@ -4895,19 +4967,11 @@ export const zFindFiscalOperationBySourceResponse = zFiscalOperationResource;
|
|
|
4895
4967
|
export const zFindFiscalOperationResponse = zFiscalOperationResource;
|
|
4896
4968
|
export const zFindFiscalArtifactResponse = zFiscalArtifactBytes;
|
|
4897
4969
|
export const zReadFiscalOperationTimingResponse = zFiscalOperationTimingReport;
|
|
4898
|
-
/**
|
|
4899
|
-
* The authenticated tenant's certificate-custody readiness resource.
|
|
4900
|
-
*/
|
|
4901
|
-
export const zReadCertificateCustodyReadinessResponse = zCertificateCustodyReadiness;
|
|
4902
4970
|
export const zCreateDirectConnectionRequestResponse = zDirectConnectionRequestResource;
|
|
4903
4971
|
export const zCancelDirectConnectionRequestResponse = z.void();
|
|
4904
4972
|
export const zPollDirectConnectionRequestResponse = zDirectConnectionPollResource;
|
|
4905
4973
|
export const zReadElectronicFiscalDocumentEligibilityResponse = zElectronicFiscalDocumentEligibilityResource;
|
|
4906
4974
|
export const zRetrieveFiscalDeliveryPrintedRepresentationResponse = z.instanceof(Uint8Array);
|
|
4907
|
-
/**
|
|
4908
|
-
* Current central fiscal-number ranges and actionable availability for the authenticated Source connection's issuer and environment.
|
|
4909
|
-
*/
|
|
4910
|
-
export const zReadFiscalNumberAuthorizationReadinessResponse = zFiscalNumberAuthorizationReadiness;
|
|
4911
4975
|
export const zImportHostedCertificateCustodyResponse = zHostedImportResponse;
|
|
4912
4976
|
export const zIssueHostedInvoiceCredentialResponse = zHostedInvoiceCredentialResponse;
|
|
4913
4977
|
export const zAcceptInvitationResponse = zMembershipAcceptance;
|
|
@@ -4923,6 +4987,10 @@ export const zDownloadInvoicePdfResponse = zFiscalArtifactBytes;
|
|
|
4923
4987
|
export const zDownloadInvoiceXmlResponse = zFiscalArtifactBytes;
|
|
4924
4988
|
export const zShareInvoiceReceiptResponse = zInvoiceReceiptAccess;
|
|
4925
4989
|
export const zReplaceInvoiceResponse = zInvoiceResource;
|
|
4990
|
+
/**
|
|
4991
|
+
* Whether the Source connection's issuer can issue each e-CF type now, with every blocking reason.
|
|
4992
|
+
*/
|
|
4993
|
+
export const zRetrieveIssuanceReadinessResponse = zIssuanceReadiness;
|
|
4926
4994
|
export const zCreateOrganizationResponse = zOrganizationResource;
|
|
4927
4995
|
export const zReadAuditEventsResponse = zAuditEventPage;
|
|
4928
4996
|
export const zListCertificateCustodyBindingsResponse = zCertificateCustodyBindingPage;
|
|
@@ -4985,6 +5053,8 @@ export const recognizedWebhookEventTypes = [
|
|
|
4985
5053
|
"fiscal_reception.not_received",
|
|
4986
5054
|
"fiscal_reception.received",
|
|
4987
5055
|
"invoice.accepted",
|
|
5056
|
+
"invoice.deliveryFailed",
|
|
5057
|
+
"invoice.deliverySent",
|
|
4988
5058
|
"invoice.operatorRequired",
|
|
4989
5059
|
"invoice.ready",
|
|
4990
5060
|
"invoice.rejected",
|