@timbro/invoices 0.13.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 (42) hide show
  1. package/README.md +26 -2
  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 +21 -16
  5. package/dist/fiscal-engine-runtime.provenance.json +22 -17
  6. package/dist/generated/certification-api-contract.d.ts +1 -1
  7. package/dist/generated/certification-api-contract.d.ts.map +1 -1
  8. package/dist/generated/certification-api-contract.js +1 -1
  9. package/dist/generated/hosted/types.gen.d.ts +40 -5
  10. package/dist/generated/hosted/types.gen.d.ts.map +1 -1
  11. package/dist/generated/hosted/zod-response.gen.d.ts +28 -14
  12. package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
  13. package/dist/generated/hosted/zod-response.gen.js +90 -0
  14. package/dist/generated/hosted/zod.gen.d.ts +10 -5
  15. package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
  16. package/dist/generated/hosted/zod.gen.js +90 -0
  17. package/dist/generated/index.d.ts +3 -3
  18. package/dist/generated/index.d.ts.map +1 -1
  19. package/dist/generated/index.js +2 -2
  20. package/dist/generated/invoice-api-contract.d.ts +242 -13
  21. package/dist/generated/invoice-api-contract.d.ts.map +1 -1
  22. package/dist/generated/invoice-api-contract.js +370 -13
  23. package/dist/generated/problem-catalog.d.ts.map +1 -1
  24. package/dist/generated/problem-catalog.js +13 -0
  25. package/dist/generated/sdk.gen.d.ts +4 -2
  26. package/dist/generated/sdk.gen.d.ts.map +1 -1
  27. package/dist/generated/sdk.gen.js +70 -2
  28. package/dist/generated/types.gen.d.ts +200 -15
  29. package/dist/generated/types.gen.d.ts.map +1 -1
  30. package/dist/generated/zod-response.gen.d.ts +668 -305
  31. package/dist/generated/zod-response.gen.d.ts.map +1 -1
  32. package/dist/generated/zod-response.gen.js +95 -7
  33. package/dist/generated/zod.gen.d.ts +15673 -591
  34. package/dist/generated/zod.gen.d.ts.map +1 -1
  35. package/dist/generated/zod.gen.js +329 -22
  36. package/dist/hosted-tenant.d.ts +12 -1
  37. package/dist/hosted-tenant.d.ts.map +1 -1
  38. package/dist/hosted-tenant.js +13 -1
  39. package/dist/problem-contract.d.ts +5 -1
  40. package/dist/problem-contract.d.ts.map +1 -1
  41. package/dist/timbro_fiscal_engine_bg.wasm +0 -0
  42. package/package.json +1 -1
@@ -2114,8 +2114,7 @@ export declare const invoiceApiContract: {
2114
2114
  readonly $ref: "#/components/schemas/InvoiceTax";
2115
2115
  };
2116
2116
  readonly unit: {
2117
- readonly type: "string";
2118
- readonly description: "A named common unit, or the retained DGII code for another official unit.";
2117
+ readonly $ref: "#/components/schemas/SourceMeasurementUnit";
2119
2118
  };
2120
2119
  readonly unitPrice: {
2121
2120
  readonly type: "string";
@@ -2279,6 +2278,11 @@ export declare const invoiceApiContract: {
2279
2278
  readonly propertyName: "kind";
2280
2279
  };
2281
2280
  };
