@timbro/invoices 0.14.0-next.0 → 0.14.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 (39) hide show
  1. package/README.md +25 -1
  2. package/dist/admin.d.ts +1 -1
  3. package/dist/admin.d.ts.map +1 -1
  4. package/dist/fiscal-engine-runtime.manifest.json +17 -12
  5. package/dist/fiscal-engine-runtime.provenance.json +18 -13
  6. package/dist/generated/hosted/types.gen.d.ts +40 -5
  7. package/dist/generated/hosted/types.gen.d.ts.map +1 -1
  8. package/dist/generated/hosted/zod-response.gen.d.ts +28 -14
  9. package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
  10. package/dist/generated/hosted/zod-response.gen.js +90 -0
  11. package/dist/generated/hosted/zod.gen.d.ts +10 -5
  12. package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
  13. package/dist/generated/hosted/zod.gen.js +90 -0
  14. package/dist/generated/index.d.ts +3 -3
  15. package/dist/generated/index.d.ts.map +1 -1
  16. package/dist/generated/index.js +2 -2
  17. package/dist/generated/invoice-api-contract.d.ts +241 -12
  18. package/dist/generated/invoice-api-contract.d.ts.map +1 -1
  19. package/dist/generated/invoice-api-contract.js +369 -12
  20. package/dist/generated/problem-catalog.d.ts.map +1 -1
  21. package/dist/generated/problem-catalog.js +13 -0
  22. package/dist/generated/sdk.gen.d.ts +4 -2
  23. package/dist/generated/sdk.gen.d.ts.map +1 -1
  24. package/dist/generated/sdk.gen.js +70 -2
  25. package/dist/generated/types.gen.d.ts +179 -9
  26. package/dist/generated/types.gen.d.ts.map +1 -1
  27. package/dist/generated/zod-response.gen.d.ts +588 -286
  28. package/dist/generated/zod-response.gen.d.ts.map +1 -1
  29. package/dist/generated/zod-response.gen.js +86 -4
  30. package/dist/generated/zod.gen.d.ts +15608 -597
  31. package/dist/generated/zod.gen.d.ts.map +1 -1
  32. package/dist/generated/zod.gen.js +312 -17
  33. package/dist/hosted-tenant.d.ts +12 -1
  34. package/dist/hosted-tenant.d.ts.map +1 -1
  35. package/dist/hosted-tenant.js +13 -1
  36. package/dist/problem-contract.d.ts +4 -0
  37. package/dist/problem-contract.d.ts.map +1 -1
  38. package/dist/timbro_fiscal_engine_bg.wasm +0 -0
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- import { zAcceptInvitationResponse, zApproveDirectConnectionRequestResponse, zAuthorizeAuthorityRejectedReplacementResponse, zBeginVercelSourceProviderInstallationResponse, zCancelDirectConnectionRequestResponse, zCloseWorkspaceSessionResponse, zCompleteLegalIssuerProfileResponse, zCompleteSourceConnectionActivationVerificationResponse, zCompleteVercelSourceProviderInstallationResponse, zConfirmDirectConnectionResponse, zCreateCertificateCustodyBindingResponse, zCreateDirectConnectionRequestResponse, zCreateFiscalOperationResponse, zCreateHostedInvoiceResponse, zCreateHostedTenantResponse, zCreateHostedTenantWebhookSecretRotationResponse, zCreateInvoiceDeliveryResponse, zCreateInvoiceResponse, zCreateOrganizationResponse, zCreateSourceConnectionResponse, zDeclareReceptionMountResponse, zDownloadHostedInvoicePdfResponse, zDownloadHostedInvoiceXmlResponse, zDownloadInvoicePdfResponse, zDownloadInvoiceReceiptPdfResponse, zDownloadInvoiceXmlResponse, zFindFiscalArtifactResponse, zFindFiscalOperationBySourceResponse, zFindFiscalOperationResponse, zGetSourceReceivedDocumentResponse, zHealthLiveResponse, zHealthReadyResponse, zImportHostedCertificateCustodyResponse, zInspectFiscalNumberAuthorizationHistoryResponse, zInviteMemberResponse, zIssueHostedInvoiceCredentialResponse, zListAuthorizedVercelProjectsResponse, zListCertificateCustodyBindingsResponse, zListFiscalOperationsResponse, zListHostedInvoicesResponse, zListInvitationsResponse, zListInvoicesResponse, zListLegalIssuersResponse, zListOrganizationFiscalOperationsResponse, zListReceivedDocumentsResponse, zListSourceConnectionsResponse, zListSourceProviderAuthorizationsResponse, zListSourceReceivedDocumentsResponse, zListWebhookDeliveriesResponse, zOpenWorkspaceSessionResponse, zPollDirectConnectionRequestResponse, zPreviewDirectConnectionRequestResponse, zPreviewHostedInvoiceResponse, zPreviewInvoiceResponse, zProblemBody, zReadAuditEventsResponse, zReadAuthorizedVercelProjectQualificationResponse, zReadCertificateCustodyBindingResponse, zReadCurrentUserAccountResponse, zReadElectronicFiscalDocumentEligibilityResponse, zReadFiscalOperationTimingResponse, zReadOnboardingLegalIssuerIdentityResponse, zReadOnboardingReadinessResponse, zReadOnboardingServiceScopeResponse, zReadOrganizationFiscalOperationResponse, zReadReceivedDocumentResponse, zReadSourceConnectionResponse, zReadSourceProviderAuthorizationResponse, zRecordCommercialResponseResponse, zRecoverSourceConnectionActivationResponse, zRegisterFiscalNumberAuthorizationResponse, zRegisterLegalIssuerResponse, zRegisterUserAccountResponse, zRegisterWebhookEndpointResponse, zReleaseHostedTenantResponse, zReplaceHostedInvoiceResponse, zReplaceInvoiceResponse, zReplayWebhookEventsResponse, zRespondToReceivedDocumentResponse, zRetrieveFiscalDeliveryPrintedRepresentationResponse, zRetrieveHostedCertificationTestSetResponse, zRetrieveHostedInvoiceResponse, zRetrieveHostedIssuanceReadinessResponse, zRetrieveInvoiceDeliveryResponse, zRetrieveInvoiceReceiptResponse, zRetrieveInvoiceResponse, zRetrieveIssuanceReadinessResponse, zRetrieveWorkspaceFiscalArtifactResponse, zRevokeCertificateCustodyCertificateVersionResponse, zShareHostedInvoiceReceiptResponse, zShareInvoiceReceiptResponse, zUpdateOnboardingLegalIssuerIdentityResponse, zUpdateOnboardingServiceScopeResponse, zUploadHostedCertificationTestSetResponse, } from "./zod-response.gen.js";
2
+ import { zAcceptInvitationResponse, zApproveDirectConnectionRequestResponse, zAuthorizeAuthorityRejectedReplacementResponse, zBeginVercelSourceProviderInstallationResponse, zCancelDirectConnectionRequestResponse, zCloseWorkspaceSessionResponse, zCompleteLegalIssuerProfileResponse, zCompleteSourceConnectionActivationVerificationResponse, zCompleteVercelSourceProviderInstallationResponse, zConfirmDirectConnectionResponse, zCreateCertificateCustodyBindingResponse, zCreateDirectConnectionRequestResponse, zCreateFiscalOperationResponse, zCreateHostedInvoiceResponse, zCreateHostedTenantResponse, zCreateHostedTenantWebhookSecretRotationResponse, zCreateInvoiceDeliveryResponse, zCreateInvoiceResponse, zCreateOrganizationResponse, zCreateSourceConnectionResponse, zDeclareReceptionMountResponse, zDownloadHostedInvoicePdfResponse, zDownloadHostedInvoiceXmlResponse, zDownloadInvoicePdfResponse, zDownloadInvoiceReceiptPdfResponse, zDownloadInvoiceXmlResponse, zFindFiscalArtifactResponse, zFindFiscalOperationBySourceResponse, zFindFiscalOperationResponse, zGetSourceReceivedDocumentResponse, zHealthLiveResponse, zHealthReadyResponse, zImportHostedCertificateCustodyResponse, zInspectFiscalNumberAuthorizationHistoryResponse, zInviteMemberResponse, zIssueHostedInvoiceCredentialResponse, zListAuthorizedVercelProjectsResponse, zListCertificateCustodyBindingsResponse, zListFiscalOperationsResponse, zListHostedInvoicesResponse, zListInvitationsResponse, zListInvoicesResponse, zListLegalIssuersResponse, zListOrganizationFiscalOperationsResponse, zListReceivedDocumentsResponse, zListSourceConnectionsResponse, zListSourceProviderAuthorizationsResponse, zListSourceReceivedDocumentsResponse, zListWebhookDeliveriesResponse, zOpenWorkspaceSessionResponse, zPollDirectConnectionRequestResponse, zPreviewDirectConnectionRequestResponse, zPreviewHostedInvoiceResponse, zPreviewInvoiceResponse, zProblemBody, zReadAuditEventsResponse, zReadAuthorizedVercelProjectQualificationResponse, zReadCertificateCustodyBindingResponse, zReadCurrentUserAccountResponse, zReadElectronicFiscalDocumentEligibilityResponse, zReadFiscalOperationTimingResponse, zReadOnboardingLegalIssuerIdentityResponse, zReadOnboardingReadinessResponse, zReadOnboardingServiceScopeResponse, zReadOrganizationFiscalOperationResponse, zReadReceivedDocumentResponse, zReadSourceConnectionResponse, zReadSourceProviderAuthorizationResponse, zRecordCommercialResponseResponse, zRecoverSourceConnectionActivationResponse, zRegisterFiscalNumberAuthorizationResponse, zRegisterLegalIssuerResponse, zRegisterUserAccountResponse, zRegisterWebhookEndpointResponse, zReleaseHostedTenantResponse, zRepairHostedTenantSourceConnectionResponse, zReplaceHostedInvoiceResponse, zReplaceInvoiceResponse, zReplayWebhookEventsResponse, zRespondToReceivedDocumentResponse, zRetrieveFiscalDeliveryPrintedRepresentationResponse, zRetrieveHostedCertificationTestSetResponse, zRetrieveHostedInvoiceResponse, zRetrieveHostedIssuanceReadinessResponse, zRetrieveInvoiceDeliveryResponse, zRetrieveInvoiceReceiptResponse, zRetrieveInvoiceResponse, zRetrieveIssuanceReadinessResponse, zRetrieveWorkspaceFiscalArtifactResponse, zRevokeCertificateCustodyCertificateVersionResponse, zShareHostedInvoiceReceiptResponse, zShareInvoiceReceiptResponse, zUpdateOnboardingLegalIssuerIdentityResponse, zUpdateOnboardingServiceScopeResponse, zUploadHostedCertificationTestSetResponse, } from "./zod-response.gen.js";
3
3
  export const healthLive = (options) => options.client.get({
4
4
  response_decoder: (response) => {
5
5
  switch (response.status) {
@@ -194,6 +194,73 @@ export const releaseHostedTenant = (options) => options.client.post({
194
194
  ...options.headers,
195
195
  },
196
196
  });
197
+ export const repairHostedTenantSourceConnection = (options) => options.client.post({
198
+ response_decoder: (response) => {
199
+ switch (response.status) {
200
+ case 200:
201
+ return {
202
+ status: 200,
203
+ headers: response.headers,
204
+ body: zRepairHostedTenantSourceConnectionResponse.parse(response.body),
205
+ };
206
+ case 400:
207
+ return {
208
+ status: 400,
209
+ headers: response.headers,
210
+ body: zProblemBody.parse(response.body),
211
+ };
212
+ case 401:
213
+ return {
214
+ status: 401,
215
+ headers: response.headers,
216
+ body: zProblemBody.parse(response.body),
217
+ };
218
+ case 403:
219
+ return {
220
+ status: 403,
221
+ headers: response.headers,
222
+ body: zProblemBody.parse(response.body),
223
+ };
224
+ case 404:
225
+ return {
226
+ status: 404,
227
+ headers: response.headers,
228
+ body: zProblemBody.parse(response.body),
229
+ };
230
+ case 413:
231
+ return {
232
+ status: 413,
233
+ headers: response.headers,
234
+ body: zProblemBody.parse(response.body),
235
+ };
236
+ case 415:
237
+ return {
238
+ status: 415,
239
+ headers: response.headers,
240
+ body: zProblemBody.parse(response.body),
241
+ };
242
+ case 500:
243
+ return {
244
+ status: 500,
245
+ headers: response.headers,
246
+ body: zProblemBody.parse(response.body),
247
+ };
248
+ default:
249
+ return {
250
+ status: "unexpected",
251
+ status_code: response.status,
252
+ headers: response.headers,
253
+ body: response.body,
254
+ };
255
+ }
256
+ },
257
+ url: "/hosted/tenants/source-connection-repairs",
258
+ ...options,
259
+ headers: {
260
+ "Content-Type": "application/json",
261
+ ...options.headers,
262
+ },
263
+ });
197
264
  export const createHostedTenantWebhookSecretRotation = (options) => options.client.post({
198
265
  response_decoder: (response) => {
199
266
  switch (response.status) {
@@ -1497,7 +1564,7 @@ export const retrieveFiscalDeliveryPrintedRepresentation = (options) => options.
1497
1564
  ...options,
1498
1565
  });
1499
1566
  /**
1500
- * Imports a hosted tenant's P12 into certificate custody for its exact environment binding. The environment defaults to sandbox; production is available when that tenant has a production binding. Timbro verifies the certificate identity, trust, validity, signer proof, and custody envelope.
1567
+ * Imports a hosted tenant's P12 into certificate custody once for its Legal issuer. The named environment (default sandbox) is the binding the import is made from, and the certificate then serves every environment the issuer is bound in. An environment bound later adopts it without another upload. Timbro verifies the certificate identity, trust, validity, signer proof, and custody envelope, and refuses the whole import with the environment that cannot use the certificate: it already uses a different certificate, its certificate was revoked, or it enrolled another signer.
1501
1568
  */
1502
1569
  export const importHostedCertificateCustody = (options) => options.client.post({
1503
1570
  response_decoder: (response) => {
@@ -5453,6 +5520,7 @@ export const healthLivePathTemplate = "/health/live";
5453
5520
  export const healthReadyPathTemplate = "/health/ready";
5454
5521
  export const createHostedTenantPathTemplate = "/hosted/tenants";
5455
5522
  export const releaseHostedTenantPathTemplate = "/hosted/tenants/releases";
5523
+ export const repairHostedTenantSourceConnectionPathTemplate = "/hosted/tenants/source-connection-repairs";
5456
5524
  export const createHostedTenantWebhookSecretRotationPathTemplate = "/hosted/tenants/{source_connection_id}/webhook-secret-rotations";
5457
5525
  export const uploadHostedCertificationTestSetPathTemplate = "/internal/hosted/certification/{attemptReference}/test-sets";
5458
5526
  export const retrieveHostedCertificationTestSetPathTemplate = "/internal/hosted/certification/{attemptReference}/test-sets/current";
@@ -930,6 +930,11 @@ export type HostedImportRequest = {
930
930
  };
931
931
  export type HostedImportResponse = {
932
932
  certificate_subject_common_name: string | null;
933
+ /**
934
+ * The environments the Legal issuer's certificate now serves, in sandbox, certification, then
935
+ * production order. An environment bound later adopts the certificate when it is bound.
936
+ */
937
+ environments: Array<HostedCertificateImportEnvironment>;
933
938
  object: string;
934
939
  signer_subject_serial_number: string;
935
940
  };
@@ -959,6 +964,10 @@ export type HostedReceiverUrls = {
959
964
  commercial_approval_url: string;
960
965
  reception_url: string;
961
966
  };
967
+ /**
968
+ * What the repair did to the binding's Source connection.
969
+ */
970
+ export type HostedSourceConnectionRepairOutcome = "reconnected" | "already_connected";
962
971
  export type HostedTenantResource = {
963
972
  /**
964
973
  * The binding identity the Checkout host uses for an exact release request.
@@ -1132,6 +1141,10 @@ export type InvoiceCreditNotePaymentTerms = {
1132
1141
  } | {
1133
1142
  type: "free";
1134
1143
  };
1144
+ /**
1145
+ * A calendar date in the public API's ISO 8601 date form.
1146
+ */
1147
+ export type InvoiceDate = string;
1135
1148
  export type InvoiceDebitNoteModificationCode = "2" | "3";
1136
1149
  export type InvoiceDeliveryAttachmentSelection = {
1137
1150
  /**
@@ -1199,6 +1212,24 @@ export type InvoiceExportItem = {
1199
1212
  unit: SourceMeasurementUnit;
1200
1213
  unitPrice: string;
1201
1214
  };
1215
+ /**
1216
+ * A document issued outside Timbro that a legal note modifies.
1217
+ *
1218
+ * `fiscalNumber` is the original e-NCF (`E`, the two type digits, and ten digits) or paper NCF
1219
+ * (`B` and ten digits, or `A` or `P` and eighteen digits). `issuerTaxId` is DGII's RNC Otro
1220
+ * Contribuyente and applies only when the original was issued under a different RNC than the
1221
+ * note, for example after a merger or split. `buyer` is the original's buyer and may be omitted
1222
+ * for an anonymous consumer document. `total` is the original's total and is required when the
1223
+ * original is an e-CF type 32, because DGII requires the buyer's identity on a note against a
1224
+ * type 32 of DOP 250,000.00 or more.
1225
+ */
1226
+ export type InvoiceExternalOriginal = {
1227
+ buyer?: null | InvoiceConsumerBuyer | undefined;
1228
+ fiscalNumber: string;
1229
+ issuedOn: InvoiceDate;
1230
+ issuerTaxId?: null | string | undefined;
1231
+ total?: null | string | undefined;
1232
+ };
1202
1233
  export type InvoiceFiles = {
1203
1234
  pdf: InvoicePdfReadiness;
1204
1235
  xml: InvoiceXmlReadiness;
@@ -1319,10 +1350,7 @@ export type InvoiceItemResource = {
1319
1350
  legalTip: boolean;
1320
1351
  quantity: string;
1321
1352
  tax: InvoiceTax;
1322
- /**
1323
- * A named common unit, or the retained DGII code for another official unit.
1324
- */
1325
- unit: string;
1353
+ unit: SourceMeasurementUnit;
1326
1354
  unitPrice: string;
1327
1355
  withholding: null | InvoiceItemWithholding;
1328
1356
  };
@@ -1705,12 +1733,33 @@ export type InvoiceRequest = {
1705
1733
  items: Array<InvoiceItem>;
1706
1734
  modificationCode: InvoiceDebitNoteModificationCode;
1707
1735
  numbering?: null | InvoiceNumbering | undefined;
1736
+ /**
1737
+ * The Invoice Timbro issued that this note modifies. The note takes its buyer from that Invoice.
1738
+ */
1708
1739
  originalInvoiceId: string;
1709
1740
  paymentTerms: InvoicePaymentTerms;
1710
1741
  pdfLayout?: null | InvoicePdfLayout | undefined;
1711
1742
  reason: string;
1712
1743
  source?: null | InvoiceSourceInput | undefined;
1713
1744
  type: "E33";
1745
+ } | {
1746
+ additionalInformation?: null | InvoiceAdditionalInformation | undefined;
1747
+ currency: "DOP";
1748
+ expectedTotals?: null | InvoiceExpectedTotals | undefined;
1749
+ externalOriginal: InvoiceExternalOriginal;
1750
+ incomeType?: null | "01" | "02" | "03" | "04" | "05" | "06" | undefined;
1751
+ /**
1752
+ * The only field a source-system reference travels in, bounded at 128 characters.
1753
+ */
1754
+ invoiceReference: string;
1755
+ items: Array<InvoiceItem>;
1756
+ modificationCode: InvoiceDebitNoteModificationCode;
1757
+ numbering?: null | InvoiceNumbering | undefined;
1758
+ paymentTerms: InvoicePaymentTerms;
1759
+ pdfLayout?: null | InvoicePdfLayout | undefined;
1760
+ reason: string;
1761
+ source?: null | InvoiceSourceInput | undefined;
1762
+ type: "E33";
1714
1763
  } | {
1715
1764
  additionalInformation?: null | InvoiceAdditionalInformation | undefined;
1716
1765
  currency: "DOP";
@@ -1723,12 +1772,33 @@ export type InvoiceRequest = {
1723
1772
  items: Array<InvoiceItem>;
1724
1773
  modificationCode: InvoiceCreditNoteModificationCode;
1725
1774
  numbering?: null | InvoiceNumbering | undefined;
1775
+ /**
1776
+ * The Invoice Timbro issued that this note modifies. The note takes its buyer from that Invoice.
1777
+ */
1726
1778
  originalInvoiceId: string;
1727
1779
  paymentTerms: InvoiceCreditNotePaymentTerms;
1728
1780
  pdfLayout?: null | InvoicePdfLayout | undefined;
1729
1781
  reason: string;
1730
1782
  source?: null | InvoiceSourceInput | undefined;
1731
1783
  type: "E34";
1784
+ } | {
1785
+ additionalInformation?: null | InvoiceAdditionalInformation | undefined;
1786
+ currency: "DOP";
1787
+ expectedTotals?: null | InvoiceExpectedTotals | undefined;
1788
+ externalOriginal: InvoiceExternalOriginal;
1789
+ incomeType?: null | "01" | "02" | "03" | "04" | "05" | "06" | undefined;
1790
+ /**
1791
+ * The only field a source-system reference travels in, bounded at 128 characters.
1792
+ */
1793
+ invoiceReference: string;
1794
+ items: Array<InvoiceItem>;
1795
+ modificationCode: InvoiceCreditNoteModificationCode;
1796
+ numbering?: null | InvoiceNumbering | undefined;
1797
+ paymentTerms: InvoiceCreditNotePaymentTerms;
1798
+ pdfLayout?: null | InvoicePdfLayout | undefined;
1799
+ reason: string;
1800
+ source?: null | InvoiceSourceInput | undefined;
1801
+ type: "E34";
1732
1802
  };
1733
1803
  export type InvoiceResource = {
1734
1804
  acceptedAt: string | null;
@@ -2563,7 +2633,7 @@ export type ProblemType = "about:blank";
2563
2633
  /**
2564
2634
  * One stable public problem code returned on the `/v1` surface.
2565
2635
  */
2566
- export type PublicProblemCode = "unauthenticated" | "invalid_login" | "email_already_registered" | "organization_slug_taken" | "organization_not_found" | "hosted_tenant_conflict" | "insufficient_role" | "service_role_not_permitted" | "invalid_fiscal_identity" | "invalid_certificate_custody_signer_identity" | "certificate_p12_password_invalid" | "custody_certificate_malformed" | "custody_certificate_not_yet_valid" | "custody_certificate_expired" | "custody_p12_work_limit_exceeded" | "custody_signature_algorithm_unsupported" | "custody_certificate_trust_profile_unsupported" | "custody_certificate_chain_untrusted" | "custody_certificate_purpose_unsupported" | "legal_issuer_already_registered" | "onboarding_legal_issuer_identity_conflict" | "legal_issuer_profile_incomplete" | "legal_issuer_not_found" | "invitation_invalid" | "invitation_expired" | "already_a_member" | "environment_not_active" | "certificate_custody_binding_not_found" | "certificate_custody_binding_conflict" | "certificate_custody_certificate_version_not_active" | "source_connection_not_found" | "source_connection_not_connected" | "source_provider_unavailable" | "source_provider_authorization_required" | "source_provider_installation_disabled" | "source_provider_installation_removed" | "source_provider_scope_insufficient" | "source_provider_target_access_removed" | "source_provider_throttled" | "source_provider_outcome_unknown" | "source_provider_authorization_not_found" | "source_provider_authorization_conflict" | "source_provider_installation_request_invalid" | "source_provider_installation_request_expired" | "source_provider_installation_callback_replayed" | "source_connection_creation_conflict" | "source_connection_activation_conflict" | "source_connection_activation_verification_rejected" | "delegated_authorization_verifier_forbidden" | "invalid_credential" | "credential_revoked" | "issuer_not_authorized" | "missing_idempotency_key" | "invalid_idempotency_key" | "unsupported_media_type" | "request_too_large" | "request_body_timeout" | "malformed_json" | "invalid_request" | "certification_environment_required" | "certification_test_set_invalid" | "invalid_collection_query" | "invalid_collection_cursor" | "document_type_not_enabled" | "fiscal_intent_rejected" | "idempotency_key_conflict" | "fiscal_number_already_used" | "fiscal_number_authorization_changed" | "fiscal_number_authorization_source_record_conflict" | "source_version_stale" | "source_predecessor_conflict" | "source_history_requires_reconciliation" | "source_content_conflict" | "source_action_conflict" | "source_command_conflict" | "invoice_reference_conflict" | "invoice_totals_mismatch" | "printed_representation_profile_conflict" | "source_record_already_fiscalized" | "source_operation_pending" | "source_outcome_unknown" | "authority_rejected_replacement" | "correction_target_unsettled" | "unsupported_printed_representation_profile" | "affected_fiscal_operation_unsupported" | "fiscal_issuance_blocked" | "fiscal_operation_not_found" | "invoice_not_found" | "fiscal_artifact_not_found" | "fiscal_artifact_unverified" | "fiscal_artifact_unavailable" | "invoice_receipt_not_found" | "invoice_receipt_not_ready" | "invoice_receipt_unavailable" | "fiscal_delivery_not_found" | "fiscal_delivery_unavailable" | "fiscal_delivery_outcome_conflict" | "webhook_endpoint_not_found" | "webhook_endpoint_registration_conflict" | "webhook_endpoint_suspended" | "webhook_endpoint_deleted" | "webhook_event_not_found" | "invalid_replay_scope" | "webhook_destination_not_allowed" | "unsigned_document_schema_invalid" | "signed_document_schema_invalid" | "custody_unavailable" | "received_document_not_found" | "commercial_response_motive_invalid" | "commercial_response_decision_conflict" | "route_not_found" | "method_not_allowed" | "internal_error";
2636
+ export type PublicProblemCode = "unauthenticated" | "invalid_login" | "email_already_registered" | "organization_slug_taken" | "organization_not_found" | "hosted_tenant_conflict" | "insufficient_role" | "service_role_not_permitted" | "invalid_fiscal_identity" | "invalid_certificate_custody_signer_identity" | "certificate_p12_password_invalid" | "custody_certificate_malformed" | "custody_certificate_not_yet_valid" | "custody_certificate_expired" | "custody_p12_work_limit_exceeded" | "custody_signature_algorithm_unsupported" | "custody_certificate_trust_profile_unsupported" | "custody_certificate_chain_untrusted" | "custody_certificate_purpose_unsupported" | "legal_issuer_already_registered" | "onboarding_legal_issuer_identity_conflict" | "legal_issuer_profile_incomplete" | "legal_issuer_not_found" | "invitation_invalid" | "invitation_expired" | "already_a_member" | "environment_not_active" | "certificate_custody_binding_not_found" | "certificate_custody_binding_conflict" | "certificate_custody_environment_occupied" | "certificate_custody_environment_revoked" | "certificate_custody_environment_signer_mismatch" | "certificate_custody_certificate_version_not_active" | "source_connection_not_found" | "source_connection_not_connected" | "source_provider_unavailable" | "source_provider_authorization_required" | "source_provider_installation_disabled" | "source_provider_installation_removed" | "source_provider_scope_insufficient" | "source_provider_target_access_removed" | "source_provider_throttled" | "source_provider_outcome_unknown" | "source_provider_authorization_not_found" | "source_provider_authorization_conflict" | "source_provider_installation_request_invalid" | "source_provider_installation_request_expired" | "source_provider_installation_callback_replayed" | "source_connection_creation_conflict" | "source_connection_activation_conflict" | "source_connection_activation_verification_rejected" | "delegated_authorization_verifier_forbidden" | "invalid_credential" | "credential_revoked" | "issuer_not_authorized" | "missing_idempotency_key" | "invalid_idempotency_key" | "unsupported_media_type" | "request_too_large" | "request_body_timeout" | "malformed_json" | "invalid_request" | "invoice_original_invalid" | "certification_environment_required" | "certification_test_set_invalid" | "invalid_collection_query" | "invalid_collection_cursor" | "document_type_not_enabled" | "fiscal_intent_rejected" | "idempotency_key_conflict" | "fiscal_number_already_used" | "fiscal_number_authorization_changed" | "fiscal_number_authorization_source_record_conflict" | "source_version_stale" | "source_predecessor_conflict" | "source_history_requires_reconciliation" | "source_content_conflict" | "source_action_conflict" | "source_command_conflict" | "invoice_reference_conflict" | "invoice_totals_mismatch" | "printed_representation_profile_conflict" | "source_record_already_fiscalized" | "source_operation_pending" | "source_outcome_unknown" | "authority_rejected_replacement" | "correction_target_unsettled" | "unsupported_printed_representation_profile" | "affected_fiscal_operation_unsupported" | "fiscal_issuance_blocked" | "fiscal_operation_not_found" | "invoice_not_found" | "fiscal_artifact_not_found" | "fiscal_artifact_unverified" | "fiscal_artifact_unavailable" | "invoice_receipt_not_found" | "invoice_receipt_not_ready" | "invoice_receipt_unavailable" | "fiscal_delivery_not_found" | "fiscal_delivery_unavailable" | "fiscal_delivery_outcome_conflict" | "webhook_endpoint_not_found" | "webhook_endpoint_registration_conflict" | "webhook_endpoint_suspended" | "webhook_endpoint_deleted" | "webhook_event_not_found" | "invalid_replay_scope" | "webhook_destination_not_allowed" | "unsigned_document_schema_invalid" | "signed_document_schema_invalid" | "custody_unavailable" | "received_document_not_found" | "commercial_response_motive_invalid" | "commercial_response_decision_conflict" | "route_not_found" | "method_not_allowed" | "internal_error";
2567
2637
  export type QualifiedProductionOrigin = {
2568
2638
  domain: string;
2569
2639
  origin: string;
@@ -2766,6 +2836,26 @@ export type ReleasedHostedTenant = {
2766
2836
  release_id: string;
2767
2837
  state: string;
2768
2838
  };
2839
+ export type RepairHostedTenantSourceConnectionRequest = {
2840
+ /**
2841
+ * The Checkout tenant whose binding is repaired. It must match the tenant the token proves.
2842
+ */
2843
+ checkout_tenant_id: string;
2844
+ /**
2845
+ * The Fiscal environment of the binding.
2846
+ */
2847
+ environment: FiscalEnvironment;
2848
+ };
2849
+ export type RepairedHostedTenantSourceConnection = {
2850
+ environment: FiscalEnvironment;
2851
+ hosted_tenant_binding_id: string;
2852
+ outcome: HostedSourceConnectionRepairOutcome;
2853
+ /**
2854
+ * The binding's Source connection. Repair keeps its identity, so webhook addresses and Fiscal
2855
+ * operations that name it stay valid.
2856
+ */
2857
+ source_connection_id: string;
2858
+ };
2769
2859
  export type ReplayEventIdsScope = {
2770
2860
  eventIds: Array<string>;
2771
2861
  };
@@ -3036,6 +3126,40 @@ export type SourceFiscalActionCommand = {
3036
3126
  version: string;
3037
3127
  };
3038
3128
  reason: string;
3129
+ } | {
3130
+ /**
3131
+ * Document issued outside Timbro that a common-path note modifies.
3132
+ *
3133
+ * The original e-NCF or NCF is not in Timbro's ledger, so the caller states the facts DGII
3134
+ * validates on the note: the number, its issue date, and the other taxpayer's RNC when the
3135
+ * original was issued under a different RNC than the note.
3136
+ */
3137
+ affected_document: {
3138
+ consumer_invoice_total?: string | undefined;
3139
+ fiscal_number: string;
3140
+ issued_on: string;
3141
+ issuer_tax_id?: string | undefined;
3142
+ };
3143
+ correction: SourceCreditNoteCorrection;
3144
+ kind: "credit_note_of_external_document";
3145
+ reason: string;
3146
+ } | {
3147
+ /**
3148
+ * Document issued outside Timbro that a common-path note modifies.
3149
+ *
3150
+ * The original e-NCF or NCF is not in Timbro's ledger, so the caller states the facts DGII
3151
+ * validates on the note: the number, its issue date, and the other taxpayer's RNC when the
3152
+ * original was issued under a different RNC than the note.
3153
+ */
3154
+ affected_document: {
3155
+ consumer_invoice_total?: string | undefined;
3156
+ fiscal_number: string;
3157
+ issued_on: string;
3158
+ issuer_tax_id?: string | undefined;
3159
+ };
3160
+ correction: SourceDebitNoteCorrection;
3161
+ kind: "debit_note_of_external_document";
3162
+ reason: string;
3039
3163
  };
3040
3164
  export type SourceFiscalOperationPage = {
3041
3165
  data: Array<FiscalOperationResource>;
@@ -3085,9 +3209,10 @@ export type SourceGovernmentEligibility = {
3085
3209
  */
3086
3210
  export type SourceItemKind = "good" | "service";
3087
3211
  /**
3088
- * Common semantic measurement units mapped to official DGII catalog codes by fiscal-document.
3212
+ * A DGII e-CF unit of measure: a readable lowercase name on the Source and Invoice wire,
3213
+ * the official numeric catalog code in fiscal documents.
3089
3214
  */
3090
- export type SourceMeasurementUnit = "unit" | "kilogram" | "litre" | "metre" | "piece";
3215
+ export type SourceMeasurementUnit = "barrel" | "bag" | "jar" | "bundle" | "bottle" | "box" | "cigarette_pack" | "centimetre" | "cylinder" | "set" | "container" | "day" | "dozen" | "bale" | "gallon" | "degree" | "gram" | "bulk" | "hour" | "crate" | "kilogram" | "kilowatt_hour" | "pound" | "litre" | "lot" | "metre" | "square_metre" | "cubic_metre" | "million_btu" | "minute" | "package" | "pair" | "foot" | "piece" | "roll" | "envelope" | "second" | "tank" | "ton" | "tube" | "yard" | "square_yard" | "unit" | "element" | "thousand" | "sack" | "tin" | "display" | "drum" | "ration" | "quintal" | "gross_register_tonnage" | "square_foot" | "passenger" | "inch" | "boat_berth_stay" | "tray" | "hectare" | "millilitre" | "milligram" | "ounce" | "troy_ounce";
3091
3216
  /**
3092
3217
  * One exact decimal payment allocation declared by the Source system.
3093
3218
  */
@@ -3213,9 +3338,10 @@ export type SourceSalesLine = {
3213
3338
  item_codes?: Array<FiscalItemCode> | undefined;
3214
3339
  item_kind: SourceItemKind;
3215
3340
  /**
3216
- * Common semantic measurement units mapped to official DGII catalog codes by fiscal-document.
3341
+ * A DGII e-CF unit of measure: a readable lowercase name on the Source and Invoice wire,
3342
+ * the official numeric catalog code in fiscal documents.
3217
3343
  */
3218
- measurement_unit: "unit" | "kilogram" | "litre" | "metre" | "piece";
3344
+ measurement_unit: "barrel" | "bag" | "jar" | "bundle" | "bottle" | "box" | "cigarette_pack" | "centimetre" | "cylinder" | "set" | "container" | "day" | "dozen" | "bale" | "gallon" | "degree" | "gram" | "bulk" | "hour" | "crate" | "kilogram" | "kilowatt_hour" | "pound" | "litre" | "lot" | "metre" | "square_metre" | "cubic_metre" | "million_btu" | "minute" | "package" | "pair" | "foot" | "piece" | "roll" | "envelope" | "second" | "tank" | "ton" | "tube" | "yard" | "square_yard" | "unit" | "element" | "thousand" | "sack" | "tin" | "display" | "drum" | "ration" | "quintal" | "gross_register_tonnage" | "square_foot" | "passenger" | "inch" | "boat_berth_stay" | "tray" | "hectare" | "millilitre" | "milligram" | "ounce" | "troy_ounce";
3219
3345
  quantity: string;
3220
3346
  source_line_id: string;
3221
3347
  tax_treatment: SourceTaxTreatment;
@@ -5089,6 +5215,50 @@ export type ReleaseHostedTenantResponses = {
5089
5215
  200: ReleasedHostedTenant;
5090
5216
  };
5091
5217
  export type ReleaseHostedTenantResponse = ReleaseHostedTenantResponses[keyof ReleaseHostedTenantResponses];
5218
+ export type RepairHostedTenantSourceConnectionData = {
5219
+ body: RepairHostedTenantSourceConnectionRequest;
5220
+ path?: never | undefined;
5221
+ query?: never | undefined;
5222
+ url: "/hosted/tenants/source-connection-repairs";
5223
+ };
5224
+ export type RepairHostedTenantSourceConnectionErrors = {
5225
+ /**
5226
+ * The request body failed the contract.
5227
+ */
5228
+ 400: ProblemBody;
5229
+ /**
5230
+ * The bearer token is missing, expired, or not from a trusted issuer.
5231
+ */
5232
+ 401: ProblemBody;
5233
+ /**
5234
+ * The hosted user does not hold the owner role.
5235
+ */
5236
+ 403: ProblemBody;
5237
+ /**
5238
+ * The tenant in the body is not the tenant the token proves, or that tenant holds no active binding in the environment.
5239
+ */
5240
+ 404: ProblemBody;
5241
+ /**
5242
+ * The native stamp server returned a typed Problem.
5243
+ */
5244
+ 413: ProblemBody;
5245
+ /**
5246
+ * The native stamp server returned a typed Problem.
5247
+ */
5248
+ 415: ProblemBody;
5249
+ /**
5250
+ * The native stamp server returned a typed Problem.
5251
+ */
5252
+ 500: ProblemBody;
5253
+ };
5254
+ export type RepairHostedTenantSourceConnectionError = RepairHostedTenantSourceConnectionErrors[keyof RepairHostedTenantSourceConnectionErrors];
5255
+ export type RepairHostedTenantSourceConnectionResponses = {
5256
+ /**
5257
+ * The binding's Source connection is connected. A repeat on a connected Source connection answers `already_connected` and changes nothing.
5258
+ */
5259
+ 200: RepairedHostedTenantSourceConnection;
5260
+ };
5261
+ export type RepairHostedTenantSourceConnectionResponse = RepairHostedTenantSourceConnectionResponses[keyof RepairHostedTenantSourceConnectionResponses];
5092
5262
  export type CreateHostedTenantWebhookSecretRotationData = {
5093
5263
  body?: never | undefined;
5094
5264
  headers?: {