@stackforge-eu/factur-x 1.4.5 → 1.4.6

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 CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.6] — 2026-11-14
11
+
12
+ - **Fixed MINIMUM XML failing XSD validation when optional party fields are
13
+ set.** `buildXml` wrote a party's `id`, `globalId`,
14
+ `legalOrganization.tradingName` and `electronicAddress` in every profile,
15
+ but the MINIMUM schema allows none of them. They are now dropped for
16
+ MINIMUM, like `address` and `contact` already were, and still written from
17
+ BASIC WL upwards (#28).
18
+
10
19
  ## [1.4.5] — 2026-11-14
11
20
 
12
21
  - **Fixed derived line net amount ignoring `basisQuantity`.** When a line
@@ -301,6 +310,7 @@ This element is not expected`. Reordered the three blocks in
301
310
  - Deno compatibility test suite
302
311
 
303
312
  [Unreleased]: https://github.com/StackForge-EU/factur-x/commits/main
313
+ [1.4.6]: https://github.com/StackForge-EU/factur-x/compare/v1.4.5...v1.4.6
304
314
  [1.4.5]: https://github.com/StackForge-EU/factur-x/compare/v1.4.4...v1.4.5
305
315
  [1.4.4]: https://github.com/StackForge-EU/factur-x/compare/v1.4.3...v1.4.4
306
316
  [1.4.3]: https://github.com/StackForge-EU/factur-x/compare/v1.4.2...v1.4.3
package/dist/index.cjs CHANGED
@@ -355,11 +355,12 @@ function buildContact(c) {
355
355
  }
356
356
  function buildParty(p, profile) {
357
357
  let x = "";
358
- if (p.id) {
358
+ const beyondMinimum = atLeast(profile, "BASIC_WL" /* BASIC_WL */);
359
+ if (p.id && beyondMinimum) {
359
360
  const ids = Array.isArray(p.id) ? p.id : [p.id];
360
361
  for (const id of ids) x += tag("ram:ID", escapeXml(id));
361
362
  }
362
- if (p.globalId) {
363
+ if (p.globalId && beyondMinimum) {
363
364
  x += tag("ram:GlobalID", escapeXml(p.globalId.value), { schemeID: p.globalId.schemeID });
364
365
  }
365
366
  x += tag("ram:Name", escapeXml(p.name));
@@ -374,13 +375,13 @@ function buildParty(p, profile) {
374
375
  p.legalOrganization.schemeID ? { schemeID: p.legalOrganization.schemeID } : void 0
375
376
  );
376
377
  }
377
- if (p.legalOrganization.tradingName)
378
+ if (p.legalOrganization.tradingName && beyondMinimum)
378
379
  lo += tag("ram:TradingBusinessName", escapeXml(p.legalOrganization.tradingName));
379
380
  x += tag("ram:SpecifiedLegalOrganization", lo);
380
381
  }
381
382
  if (p.contact && atLeast(profile, "EN16931" /* EN16931 */)) x += buildContact(p.contact);
382
- if (p.address && atLeast(profile, "BASIC_WL" /* BASIC_WL */)) x += buildAddress(p.address);
383
- if (p.electronicAddress)
383
+ if (p.address && beyondMinimum) x += buildAddress(p.address);
384
+ if (p.electronicAddress && beyondMinimum)
384
385
  x += tag(
385
386
  "ram:URIUniversalCommunication",
386
387
  tag("ram:URIID", escapeXml(p.electronicAddress.value), {
package/dist/index.js CHANGED
@@ -325,11 +325,12 @@ function buildContact(c) {
325
325
  }
326
326
  function buildParty(p, profile) {
327
327
  let x = "";
328
- if (p.id) {
328
+ const beyondMinimum = atLeast(profile, "BASIC_WL" /* BASIC_WL */);
329
+ if (p.id && beyondMinimum) {
329
330
  const ids = Array.isArray(p.id) ? p.id : [p.id];
330
331
  for (const id of ids) x += tag("ram:ID", escapeXml(id));
331
332
  }
332
- if (p.globalId) {
333
+ if (p.globalId && beyondMinimum) {
333
334
  x += tag("ram:GlobalID", escapeXml(p.globalId.value), { schemeID: p.globalId.schemeID });
334
335
  }
335
336
  x += tag("ram:Name", escapeXml(p.name));
@@ -344,13 +345,13 @@ function buildParty(p, profile) {
344
345
  p.legalOrganization.schemeID ? { schemeID: p.legalOrganization.schemeID } : void 0
345
346
  );
346
347
  }
347
- if (p.legalOrganization.tradingName)
348
+ if (p.legalOrganization.tradingName && beyondMinimum)
348
349
  lo += tag("ram:TradingBusinessName", escapeXml(p.legalOrganization.tradingName));
349
350
  x += tag("ram:SpecifiedLegalOrganization", lo);
350
351
  }
351
352
  if (p.contact && atLeast(profile, "EN16931" /* EN16931 */)) x += buildContact(p.contact);
352
- if (p.address && atLeast(profile, "BASIC_WL" /* BASIC_WL */)) x += buildAddress(p.address);
353
- if (p.electronicAddress)
353
+ if (p.address && beyondMinimum) x += buildAddress(p.address);
354
+ if (p.electronicAddress && beyondMinimum)
354
355
  x += tag(
355
356
  "ram:URIUniversalCommunication",
356
357
  tag("ram:URIID", escapeXml(p.electronicAddress.value), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackforge-eu/factur-x",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "type": "module",
5
5
  "description": "Embed Factur-X, ZUGFeRD, and XRechnung structured invoice XML into PDF/A-3 documents",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  "type": "git",
42
42
  "url": "git+https://github.com/StackForge-EU/factur-x.git"
43
43
  },
44
- "homepage": "https://www.stack-forge.eu",
44
+ "homepage": "https://factur-x.deployo.eu",
45
45
  "bugs": {
46
46
  "url": "https://github.com/StackForge-EU/factur-x/issues"
47
47
  },