@beliq/sdk 0.4.6 → 0.5.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 CHANGED
@@ -4,6 +4,67 @@
4
4
  resolves 0.4.x and never reaches 0.5.0. Additive spec syncs ship as patches for
5
5
  that reason, and a minor is reserved for a change that needs consumers to opt in.
6
6
 
7
+ ## 0.5.1 - 2026-10-11
8
+
9
+ A patch: the types gain two fields and two error codes. No method changes.
10
+
11
+ - The vendored `openapi.json` is document `0.15.0` of the API, up from
12
+ `0.12.0`.
13
+ - `ValidationResult` gains `verificationBadgeLabel`, the English label of the
14
+ badge in `verificationBadge`. It is display text: print it as it is, and
15
+ compare `verificationBadge` in code. The API sets it only beside the badge,
16
+ so a result with no badge has no label. The `validationResult` of a sealed
17
+ `generate()` is the same type and carries it too.
18
+ - `ValidationResult` gains `pdfInput`, which the API sets when the document
19
+ sent to `validate()` was a PDF: the name of the embedded file the verdict is
20
+ about, how that file was found, how many candidates the PDF holds, and
21
+ `containerChecked: false`, because nothing checked the PDF around it.
22
+ - The error code union gains `CONVERSION_OUTPUT_INVALID` and `PDFA_VIOLATION`.
23
+ `convert()` answers 422 `CONVERSION_OUTPUT_INVALID` when the converted XML
24
+ fails validation: the document is not returned, and the verdict is in
25
+ `err.details.validationResult`. `generate()` answers 422 `PDFA_VIOLATION`
26
+ when veraPDF reports a violation of its PDF/A-3b profile in a ZUGFeRD or
27
+ Factur-X PDF it built: the PDF is not returned, and the failed rules are in
28
+ `err.details.failedRules`. A `switch` over the code that TypeScript checks
29
+ for exhaustiveness needs the two new cases.
30
+
31
+ ## 0.5.0 - 2026-10-08
32
+
33
+ A minor, because code that reads a `parse()` result can stop compiling, and a
34
+ `^0.4.0` range does not reach a minor. Only the types of `parse()` change. No
35
+ method does.
36
+
37
+ - `ParseResult['invoice']` is the invoice `POST /v1/parse` declares for its
38
+ answer, where it was the invoice `generate()` takes. It lists the 13 fields
39
+ the parser returns, and only `lines` is always present:
40
+ `result.invoice.number` was a `string` and is a `string | undefined`. Below
41
+ the invoice nothing is required but the `id` of a `delivery.locationId`,
42
+ which is optional itself. The 35 fields of the generate invoice that parse
43
+ does not return, such as `allowances`, `paymentMeans` and `taxSummary`, are
44
+ gone from the type. A line lists 7 fields where it listed 20, a party 4
45
+ where it listed 9, and a party's address 5 where it listed 9.
46
+ - What stops compiling: a read of a field parse does not return, and
47
+ `result.invoice` passed where an `Invoice` is expected, or a party, a line,
48
+ an address or the delivery of it passed where that part of an `Invoice` is.
49
+ With `strictNullChecks` on, which `strict` includes, so does a field used
50
+ as always present, such as `result.invoice.seller.name` or a `string` taken
51
+ from `result.invoice.number`. Check for a field before reading it.
52
+ - The types follow the API, which changed first. Since 2026-10-07
53
+ `POST /v1/parse` returns a field only when the parser has a value for it,
54
+ and puts nothing in the place of an absent one. `parse()` hands the answer
55
+ on as it is, so an installed 0.4.6 gets the same answer, and its types still
56
+ say that nine fields of the invoice are always there, and more inside a
57
+ party, an address and a line.
58
+ https://beliq.eu/changelog/ has the API change under that date.
59
+ https://docs.beliq.eu/api-reference/parse/ says what an absent field means,
60
+ and when a `PARSE_VALUE_NOT_FOUND` warning in `result.warnings` names it.
61
+ - The vendored `openapi.json` is document `0.12.0` of the API, up from
62
+ `0.9.0`. Besides the parsed invoice one thing differs: the 14 nullable
63
+ fields of `GET /v1/me` and `GET /v1/rulesets` are spelled with
64
+ `nullable: true`, which is what OpenAPI 3.0 has for a nullable field, where
65
+ each had an `anyOf` with a `"type": "null"` arm. The type generated for each
66
+ of the 14 is the same, and two gain an `@enum` doc tag.
67
+
7
68
  ## 0.4.6 - 2026-10-06
8
69
 
9
70
  - The vendored `openapi.json` carries the four fields `POST /v1/parse` answers