@stackforge-eu/factur-x 1.2.1 → 1.3.1
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/CHANGELOG.md +34 -1
- package/dist/index.cjs +14 -13
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -13
- package/package.json +2 -1
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B.xsd +0 -25
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_EDIFICAS-EU_AccountingAccountType_D11A.xsd +0 -18
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_EDIFICAS-EU_AccountingAmountType_D11A.xsd +0 -17
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd +0 -191
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_ISO_ISOTwo-letterCountryCode_SecondEdition2006.xsd +0 -260
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_QualifiedDataType_100.xsd +0 -818
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_ReusableAggregateBusinessInformationEntity_100.xsd +0 -6176
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_ActionCode_D22A.xsd +0 -130
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_AddressType_D22A.xsd +0 -19
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_AdjustmentReasonDescriptionCode_D22A.xsd +0 -116
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_AllowanceChargeIdentificationCode_D22A.xsd +0 -116
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_AllowanceChargeReasonCode_D22A.xsd +0 -116
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_AutomaticDataCaptureMethodCode_D22A.xsd +0 -21
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_CargoOperationalCategoryCode_D22A.xsd +0 -36
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_CargoTypeCode_1996Rev2Final.xsd +0 -20
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_CommodityIdentificationCode_D22A.xsd +0 -12
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_CommunicationMeansTypeCode_D22A.xsd +0 -58
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_ContactFunctionCode_D22A.xsd +0 -114
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DangerousGoodsPackingCode_D22A.xsd +0 -15
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DangerousGoodsRegulationCode_D22A.xsd +0 -35
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DateOnlyFormatCode_D21B.xsd +0 -21
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DeliveryTermsCode_2020.xsd +0 -24
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DeliveryTermsFunctionCode_D22A.xsd +0 -19
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DimensionTypeCode_D22A.xsd +0 -35
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DocumentNameCode_Accounting_D22A.xsd +0 -35
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DocumentNameCode_D22A.xsd +0 -819
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DocumentStatusCode_D22A.xsd +0 -61
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DutyTaxFeeTypeCode_D22A.xsd +0 -67
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_DutyorTaxorFeeCategoryCode_D22A.xsd +0 -33
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_EventTimeReferenceCodePaymentTermsEvent_D22A.xsd +0 -16
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_EventTimeReferenceCode_D22A.xsd +0 -76
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_FreightChargeQuantityUnitBasisCode_D22A.xsd +0 -12
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_FreightChargeTariffCode_D22A.xsd +0 -25
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_FreightCostCode_4.xsd +0 -1722
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_GoodsTypeCode_D22A.xsd +0 -12
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_GoodsTypeExtensionCode_D22A.xsd +0 -12
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_LocationFunctionCode_D22A.xsd +0 -326
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_MeasurementUnitCommonCodeLinear_4.xsd +0 -17
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_MeasurementUnitCommonCodeVolume_4.xsd +0 -18
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_MeasurementUnitCommonCodeWeight_4.xsd +0 -15
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_MessageFunctionCode_D22A.xsd +0 -84
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PackageTypeCode_2006.xsd +0 -416
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PackagingMarkingCode_D22A.xsd +0 -63
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PartyRoleCode_ChargePaying_D22A.xsd +0 -32
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PartyRoleCode_D22A.xsd +0 -635
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PaymentGuaranteeMeansCode_D22A.xsd +0 -23
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PaymentMeansChannelCode_D22A.xsd +0 -27
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PaymentMeansCode_D22A.xsd +0 -94
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PaymentTermsDescriptionIdentifier_D22A.xsd +0 -18
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PaymentTermsTypeCode_D22A.xsd +0 -90
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_PriceTypeCode_D22A.xsd +0 -50
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_ReferenceTypeCode_D22A.xsd +0 -828
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_SealConditionCode_D22A.xsd +0 -16
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_SealingPartyRoleCode_D22A.xsd +0 -18
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_StatusCode_D22A.xsd +0 -527
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_StatusDescriptionCode_AccountingDebitCredit_D22A.xsd +0 -18
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TimeOnlyFormatCode_D21B.xsd +0 -16
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TimePointFormatCode_D21B.xsd +0 -17
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportEquipmentCategoryCode_D22A.xsd +0 -107
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportEquipmentFullnessCode_D22A.xsd +0 -24
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportMeansTypeCode_2007.xsd +0 -145
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportModeCode_2.xsd +0 -21
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportMovementStageCode_D22A.xsd +0 -41
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UNECE_TransportPaymentArrangementCode_D22A.xsd +0 -15
- package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_UnqualifiedDataType_100.xsd +0 -144
package/CHANGELOG.md
CHANGED
|
@@ -7,10 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.1] — 2026-09-01
|
|
11
|
+
|
|
12
|
+
- **Dropped the unused `schema/cii-d22b/` code-list XSDs from the npm and JSR
|
|
13
|
+
packages** (~100 files, ~800 KB). Nothing references them at runtime — the
|
|
14
|
+
per-profile schema directories are self-contained. One of these files also
|
|
15
|
+
has a path longer than 100 characters, which a JSR server-side tar
|
|
16
|
+
regression truncated, breaking the 1.3.0 JSR publish.
|
|
17
|
+
- The release workflow now dry-runs `npm pack` and `deno publish` before
|
|
18
|
+
tagging, and publishes to npm only after JSR has succeeded — npm versions
|
|
19
|
+
are effectively immutable, so the unretractable registry ships last.
|
|
20
|
+
|
|
21
|
+
## [1.3.0] — 2026-09-01
|
|
22
|
+
|
|
23
|
+
- **Added item price base quantity (BT-149/BT-150).** New optional
|
|
24
|
+
`basisQuantity` and `basisQuantityUnitCode` fields on `InvoiceLineInput`
|
|
25
|
+
emit `ram:BasisQuantity` inside the net (and, when present, gross) price
|
|
26
|
+
element, so a unit price can state the quantity it refers to — e.g.
|
|
27
|
+
`12.50` per 10 m². The unit code defaults to the line's `unitCode`, as
|
|
28
|
+
EN 16931 requires BT-150 to match BT-130. Omitting the field keeps the
|
|
29
|
+
output byte-for-byte identical (#12).
|
|
30
|
+
- CI now requires every PR to add a `CHANGELOG.md` entry (or carry the
|
|
31
|
+
`skip-changelog` label), so contributor fixes always reach the release notes.
|
|
32
|
+
|
|
10
33
|
## [1.2.1] — 2026-08-27
|
|
11
34
|
|
|
35
|
+
- **Fixed XSD validation on Windows.** Schema `<xsd:import>` resolution built a
|
|
36
|
+
malformed `file://` URL from backslash paths and keyed the schema lookup by
|
|
37
|
+
a percent-encoded href that libxml2 normalises differently. Now uses
|
|
38
|
+
`pathToFileURL()` and matches imported schemas by filename. Windows added
|
|
39
|
+
to the CI matrix (thanks @muratkorkmaztr-cmyk, #6).
|
|
40
|
+
- **Embedded `factur-x.xml` now uses the `application/xml` MIME type** instead
|
|
41
|
+
of the deprecated `text/xml` (RFC 7303), which current Factur-X conformance
|
|
42
|
+
checkers flag (thanks @muratkorkmaztr-cmyk, #7).
|
|
12
43
|
- Expanded npm `keywords` (e.g. `e-rechnung`, `pdfa`, `chorus-pro`, `un-cefact`,
|
|
13
|
-
spelling variants) so the package is easier to find on npm
|
|
44
|
+
spelling variants) so the package is easier to find on npm (#8).
|
|
14
45
|
|
|
15
46
|
## [1.2.0] — 2026-07-11
|
|
16
47
|
|
|
@@ -204,6 +235,8 @@ This element is not expected`. Reordered the three blocks in
|
|
|
204
235
|
- Deno compatibility test suite
|
|
205
236
|
|
|
206
237
|
[Unreleased]: https://github.com/StackForge-EU/factur-x/commits/main
|
|
238
|
+
[1.3.1]: https://github.com/StackForge-EU/factur-x/compare/v1.3.0...v1.3.1
|
|
239
|
+
[1.3.0]: https://github.com/StackForge-EU/factur-x/compare/v1.2.1...v1.3.0
|
|
207
240
|
[1.2.1]: https://github.com/StackForge-EU/factur-x/compare/v1.2.0...v1.2.1
|
|
208
241
|
[1.2.0]: https://github.com/StackForge-EU/factur-x/compare/v1.1.0...v1.2.0
|
|
209
242
|
[1.1.0]: https://github.com/StackForge-EU/factur-x/compare/v1.0.8...v1.1.0
|
package/dist/index.cjs
CHANGED
|
@@ -402,13 +402,19 @@ function buildLineItem(line, profile) {
|
|
|
402
402
|
"ram:BuyerOrderReferencedDocument",
|
|
403
403
|
tag("ram:LineID", escapeXml(line.buyerOrderLineId))
|
|
404
404
|
);
|
|
405
|
+
const unitCode = line.unitCode ?? "C62" /* UNIT */;
|
|
406
|
+
const basisQuantity = line.basisQuantity !== void 0 ? tag("ram:BasisQuantity", line.basisQuantity.toString(), {
|
|
407
|
+
unitCode: line.basisQuantityUnitCode ?? unitCode
|
|
408
|
+
}) : "";
|
|
405
409
|
if (line.grossUnitPrice !== void 0)
|
|
406
410
|
agree += tag(
|
|
407
411
|
"ram:GrossPriceProductTradePrice",
|
|
408
|
-
tag("ram:ChargeAmount", fmtAmt(line.grossUnitPrice))
|
|
412
|
+
tag("ram:ChargeAmount", fmtAmt(line.grossUnitPrice)) + basisQuantity
|
|
409
413
|
);
|
|
410
|
-
agree += tag(
|
|
411
|
-
|
|
414
|
+
agree += tag(
|
|
415
|
+
"ram:NetPriceProductTradePrice",
|
|
416
|
+
tag("ram:ChargeAmount", fmtAmt(line.unitPrice)) + basisQuantity
|
|
417
|
+
);
|
|
412
418
|
const delivery = tag("ram:BilledQuantity", line.quantity.toString(), {
|
|
413
419
|
unitCode
|
|
414
420
|
});
|
|
@@ -509,10 +515,7 @@ function buildXml(input, profile, flavor) {
|
|
|
509
515
|
tag("ram:ID", escapeXml(doc.businessProcessId))
|
|
510
516
|
);
|
|
511
517
|
const profileUrn = fl === "xrechnung" /* XRECHNUNG */ ? XRECHNUNG_PROFILE_URN : PROFILE_URNS[profile];
|
|
512
|
-
ctx += tag(
|
|
513
|
-
"ram:GuidelineSpecifiedDocumentContextParameter",
|
|
514
|
-
tag("ram:ID", profileUrn)
|
|
515
|
-
);
|
|
518
|
+
ctx += tag("ram:GuidelineSpecifiedDocumentContextParameter", tag("ram:ID", profileUrn));
|
|
516
519
|
let edoc = tag("ram:ID", escapeXml(doc.id));
|
|
517
520
|
if (doc.name && atLeast(profile, "EXTENDED" /* EXTENDED */)) edoc += tag("ram:Name", escapeXml(doc.name));
|
|
518
521
|
edoc += tag("ram:TypeCode", typeCode);
|
|
@@ -1178,7 +1181,9 @@ function resolveXmpConformanceLevel(profile, flavor) {
|
|
|
1178
1181
|
}
|
|
1179
1182
|
function ensureIdTrailer(pdfDoc, pdfContentBytes) {
|
|
1180
1183
|
const existingIdTrailer = pdfDoc.context.trailerInfo.ID;
|
|
1181
|
-
const currentContentHash = pdfLib.PDFHexString.of(
|
|
1184
|
+
const currentContentHash = pdfLib.PDFHexString.of(
|
|
1185
|
+
crypto.createHash("md5").update(pdfContentBytes).digest("hex")
|
|
1186
|
+
);
|
|
1182
1187
|
const hasValidIdTrailer = existingIdTrailer instanceof pdfLib.PDFArray && existingIdTrailer.size() === 2;
|
|
1183
1188
|
if (hasValidIdTrailer) {
|
|
1184
1189
|
const existingFirstId = existingIdTrailer.lookup(0);
|
|
@@ -1207,11 +1212,7 @@ function ensureOutputIntent(pdfDoc, iccBytes, identifier) {
|
|
|
1207
1212
|
function findUnembeddedFonts(pdfDoc) {
|
|
1208
1213
|
const seen = /* @__PURE__ */ new Set();
|
|
1209
1214
|
const unembedded = /* @__PURE__ */ new Set();
|
|
1210
|
-
const FONT_FILE_KEYS = [
|
|
1211
|
-
pdfLib.PDFName.of("FontFile"),
|
|
1212
|
-
pdfLib.PDFName.of("FontFile2"),
|
|
1213
|
-
pdfLib.PDFName.of("FontFile3")
|
|
1214
|
-
];
|
|
1215
|
+
const FONT_FILE_KEYS = [pdfLib.PDFName.of("FontFile"), pdfLib.PDFName.of("FontFile2"), pdfLib.PDFName.of("FontFile3")];
|
|
1215
1216
|
const inspectFontDict = (font) => {
|
|
1216
1217
|
const subtype = font.lookup(pdfLib.PDFName.of("Subtype"));
|
|
1217
1218
|
const baseFont = font.lookup(pdfLib.PDFName.of("BaseFont"));
|
package/dist/index.d.cts
CHANGED
|
@@ -573,6 +573,20 @@ interface InvoiceLineInput {
|
|
|
573
573
|
* @see EN 16931 BT-148
|
|
574
574
|
*/
|
|
575
575
|
grossUnitPrice?: number;
|
|
576
|
+
/**
|
|
577
|
+
* Item price base quantity — the quantity the unit price (BT-146)
|
|
578
|
+
* applies to, e.g. a price per 10 square metres or per 1000 prints.
|
|
579
|
+
* @see EN 16931 BT-149
|
|
580
|
+
*/
|
|
581
|
+
basisQuantity?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Unit of measure for `basisQuantity` (UN/CEFACT Rec 20).
|
|
584
|
+
*
|
|
585
|
+
* @default the line's `unitCode` when omitted, as EN 16931 requires
|
|
586
|
+
* BT-150 to match the invoiced quantity's unit (BT-130)
|
|
587
|
+
* @see EN 16931 BT-150
|
|
588
|
+
*/
|
|
589
|
+
basisQuantityUnitCode?: UnitCode | (string & Record<never, never>);
|
|
576
590
|
/**
|
|
577
591
|
* Line total (net) — can be derived from `quantity * unitPrice`.
|
|
578
592
|
* @see EN 16931 BT-131
|
package/dist/index.d.ts
CHANGED
|
@@ -573,6 +573,20 @@ interface InvoiceLineInput {
|
|
|
573
573
|
* @see EN 16931 BT-148
|
|
574
574
|
*/
|
|
575
575
|
grossUnitPrice?: number;
|
|
576
|
+
/**
|
|
577
|
+
* Item price base quantity — the quantity the unit price (BT-146)
|
|
578
|
+
* applies to, e.g. a price per 10 square metres or per 1000 prints.
|
|
579
|
+
* @see EN 16931 BT-149
|
|
580
|
+
*/
|
|
581
|
+
basisQuantity?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Unit of measure for `basisQuantity` (UN/CEFACT Rec 20).
|
|
584
|
+
*
|
|
585
|
+
* @default the line's `unitCode` when omitted, as EN 16931 requires
|
|
586
|
+
* BT-150 to match the invoiced quantity's unit (BT-130)
|
|
587
|
+
* @see EN 16931 BT-150
|
|
588
|
+
*/
|
|
589
|
+
basisQuantityUnitCode?: UnitCode | (string & Record<never, never>);
|
|
576
590
|
/**
|
|
577
591
|
* Line total (net) — can be derived from `quantity * unitPrice`.
|
|
578
592
|
* @see EN 16931 BT-131
|
package/dist/index.js
CHANGED
|
@@ -372,13 +372,19 @@ function buildLineItem(line, profile) {
|
|
|
372
372
|
"ram:BuyerOrderReferencedDocument",
|
|
373
373
|
tag("ram:LineID", escapeXml(line.buyerOrderLineId))
|
|
374
374
|
);
|
|
375
|
+
const unitCode = line.unitCode ?? "C62" /* UNIT */;
|
|
376
|
+
const basisQuantity = line.basisQuantity !== void 0 ? tag("ram:BasisQuantity", line.basisQuantity.toString(), {
|
|
377
|
+
unitCode: line.basisQuantityUnitCode ?? unitCode
|
|
378
|
+
}) : "";
|
|
375
379
|
if (line.grossUnitPrice !== void 0)
|
|
376
380
|
agree += tag(
|
|
377
381
|
"ram:GrossPriceProductTradePrice",
|
|
378
|
-
tag("ram:ChargeAmount", fmtAmt(line.grossUnitPrice))
|
|
382
|
+
tag("ram:ChargeAmount", fmtAmt(line.grossUnitPrice)) + basisQuantity
|
|
379
383
|
);
|
|
380
|
-
agree += tag(
|
|
381
|
-
|
|
384
|
+
agree += tag(
|
|
385
|
+
"ram:NetPriceProductTradePrice",
|
|
386
|
+
tag("ram:ChargeAmount", fmtAmt(line.unitPrice)) + basisQuantity
|
|
387
|
+
);
|
|
382
388
|
const delivery = tag("ram:BilledQuantity", line.quantity.toString(), {
|
|
383
389
|
unitCode
|
|
384
390
|
});
|
|
@@ -479,10 +485,7 @@ function buildXml(input, profile, flavor) {
|
|
|
479
485
|
tag("ram:ID", escapeXml(doc.businessProcessId))
|
|
480
486
|
);
|
|
481
487
|
const profileUrn = fl === "xrechnung" /* XRECHNUNG */ ? XRECHNUNG_PROFILE_URN : PROFILE_URNS[profile];
|
|
482
|
-
ctx += tag(
|
|
483
|
-
"ram:GuidelineSpecifiedDocumentContextParameter",
|
|
484
|
-
tag("ram:ID", profileUrn)
|
|
485
|
-
);
|
|
488
|
+
ctx += tag("ram:GuidelineSpecifiedDocumentContextParameter", tag("ram:ID", profileUrn));
|
|
486
489
|
let edoc = tag("ram:ID", escapeXml(doc.id));
|
|
487
490
|
if (doc.name && atLeast(profile, "EXTENDED" /* EXTENDED */)) edoc += tag("ram:Name", escapeXml(doc.name));
|
|
488
491
|
edoc += tag("ram:TypeCode", typeCode);
|
|
@@ -1148,7 +1151,9 @@ function resolveXmpConformanceLevel(profile, flavor) {
|
|
|
1148
1151
|
}
|
|
1149
1152
|
function ensureIdTrailer(pdfDoc, pdfContentBytes) {
|
|
1150
1153
|
const existingIdTrailer = pdfDoc.context.trailerInfo.ID;
|
|
1151
|
-
const currentContentHash = PDFHexString.of(
|
|
1154
|
+
const currentContentHash = PDFHexString.of(
|
|
1155
|
+
createHash("md5").update(pdfContentBytes).digest("hex")
|
|
1156
|
+
);
|
|
1152
1157
|
const hasValidIdTrailer = existingIdTrailer instanceof PDFArray && existingIdTrailer.size() === 2;
|
|
1153
1158
|
if (hasValidIdTrailer) {
|
|
1154
1159
|
const existingFirstId = existingIdTrailer.lookup(0);
|
|
@@ -1177,11 +1182,7 @@ function ensureOutputIntent(pdfDoc, iccBytes, identifier) {
|
|
|
1177
1182
|
function findUnembeddedFonts(pdfDoc) {
|
|
1178
1183
|
const seen = /* @__PURE__ */ new Set();
|
|
1179
1184
|
const unembedded = /* @__PURE__ */ new Set();
|
|
1180
|
-
const FONT_FILE_KEYS = [
|
|
1181
|
-
PDFName.of("FontFile"),
|
|
1182
|
-
PDFName.of("FontFile2"),
|
|
1183
|
-
PDFName.of("FontFile3")
|
|
1184
|
-
];
|
|
1185
|
+
const FONT_FILE_KEYS = [PDFName.of("FontFile"), PDFName.of("FontFile2"), PDFName.of("FontFile3")];
|
|
1185
1186
|
const inspectFontDict = (font) => {
|
|
1186
1187
|
const subtype = font.lookup(PDFName.of("Subtype"));
|
|
1187
1188
|
const baseFont = font.lookup(PDFName.of("BaseFont"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackforge-eu/factur-x",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Embed Factur-X, ZUGFeRD, and XRechnung structured invoice XML into PDF/A-3 documents",
|
|
6
6
|
"keywords": [
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"files": [
|
|
65
65
|
"dist",
|
|
66
66
|
"schema/**/*.xsd",
|
|
67
|
+
"!schema/cii-d22b",
|
|
67
68
|
"schema/README.md",
|
|
68
69
|
"README.md",
|
|
69
70
|
"LICENSE",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
|
3
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
4
|
-
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
|
5
|
-
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
|
6
|
-
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
|
7
|
-
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
|
8
|
-
elementFormDefault="qualified"
|
|
9
|
-
version="100.D22B">
|
|
10
|
-
<xsd:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="CrossIndustryInvoice_100pD22B_QualifiedDataType_100.xsd"/>
|
|
11
|
-
<xsd:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="CrossIndustryInvoice_100pD22B_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
|
12
|
-
<xsd:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="CrossIndustryInvoice_100pD22B_UnqualifiedDataType_100.xsd"/>
|
|
13
|
-
<xsd:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
|
14
|
-
<xsd:complexType name="CrossIndustryInvoiceType">
|
|
15
|
-
<xsd:annotation>
|
|
16
|
-
<xsd:documentation source="BN/BN">Cross Industry Invoice</xsd:documentation>
|
|
17
|
-
</xsd:annotation>
|
|
18
|
-
<xsd:sequence>
|
|
19
|
-
<xsd:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
|
20
|
-
<xsd:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
|
21
|
-
<xsd:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
|
22
|
-
<xsd:element name="ValuationBreakdownStatement" type="ram:ValuationBreakdownStatementType" minOccurs="0"/>
|
|
23
|
-
</xsd:sequence>
|
|
24
|
-
</xsd:complexType>
|
|
25
|
-
</xsd:schema>
|
package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_EDIFICAS-EU_AccountingAccountType_D11A.xsd
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema xmlns:clm210AccountingE501="urn:un:unece:uncefact:codelist:standard:EDIFICAS-EU:AccountingAccountType:D11A"
|
|
3
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
4
|
-
targetNamespace="urn:un:unece:uncefact:codelist:standard:EDIFICAS-EU:AccountingAccountType:D11A"
|
|
5
|
-
elementFormDefault="qualified"
|
|
6
|
-
version="1.0">
|
|
7
|
-
<xsd:simpleType name="AccountingAccountTypeContentType">
|
|
8
|
-
<xsd:restriction base="xsd:token">
|
|
9
|
-
<xsd:enumeration value="1"/>
|
|
10
|
-
<xsd:enumeration value="2"/>
|
|
11
|
-
<xsd:enumeration value="3"/>
|
|
12
|
-
<xsd:enumeration value="4"/>
|
|
13
|
-
<xsd:enumeration value="5"/>
|
|
14
|
-
<xsd:enumeration value="6"/>
|
|
15
|
-
<xsd:enumeration value="7"/>
|
|
16
|
-
</xsd:restriction>
|
|
17
|
-
</xsd:simpleType>
|
|
18
|
-
</xsd:schema>
|
package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_EDIFICAS-EU_AccountingAmountType_D11A.xsd
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema xmlns:clm210AccountingE601="urn:un:unece:uncefact:codelist:standard:EDIFICAS-EU:AccountingAmountType:D11A"
|
|
3
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
4
|
-
targetNamespace="urn:un:unece:uncefact:codelist:standard:EDIFICAS-EU:AccountingAmountType:D11A"
|
|
5
|
-
elementFormDefault="qualified"
|
|
6
|
-
version="1.0">
|
|
7
|
-
<xsd:simpleType name="AccountingAmountTypeContentType">
|
|
8
|
-
<xsd:restriction base="xsd:token">
|
|
9
|
-
<xsd:enumeration value="1"/>
|
|
10
|
-
<xsd:enumeration value="2"/>
|
|
11
|
-
<xsd:enumeration value="3"/>
|
|
12
|
-
<xsd:enumeration value="4"/>
|
|
13
|
-
<xsd:enumeration value="5"/>
|
|
14
|
-
<xsd:enumeration value="6"/>
|
|
15
|
-
</xsd:restriction>
|
|
16
|
-
</xsd:simpleType>
|
|
17
|
-
</xsd:schema>
|
package/schema/cii-d22b/CrossIndustryInvoice_100pD22B_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema xmlns:clm5ISO42173A="urn:un:unece:uncefact:codelist:standard:ISO:ISO3AlphaCurrencyCode:2012-08-31"
|
|
3
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
4
|
-
targetNamespace="urn:un:unece:uncefact:codelist:standard:ISO:ISO3AlphaCurrencyCode:2012-08-31"
|
|
5
|
-
elementFormDefault="qualified"
|
|
6
|
-
version="11.11">
|
|
7
|
-
<xsd:simpleType name="ISO3AlphaCurrencyCodeContentType">
|
|
8
|
-
<xsd:restriction base="xsd:token">
|
|
9
|
-
<xsd:enumeration value="AED"/>
|
|
10
|
-
<xsd:enumeration value="AFN"/>
|
|
11
|
-
<xsd:enumeration value="ALL"/>
|
|
12
|
-
<xsd:enumeration value="AMD"/>
|
|
13
|
-
<xsd:enumeration value="ANG"/>
|
|
14
|
-
<xsd:enumeration value="AOA"/>
|
|
15
|
-
<xsd:enumeration value="ARS"/>
|
|
16
|
-
<xsd:enumeration value="AUD"/>
|
|
17
|
-
<xsd:enumeration value="AWG"/>
|
|
18
|
-
<xsd:enumeration value="AZN"/>
|
|
19
|
-
<xsd:enumeration value="BAM"/>
|
|
20
|
-
<xsd:enumeration value="BBD"/>
|
|
21
|
-
<xsd:enumeration value="BDT"/>
|
|
22
|
-
<xsd:enumeration value="BGN"/>
|
|
23
|
-
<xsd:enumeration value="BHD"/>
|
|
24
|
-
<xsd:enumeration value="BIF"/>
|
|
25
|
-
<xsd:enumeration value="BMD"/>
|
|
26
|
-
<xsd:enumeration value="BND"/>
|
|
27
|
-
<xsd:enumeration value="BOB"/>
|
|
28
|
-
<xsd:enumeration value="BOV"/>
|
|
29
|
-
<xsd:enumeration value="BRL"/>
|
|
30
|
-
<xsd:enumeration value="BSD"/>
|
|
31
|
-
<xsd:enumeration value="BTN"/>
|
|
32
|
-
<xsd:enumeration value="BWP"/>
|
|
33
|
-
<xsd:enumeration value="BYN"/>
|
|
34
|
-
<xsd:enumeration value="BZD"/>
|
|
35
|
-
<xsd:enumeration value="CAD"/>
|
|
36
|
-
<xsd:enumeration value="CDF"/>
|
|
37
|
-
<xsd:enumeration value="CHE"/>
|
|
38
|
-
<xsd:enumeration value="CHF"/>
|
|
39
|
-
<xsd:enumeration value="CHW"/>
|
|
40
|
-
<xsd:enumeration value="CLF"/>
|
|
41
|
-
<xsd:enumeration value="CLP"/>
|
|
42
|
-
<xsd:enumeration value="CNY"/>
|
|
43
|
-
<xsd:enumeration value="COP"/>
|
|
44
|
-
<xsd:enumeration value="COU"/>
|
|
45
|
-
<xsd:enumeration value="CRC"/>
|
|
46
|
-
<xsd:enumeration value="CUC"/>
|
|
47
|
-
<xsd:enumeration value="CUP"/>
|
|
48
|
-
<xsd:enumeration value="CVE"/>
|
|
49
|
-
<xsd:enumeration value="CZK"/>
|
|
50
|
-
<xsd:enumeration value="DJF"/>
|
|
51
|
-
<xsd:enumeration value="DKK"/>
|
|
52
|
-
<xsd:enumeration value="DOP"/>
|
|
53
|
-
<xsd:enumeration value="DZD"/>
|
|
54
|
-
<xsd:enumeration value="EGP"/>
|
|
55
|
-
<xsd:enumeration value="ERN"/>
|
|
56
|
-
<xsd:enumeration value="ETB"/>
|
|
57
|
-
<xsd:enumeration value="EUR"/>
|
|
58
|
-
<xsd:enumeration value="FJD"/>
|
|
59
|
-
<xsd:enumeration value="FKP"/>
|
|
60
|
-
<xsd:enumeration value="GBP"/>
|
|
61
|
-
<xsd:enumeration value="GEL"/>
|
|
62
|
-
<xsd:enumeration value="GHS"/>
|
|
63
|
-
<xsd:enumeration value="GIP"/>
|
|
64
|
-
<xsd:enumeration value="GMD"/>
|
|
65
|
-
<xsd:enumeration value="GNF"/>
|
|
66
|
-
<xsd:enumeration value="GTQ"/>
|
|
67
|
-
<xsd:enumeration value="GYD"/>
|
|
68
|
-
<xsd:enumeration value="HKD"/>
|
|
69
|
-
<xsd:enumeration value="HNL"/>
|
|
70
|
-
<xsd:enumeration value="HRK"/>
|
|
71
|
-
<xsd:enumeration value="HTG"/>
|
|
72
|
-
<xsd:enumeration value="HUF"/>
|
|
73
|
-
<xsd:enumeration value="IDR"/>
|
|
74
|
-
<xsd:enumeration value="ILS"/>
|
|
75
|
-
<xsd:enumeration value="INR"/>
|
|
76
|
-
<xsd:enumeration value="IQD"/>
|
|
77
|
-
<xsd:enumeration value="IRR"/>
|
|
78
|
-
<xsd:enumeration value="ISK"/>
|
|
79
|
-
<xsd:enumeration value="JMD"/>
|
|
80
|
-
<xsd:enumeration value="JOD"/>
|
|
81
|
-
<xsd:enumeration value="JPY"/>
|
|
82
|
-
<xsd:enumeration value="KES"/>
|
|
83
|
-
<xsd:enumeration value="KGS"/>
|
|
84
|
-
<xsd:enumeration value="KHR"/>
|
|
85
|
-
<xsd:enumeration value="KMF"/>
|
|
86
|
-
<xsd:enumeration value="KPW"/>
|
|
87
|
-
<xsd:enumeration value="KRW"/>
|
|
88
|
-
<xsd:enumeration value="KWD"/>
|
|
89
|
-
<xsd:enumeration value="KYD"/>
|
|
90
|
-
<xsd:enumeration value="KZT"/>
|
|
91
|
-
<xsd:enumeration value="LAK"/>
|
|
92
|
-
<xsd:enumeration value="LBP"/>
|
|
93
|
-
<xsd:enumeration value="LKR"/>
|
|
94
|
-
<xsd:enumeration value="LRD"/>
|
|
95
|
-
<xsd:enumeration value="LSL"/>
|
|
96
|
-
<xsd:enumeration value="LYD"/>
|
|
97
|
-
<xsd:enumeration value="MAD"/>
|
|
98
|
-
<xsd:enumeration value="MDL"/>
|
|
99
|
-
<xsd:enumeration value="MGA"/>
|
|
100
|
-
<xsd:enumeration value="MKD"/>
|
|
101
|
-
<xsd:enumeration value="MMK"/>
|
|
102
|
-
<xsd:enumeration value="MNT"/>
|
|
103
|
-
<xsd:enumeration value="MOP"/>
|
|
104
|
-
<xsd:enumeration value="MRU"/>
|
|
105
|
-
<xsd:enumeration value="MUR"/>
|
|
106
|
-
<xsd:enumeration value="MVR"/>
|
|
107
|
-
<xsd:enumeration value="MWK"/>
|
|
108
|
-
<xsd:enumeration value="MXN"/>
|
|
109
|
-
<xsd:enumeration value="MXV"/>
|
|
110
|
-
<xsd:enumeration value="MYR"/>
|
|
111
|
-
<xsd:enumeration value="MZN"/>
|
|
112
|
-
<xsd:enumeration value="NAD"/>
|
|
113
|
-
<xsd:enumeration value="NGN"/>
|
|
114
|
-
<xsd:enumeration value="NIO"/>
|
|
115
|
-
<xsd:enumeration value="NOK"/>
|
|
116
|
-
<xsd:enumeration value="NPR"/>
|
|
117
|
-
<xsd:enumeration value="NZD"/>
|
|
118
|
-
<xsd:enumeration value="OMR"/>
|
|
119
|
-
<xsd:enumeration value="PAB"/>
|
|
120
|
-
<xsd:enumeration value="PEN"/>
|
|
121
|
-
<xsd:enumeration value="PGK"/>
|
|
122
|
-
<xsd:enumeration value="PHP"/>
|
|
123
|
-
<xsd:enumeration value="PKR"/>
|
|
124
|
-
<xsd:enumeration value="PLN"/>
|
|
125
|
-
<xsd:enumeration value="PYG"/>
|
|
126
|
-
<xsd:enumeration value="QAR"/>
|
|
127
|
-
<xsd:enumeration value="RON"/>
|
|
128
|
-
<xsd:enumeration value="RSD"/>
|
|
129
|
-
<xsd:enumeration value="RUB"/>
|
|
130
|
-
<xsd:enumeration value="RWF"/>
|
|
131
|
-
<xsd:enumeration value="SAR"/>
|
|
132
|
-
<xsd:enumeration value="SBD"/>
|
|
133
|
-
<xsd:enumeration value="SCR"/>
|
|
134
|
-
<xsd:enumeration value="SDG"/>
|
|
135
|
-
<xsd:enumeration value="SEK"/>
|
|
136
|
-
<xsd:enumeration value="SGD"/>
|
|
137
|
-
<xsd:enumeration value="SHP"/>
|
|
138
|
-
<xsd:enumeration value="SLE"/>
|
|
139
|
-
<xsd:enumeration value="SOS"/>
|
|
140
|
-
<xsd:enumeration value="SRD"/>
|
|
141
|
-
<xsd:enumeration value="SSP"/>
|
|
142
|
-
<xsd:enumeration value="STN"/>
|
|
143
|
-
<xsd:enumeration value="SVC"/>
|
|
144
|
-
<xsd:enumeration value="SYP"/>
|
|
145
|
-
<xsd:enumeration value="SZL"/>
|
|
146
|
-
<xsd:enumeration value="THB"/>
|
|
147
|
-
<xsd:enumeration value="TJS"/>
|
|
148
|
-
<xsd:enumeration value="TMT"/>
|
|
149
|
-
<xsd:enumeration value="TND"/>
|
|
150
|
-
<xsd:enumeration value="TOP"/>
|
|
151
|
-
<xsd:enumeration value="TRY"/>
|
|
152
|
-
<xsd:enumeration value="TTD"/>
|
|
153
|
-
<xsd:enumeration value="TWD"/>
|
|
154
|
-
<xsd:enumeration value="TZS"/>
|
|
155
|
-
<xsd:enumeration value="UAH"/>
|
|
156
|
-
<xsd:enumeration value="UGX"/>
|
|
157
|
-
<xsd:enumeration value="USD"/>
|
|
158
|
-
<xsd:enumeration value="USN"/>
|
|
159
|
-
<xsd:enumeration value="UYI"/>
|
|
160
|
-
<xsd:enumeration value="UYU"/>
|
|
161
|
-
<xsd:enumeration value="UYW"/>
|
|
162
|
-
<xsd:enumeration value="UZS"/>
|
|
163
|
-
<xsd:enumeration value="VED"/>
|
|
164
|
-
<xsd:enumeration value="VES"/>
|
|
165
|
-
<xsd:enumeration value="VND"/>
|
|
166
|
-
<xsd:enumeration value="VUV"/>
|
|
167
|
-
<xsd:enumeration value="WST"/>
|
|
168
|
-
<xsd:enumeration value="XAF"/>
|
|
169
|
-
<xsd:enumeration value="XAG"/>
|
|
170
|
-
<xsd:enumeration value="XAU"/>
|
|
171
|
-
<xsd:enumeration value="XBA"/>
|
|
172
|
-
<xsd:enumeration value="XBB"/>
|
|
173
|
-
<xsd:enumeration value="XBC"/>
|
|
174
|
-
<xsd:enumeration value="XBD"/>
|
|
175
|
-
<xsd:enumeration value="XCD"/>
|
|
176
|
-
<xsd:enumeration value="XDR"/>
|
|
177
|
-
<xsd:enumeration value="XOF"/>
|
|
178
|
-
<xsd:enumeration value="XPD"/>
|
|
179
|
-
<xsd:enumeration value="XPF"/>
|
|
180
|
-
<xsd:enumeration value="XPT"/>
|
|
181
|
-
<xsd:enumeration value="XSU"/>
|
|
182
|
-
<xsd:enumeration value="XTS"/>
|
|
183
|
-
<xsd:enumeration value="XUA"/>
|
|
184
|
-
<xsd:enumeration value="XXX"/>
|
|
185
|
-
<xsd:enumeration value="YER"/>
|
|
186
|
-
<xsd:enumeration value="ZAR"/>
|
|
187
|
-
<xsd:enumeration value="ZMW"/>
|
|
188
|
-
<xsd:enumeration value="ZWL"/>
|
|
189
|
-
</xsd:restriction>
|
|
190
|
-
</xsd:simpleType>
|
|
191
|
-
</xsd:schema>
|