@beliq/sdk 0.3.1 → 0.4.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 +68 -0
- package/README.md +24 -3
- package/dist/index.d.cts +156 -46
- package/dist/index.d.ts +156 -46
- package/examples/invoice.json +64 -0
- package/package.json +6 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
`@beliq/sdk` is on a 0.x line, so a caret range pins the minor: `^0.4.0`
|
|
4
|
+
resolves 0.4.x and never reaches 0.5.0. Additive spec syncs ship as patches for
|
|
5
|
+
that reason, and a minor is reserved for a change that needs consumers to opt in.
|
|
6
|
+
|
|
7
|
+
## 0.4.1 - 2026-09-21
|
|
8
|
+
|
|
9
|
+
- Invoice lines carry the item's price detail and identity: `grossPrice`
|
|
10
|
+
(BT-148) with the per-unit `priceDiscount` (BT-147), `priceBaseQuantity`
|
|
11
|
+
(BT-149/150), `standardItemId` (BT-157), `classifications` (BT-158),
|
|
12
|
+
`originCountryCode` (BT-159) and `attributes` (BG-32). A discount needs a
|
|
13
|
+
gross price and `unitPrice` must equal `grossPrice` minus `priceDiscount`, or
|
|
14
|
+
the API answers 400. With a base quantity the line net (BT-131) is quantity x
|
|
15
|
+
(`unitPrice` / `priceBaseQuantity`), which is what lets a caller who prices
|
|
16
|
+
per 100 units pass PEPPOL-EN16931-R120. The fatturapa, facturae and eslog
|
|
17
|
+
targets read none of these fields.
|
|
18
|
+
- The release workflow refuses a tag whose version disagrees with
|
|
19
|
+
`package.json`. Tagging v0.4.1 against a manifest reading 0.4.0 used to
|
|
20
|
+
publish 0.4.0 and exit green, leaving a tag naming a version that never
|
|
21
|
+
shipped.
|
|
22
|
+
|
|
23
|
+
## 0.4.0 - 2026-09-19
|
|
24
|
+
|
|
25
|
+
- `GET /v1/rulesets` reports retained ruleset versions, so a caller can see
|
|
26
|
+
which older rule sets are still servable rather than only the current one.
|
|
27
|
+
- Participant enrollment codes and the invoice delivery fields are typed.
|
|
28
|
+
- BT-6 (VAT accounting currency) and BT-111 (VAT amount in the accounting
|
|
29
|
+
currency) are typed on the invoice.
|
|
30
|
+
- A scheduled ruleset change reports its capabilities.
|
|
31
|
+
- The README's quick-start invoice is one the API accepts as-is.
|
|
32
|
+
- An em-dash scrub gate runs over the whole tree before publish, and the
|
|
33
|
+
release workflow carries job timeouts and refuses a tag that is not on `main`.
|
|
34
|
+
- The `js-yaml` override floor is raised above GHSA-2883-xcg3-v3hh.
|
|
35
|
+
|
|
36
|
+
## 0.3.1 - 2026-09-02
|
|
37
|
+
|
|
38
|
+
- A spent monthly quota is raised, not retried. A 429 carrying
|
|
39
|
+
`QUOTA_EXCEEDED` is terminal, so the SDK makes exactly one attempt; a 429
|
|
40
|
+
carrying `RATE_LIMITED` or `ACCOUNT_THROTTLED` still retries. Retrying an
|
|
41
|
+
exhausted quota only burned the caller's own backoff window.
|
|
42
|
+
- The France transmission verdict fields and pre-flight error codes are typed.
|
|
43
|
+
- GitHub Actions are pinned to commit SHAs.
|
|
44
|
+
|
|
45
|
+
## 0.3.0 - 2026-08-30
|
|
46
|
+
|
|
47
|
+
- A per-standard profile map: which profile each standard accepts, and which
|
|
48
|
+
standards pin their own and reject one sent by the caller.
|
|
49
|
+
- A per-attempt deadline, and transient failures are retried.
|
|
50
|
+
- The transport defaults are exported from the package entry point, so a caller
|
|
51
|
+
can read the timeout and retry values the SDK ships with.
|
|
52
|
+
- The vendored `openapi.json` is asserted byte-identical to what beliq-api
|
|
53
|
+
generates, and the drift check is directional in the code rather than only in
|
|
54
|
+
its comment. Ten Peppol emit error codes, the 413 responses, the verdict
|
|
55
|
+
verification tier and the `/v1/me` response shape are typed; two error codes
|
|
56
|
+
the API no longer declares are dropped.
|
|
57
|
+
- eslint 10 and flat config.
|
|
58
|
+
|
|
59
|
+
## 0.2.0 - 2026-07-24
|
|
60
|
+
|
|
61
|
+
- Types refreshed to API 0.2.0: the generate seal, `livemode`, and the NLCIUS
|
|
62
|
+
preset.
|
|
63
|
+
|
|
64
|
+
## 0.1.1 - 2026-06-30
|
|
65
|
+
|
|
66
|
+
- First published release. TypeScript/JavaScript SDK for the beliq e-invoice
|
|
67
|
+
API: generate, validate, parse and convert, ESM and CommonJS with bundled
|
|
68
|
+
type declarations.
|
package/README.md
CHANGED
|
@@ -26,13 +26,33 @@ const account = await beliq.me();
|
|
|
26
26
|
const generated = await beliq.generate({
|
|
27
27
|
standard: 'xrechnung',
|
|
28
28
|
verify: true,
|
|
29
|
+
// The XRechnung CIUS asks for more than plain EN 16931: a seller contact
|
|
30
|
+
// (BR-DE-2), payment instructions (BR-DE-1), a VAT breakdown (BR-CO-18) and an
|
|
31
|
+
// electronic address for each party. examples/invoice.json is this same shape.
|
|
29
32
|
invoice: {
|
|
30
33
|
number: 'INV-2026-001',
|
|
31
34
|
issueDate: '2026-01-15',
|
|
32
35
|
currencyCode: 'EUR',
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
buyerReference: '04011000-12345-06',
|
|
37
|
+
seller: {
|
|
38
|
+
name: 'Seller GmbH',
|
|
39
|
+
vatId: 'DE123456789',
|
|
40
|
+
contactName: 'Anna Muster',
|
|
41
|
+
email: 'billing@seller.example',
|
|
42
|
+
phone: '+49 30 1234567',
|
|
43
|
+
address: { street: 'Hauptstr. 1', city: 'Berlin', postalCode: '10115', countryCode: 'DE' },
|
|
44
|
+
peppol: { schemeId: '9930', id: 'DE123456789' },
|
|
45
|
+
},
|
|
46
|
+
buyer: {
|
|
47
|
+
name: 'Buyer GmbH',
|
|
48
|
+
vatId: 'DE987654321',
|
|
49
|
+
email: 'ap@buyer.example',
|
|
50
|
+
address: { street: 'Marktweg 2', city: 'Munich', postalCode: '80331', countryCode: 'DE' },
|
|
51
|
+
peppol: { schemeId: '9930', id: 'DE987654321' },
|
|
52
|
+
},
|
|
35
53
|
lines: [{ description: 'Consulting', quantity: 10, unitCode: 'HUR', unitPrice: 100, lineTotal: 1000, vatRate: 19, vatCategoryCode: 'S' }],
|
|
54
|
+
taxSummary: [{ vatCategoryCode: 'S', vatRate: 19, taxableAmount: 1000, taxAmount: 190 }],
|
|
55
|
+
paymentMeans: { typeCode: '58', iban: 'DE89370400440532013000' },
|
|
36
56
|
totalNetAmount: 1000,
|
|
37
57
|
totalTaxAmount: 190,
|
|
38
58
|
totalGrossAmount: 1190,
|
|
@@ -165,13 +185,14 @@ npm install
|
|
|
165
185
|
npm run build # tsup: dual ESM + CJS + d.ts
|
|
166
186
|
npm run typecheck
|
|
167
187
|
npm run lint
|
|
188
|
+
npm run scrub:check # no em-dash in any tracked file
|
|
168
189
|
npm test # unit tests (no network)
|
|
169
190
|
BELIQ_API_KEY=blq_xxx npm run test:integration # hits the live API; draws quota
|
|
170
191
|
```
|
|
171
192
|
|
|
172
193
|
## Publishing
|
|
173
194
|
|
|
174
|
-
Released to npm as [`@beliq/sdk`](https://www.npmjs.com/package/@beliq/sdk). Releases run from `.github/workflows/release.yml` via npm Trusted Publishing (OIDC, with provenance): push a `v*.*.*` tag to publish. No npm token is stored in the repo.
|
|
195
|
+
Released to npm as [`@beliq/sdk`](https://www.npmjs.com/package/@beliq/sdk). Releases run from `.github/workflows/release.yml` via npm Trusted Publishing (OIDC, with provenance): bump `version` in `package.json`, run `npm install --package-lock-only`, add the release's entry to [`CHANGELOG.md`](CHANGELOG.md), merge, then push a `v*.*.*` tag on the merge commit to publish. No npm token is stored in the repo.
|
|
175
196
|
|
|
176
197
|
## License
|
|
177
198
|
|