2281
+ readonly SourceMeasurementUnit: {
2282
+ readonly type: "string";
2283
+ readonly description: "A DGII e-CF unit of measure: a readable lowercase name on the Source and Invoice wire,\nthe official numeric catalog code in fiscal documents.";
2284
+ readonly enum: readonly ["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"];
2285
+ };
2282
2286
  readonly InvoiceItemWithholding: {
2283
2287
  readonly oneOf: readonly [{
2284
2288
  readonly type: "object";
@@ -2604,7 +2608,7 @@ export declare const invoiceApiContract: {
2604
2608
  readonly IssuanceBlocker: {
2605
2609
  readonly type: "string";
2606
2610
  readonly description: "One stable reason the authoritative rules refuse to issue.";
2607
- readonly enum: readonly ["invalid_request", "unsupported_protocol", "unsupported_rules_version", "invalid_resolved_facts", "numbering_verifier_missing", "numbering_mode_not_enabled", "document_type_not_recognized", "authorization_missing", "authorization_not_observed_on_effective_date", "authorization_suspended", "authorization_cancelled", "authorization_superseded", "authorization_exhausted", "authorization_conflicting", "authorization_document_type_mismatch", "central_assignment_requires_verified_authorization", "authorization_expired", "authorization_range_overlap", "fiscal_number_capacity_exhausted", "invalid_fiscal_number", "fiscal_number_outside_authorized_range", "fiscal_number_before_verified_floor", "sequence_expiration_mismatch"];
2611
+ readonly enum: readonly ["invalid_request", "unsupported_protocol", "unsupported_rules_version", "invalid_resolved_facts", "numbering_verifier_missing", "numbering_mode_not_enabled", "document_type_not_recognized", "authorization_missing", "authorization_not_observed_on_effective_date", "authorization_suspended", "authorization_cancelled", "authorization_superseded", "authorization_exhausted", "authorization_conflicting", "authorization_document_type_mismatch", "sequence_rejected_by_dgii", "authorization_expired", "authorization_range_overlap", "fiscal_number_capacity_exhausted", "invalid_fiscal_number", "fiscal_number_outside_authorized_range", "fiscal_number_before_verified_floor", "sequence_expiration_mismatch"];
2608
2612
  };
2609
2613
  readonly FiscalAdmissionProblem: {
2610
2614
  readonly type: "object";
@@ -5204,7 +5208,7 @@ export declare const invoiceApiContract: {
5204
5208
  readonly additionalProperties: false;
5205
5209
  }, {
5206
5210
  readonly type: "object";
5207
- readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "originalInvoiceId", "modificationCode", "reason", "type"];
5211
+ readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "modificationCode", "reason", "originalInvoiceId", "type"];
5208
5212
  readonly properties: {
5209
5213
  readonly additionalInformation: {
5210
5214
  readonly oneOf: readonly [{
@@ -5264,6 +5268,99 @@ export declare const invoiceApiContract: {
5264
5268
  readonly originalInvoiceId: {
5265
5269
  readonly type: "string";
5266
5270
  readonly format: "uuid";
5271
+ readonly description: "The Invoice Timbro issued that this note modifies. The note takes its buyer from that Invoice.";
5272
+ };
5273
+ readonly paymentTerms: {
5274
+ readonly $ref: "#/components/schemas/InvoicePaymentTerms";
5275
+ };
5276
+ readonly pdfLayout: {
5277
+ readonly oneOf: readonly [{
5278
+ readonly type: "null";
5279
+ }, {
5280
+ readonly $ref: "#/components/schemas/InvoicePdfLayout";
5281
+ }];
5282
+ };
5283
+ readonly reason: {
5284
+ readonly type: "string";
5285
+ readonly maxLength: 90;
5286
+ readonly minLength: 1;
5287
+ readonly pattern: "^[^\\p{White_Space}](?:[\\s\\S]*[^\\p{White_Space}])?$";
5288
+ readonly "x-timbro-submission-validation": readonly ["minLength", "maxLength", "pattern"];
5289
+ };
5290
+ readonly source: {
5291
+ readonly oneOf: readonly [{
5292
+ readonly type: "null";
5293
+ }, {
5294
+ readonly $ref: "#/components/schemas/InvoiceSourceInput";
5295
+ }];
5296
+ };
5297
+ readonly type: {
5298
+ readonly type: "string";
5299
+ readonly enum: readonly ["E33"];
5300
+ };
5301
+ };
5302
+ readonly additionalProperties: false;
5303
+ }, {
5304
+ readonly type: "object";
5305
+ readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "modificationCode", "reason", "externalOriginal", "type"];
5306
+ readonly properties: {
5307
+ readonly additionalInformation: {
5308
+ readonly oneOf: readonly [{
5309
+ readonly type: "null";
5310
+ }, {
5311
+ readonly $ref: "#/components/schemas/InvoiceAdditionalInformation";
5312
+ }];
5313
+ };
5314
+ readonly currency: {
5315
+ readonly type: "string";
5316
+ readonly enum: readonly ["DOP"];
5317
+ readonly "x-timbro-submission-validation": readonly ["enum"];
5318
+ };
5319
+ readonly expectedTotals: {
5320
+ readonly oneOf: readonly [{
5321
+ readonly type: "null";
5322
+ }, {
5323
+ readonly $ref: "#/components/schemas/InvoiceExpectedTotals";
5324
+ }];
5325
+ };
5326
+ readonly externalOriginal: {
5327
+ readonly $ref: "#/components/schemas/InvoiceExternalOriginal";
5328
+ };
5329
+ readonly incomeType: {
5330
+ readonly oneOf: readonly [{
5331
+ readonly type: "null";
5332
+ }, {
5333
+ readonly type: "string";
5334
+ readonly enum: readonly ["01", "02", "03", "04", "05", "06"];
5335
+ readonly "x-timbro-submission-validation": readonly ["enum"];
5336
+ }];
5337
+ };
5338
+ readonly invoiceReference: {
5339
+ readonly type: "string";
5340
+ readonly description: "The only field a source-system reference travels in, bounded at 128 characters.";
5341
+ readonly maxLength: 128;
5342
+ readonly minLength: 1;
5343
+ readonly pattern: "^[^\\p{White_Space}](?:[\\s\\S]*[^\\p{White_Space}])?$";
5344
+ readonly "x-timbro-submission-validation": readonly ["minLength", "maxLength", "pattern"];
5345
+ };
5346
+ readonly items: {
5347
+ readonly type: "array";
5348
+ readonly items: {
5349
+ readonly $ref: "#/components/schemas/InvoiceItem";
5350
+ };
5351
+ readonly maxItems: 1000;
5352
+ readonly minItems: 1;
5353
+ readonly "x-timbro-submission-validation": readonly ["minItems", "maxItems"];
5354
+ };
5355
+ readonly modificationCode: {
5356
+ readonly $ref: "#/components/schemas/InvoiceDebitNoteModificationCode";
5357
+ };
5358
+ readonly numbering: {
5359
+ readonly oneOf: readonly [{
5360
+ readonly type: "null";
5361
+ }, {
5362
+ readonly $ref: "#/components/schemas/InvoiceNumbering";
5363
+ }];
5267
5364
  };
5268
5365
  readonly paymentTerms: {
5269
5366
  readonly $ref: "#/components/schemas/InvoicePaymentTerms";
@@ -5297,7 +5394,7 @@ export declare const invoiceApiContract: {
5297
5394
  readonly additionalProperties: false;
5298
5395
  }, {
5299
5396
  readonly type: "object";
5300
- readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "originalInvoiceId", "modificationCode", "reason", "type"];
5397
+ readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "modificationCode", "reason", "originalInvoiceId", "type"];
5301
5398
  readonly properties: {
5302
5399
  readonly additionalInformation: {
5303
5400
  readonly oneOf: readonly [{
@@ -5357,6 +5454,99 @@ export declare const invoiceApiContract: {
5357
5454
  readonly originalInvoiceId: {
5358
5455
  readonly type: "string";
5359
5456
  readonly format: "uuid";
5457
+ readonly description: "The Invoice Timbro issued that this note modifies. The note takes its buyer from that Invoice.";
5458
+ };
5459
+ readonly paymentTerms: {
5460
+ readonly $ref: "#/components/schemas/InvoiceCreditNotePaymentTerms";
5461
+ };
5462
+ readonly pdfLayout: {
5463
+ readonly oneOf: readonly [{
5464
+ readonly type: "null";
5465
+ }, {
5466
+ readonly $ref: "#/components/schemas/InvoicePdfLayout";
5467
+ }];
5468
+ };
5469
+ readonly reason: {
5470
+ readonly type: "string";
5471
+ readonly maxLength: 90;
5472
+ readonly minLength: 1;
5473
+ readonly pattern: "^[^\\p{White_Space}](?:[\\s\\S]*[^\\p{White_Space}])?$";
5474
+ readonly "x-timbro-submission-validation": readonly ["minLength", "maxLength", "pattern"];
5475
+ };
5476
+ readonly source: {
5477
+ readonly oneOf: readonly [{
5478
+ readonly type: "null";
5479
+ }, {
5480
+ readonly $ref: "#/components/schemas/InvoiceSourceInput";
5481
+ }];
5482
+ };
5483
+ readonly type: {
5484
+ readonly type: "string";
5485
+ readonly enum: readonly ["E34"];
5486
+ };
5487
+ };
5488
+ readonly additionalProperties: false;
5489
+ }, {
5490
+ readonly type: "object";
5491
+ readonly required: readonly ["invoiceReference", "currency", "paymentTerms", "items", "modificationCode", "reason", "externalOriginal", "type"];
5492
+ readonly properties: {
5493
+ readonly additionalInformation: {
5494
+ readonly oneOf: readonly [{
5495
+ readonly type: "null";
5496
+ }, {
5497
+ readonly $ref: "#/components/schemas/InvoiceAdditionalInformation";
5498
+ }];
5499
+ };
5500
+ readonly currency: {
5501
+ readonly type: "string";
5502
+ readonly enum: readonly ["DOP"];
5503
+ readonly "x-timbro-submission-validation": readonly ["enum"];
5504
+ };
5505
+ readonly expectedTotals: {
5506
+ readonly oneOf: readonly [{
5507
+ readonly type: "null";
5508
+ }, {
5509
+ readonly $ref: "#/components/schemas/InvoiceExpectedTotals";
5510
+ }];
5511
+ };
5512
+ readonly externalOriginal: {
5513
+ readonly $ref: "#/components/schemas/InvoiceExternalOriginal";
5514
+ };
5515
+ readonly incomeType: {
5516
+ readonly oneOf: readonly [{
5517
+ readonly type: "null";
5518
+ }, {
5519
+ readonly type: "string";
5520
+ readonly enum: readonly ["01", "02", "03", "04", "05", "06"];
5521
+ readonly "x-timbro-submission-validation": readonly ["enum"];
5522
+ }];
5523
+ };
5524
+ readonly invoiceReference: {
5525
+ readonly type: "string";
5526
+ readonly description: "The only field a source-system reference travels in, bounded at 128 characters.";
5527
+ readonly maxLength: 128;
5528
+ readonly minLength: 1;
5529
+ readonly pattern: "^[^\\p{White_Space}](?:[\\s\\S]*[^\\p{White_Space}])?$";
5530
+ readonly "x-timbro-submission-validation": readonly ["minLength", "maxLength", "pattern"];
5531
+ };
5532
+ readonly items: {
5533
+ readonly type: "array";
5534
+ readonly items: {
5535
+ readonly $ref: "#/components/schemas/InvoiceItem";
5536
+ };
5537
+ readonly maxItems: 10000;
5538
+ readonly minItems: 1;
5539
+ readonly "x-timbro-submission-validation": readonly ["minItems", "maxItems"];
5540
+ };
5541
+ readonly modificationCode: {
5542
+ readonly $ref: "#/components/schemas/InvoiceCreditNoteModificationCode";
5543
+ };
5544
+ readonly numbering: {
5545
+ readonly oneOf: readonly [{
5546
+ readonly type: "null";
5547
+ }, {
5548
+ readonly $ref: "#/components/schemas/InvoiceNumbering";
5549
+ }];
5360
5550
  };
5361
5551
  readonly paymentTerms: {
5362
5552
  readonly $ref: "#/components/schemas/InvoiceCreditNotePaymentTerms";
@@ -5389,9 +5579,6 @@ export declare const invoiceApiContract: {
5389
5579
  };
5390
5580
  readonly additionalProperties: false;
5391
5581
  }];
5392
- readonly discriminator: {
5393
- readonly propertyName: "type";
5394
- };
5395
5582
  };
5396
5583
  readonly InvoiceAdditionalInformation: {
5397
5584
  readonly type: "object";
@@ -5820,11 +6007,6 @@ export declare const invoiceApiContract: {
5820
6007
  };
5821
6008
  readonly additionalProperties: false;
5822
6009
  };
5823
- readonly SourceMeasurementUnit: {
5824
- readonly type: "string";
5825
- readonly description: "Common semantic measurement units mapped to official DGII catalog codes by fiscal-document.";
5826
- readonly enum: readonly ["unit", "kilogram", "litre", "metre", "piece"];
5827
- };
5828
6010
  readonly InvoiceNumbering: {
5829
6011
  readonly type: "object";
5830
6012
  readonly required: readonly ["eNcf"];
@@ -7012,6 +7194,53 @@ export declare const invoiceApiContract: {
7012
7194
  readonly type: "string";
7013
7195
  readonly enum: readonly ["2", "3"];
7014
7196
  };
7197
+ readonly InvoiceExternalOriginal: {
7198
+ readonly type: "object";
7199
+ readonly description: "A document issued outside Timbro that a legal note modifies.\n\n`fiscalNumber` is the original e-NCF (`E`, the two type digits, and ten digits) or paper NCF\n(`B` and ten digits, or `A` or `P` and eighteen digits). `issuerTaxId` is DGII's RNC Otro\nContribuyente and applies only when the original was issued under a different RNC than the\nnote, for example after a merger or split. `buyer` is the original's buyer and may be omitted\nfor an anonymous consumer document. `total` is the original's total and is required when the\noriginal is an e-CF type 32, because DGII requires the buyer's identity on a note against a\ntype 32 of DOP 250,000.00 or more.";
7200
+ readonly required: readonly ["fiscalNumber", "issuedOn"];
7201
+ readonly properties: {
7202
+ readonly buyer: {
7203
+ readonly oneOf: readonly [{
7204
+ readonly type: "null";
7205
+ }, {
7206
+ readonly $ref: "#/components/schemas/InvoiceConsumerBuyer";
7207
+ }];
7208
+ };
7209
+ readonly fiscalNumber: {
7210
+ readonly type: "string";
7211
+ readonly pattern: "^(B[0-9]{10}|E[0-9]{12}|[AP][0-9]{18})$";
7212
+ readonly "x-timbro-submission-validation": readonly ["pattern"];
7213
+ };
7214
+ readonly issuedOn: {
7215
+ readonly $ref: "#/components/schemas/InvoiceDate";
7216
+ };
7217
+ readonly issuerTaxId: {
7218
+ readonly oneOf: readonly [{
7219
+ readonly type: "null";
7220
+ }, {
7221
+ readonly type: "string";
7222
+ readonly pattern: "^[0-9]{9}([0-9]{2})?$";
7223
+ readonly "x-timbro-submission-validation": readonly ["pattern"];
7224
+ }];
7225
+ };
7226
+ readonly total: {
7227
+ readonly oneOf: readonly [{
7228
+ readonly type: "null";
7229
+ }, {
7230
+ readonly type: "string";
7231
+ readonly pattern: "^[0-9]{1,16}(\\.[0-9]{1,2})?$";
7232
+ readonly "x-timbro-submission-validation": readonly ["pattern"];
7233
+ }];
7234
+ };
7235
+ };
7236
+ readonly additionalProperties: false;
7237
+ };
7238
+ readonly InvoiceDate: {
7239
+ readonly type: "string";
7240
+ readonly format: "date";
7241
+ readonly description: "A calendar date in the public API's ISO 8601 date form.";
7242
+ readonly pattern: "^(19|20)[0-9]{2}-[0-9]{2}-[0-9]{2}$";
7243
+ };
7015
7244
  readonly InvoiceCreditNoteModificationCode: {
7016
7245
  readonly type: "string";
7017
7246
  readonly enum: readonly ["1", "2", "3"];