@beliq/sdk 0.4.1 → 0.4.2
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 +14 -0
- package/dist/index.d.cts +90 -1
- package/dist/index.d.ts +90 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
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.4.2 - 2026-09-23
|
|
8
|
+
|
|
9
|
+
- Invoices carry allowances and charges at document level (BG-20, BG-21) and
|
|
10
|
+
line level (BG-27, BG-28), on `/v1/generate` and `/v1/parse`, as
|
|
11
|
+
`allowances` and `charges`. A document-level entry states its own VAT
|
|
12
|
+
category and rate; a line-level entry inherits the line's.
|
|
13
|
+
- `GET /v1/rulesets` reports `previousChannel` on every ruleset: what
|
|
14
|
+
`Beliq-Ruleset: previous` reaches for that format today, with
|
|
15
|
+
`servingVersion`, `previousVersion` and a `fallbackReason` of `sunset`,
|
|
16
|
+
`notice-period` or `superseded`.
|
|
17
|
+
- The publish job runs in the `release` GitHub environment, whose only
|
|
18
|
+
deployment policy is the `v*.*.*` tag pattern, so an edit to the workflow
|
|
19
|
+
cannot publish from another ref.
|
|
20
|
+
|
|
7
21
|
## 0.4.1 - 2026-09-21
|
|
8
22
|
|
|
9
23
|
- Invoice lines carry the item's price detail and identity: `grossPrice`
|
package/dist/index.d.cts
CHANGED
|
@@ -30,6 +30,20 @@ interface components {
|
|
|
30
30
|
name: string;
|
|
31
31
|
value: string;
|
|
32
32
|
}[];
|
|
33
|
+
allowances?: {
|
|
34
|
+
amount: number;
|
|
35
|
+
baseAmount?: number;
|
|
36
|
+
percentage?: number;
|
|
37
|
+
reason?: string;
|
|
38
|
+
reasonCode?: string;
|
|
39
|
+
}[];
|
|
40
|
+
charges?: {
|
|
41
|
+
amount: number;
|
|
42
|
+
baseAmount?: number;
|
|
43
|
+
percentage?: number;
|
|
44
|
+
reason?: string;
|
|
45
|
+
reasonCode?: string;
|
|
46
|
+
}[];
|
|
33
47
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
34
48
|
};
|
|
35
49
|
};
|
|
@@ -269,6 +283,20 @@ interface operations {
|
|
|
269
283
|
name: string;
|
|
270
284
|
value: string;
|
|
271
285
|
}[];
|
|
286
|
+
allowances?: {
|
|
287
|
+
amount: number;
|
|
288
|
+
baseAmount?: number;
|
|
289
|
+
percentage?: number;
|
|
290
|
+
reason?: string;
|
|
291
|
+
reasonCode?: string;
|
|
292
|
+
}[];
|
|
293
|
+
charges?: {
|
|
294
|
+
amount: number;
|
|
295
|
+
baseAmount?: number;
|
|
296
|
+
percentage?: number;
|
|
297
|
+
reason?: string;
|
|
298
|
+
reasonCode?: string;
|
|
299
|
+
}[];
|
|
272
300
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
273
301
|
}[];
|
|
274
302
|
taxSummary?: {
|
|
@@ -307,6 +335,24 @@ interface operations {
|
|
|
307
335
|
debitedAccountId?: string;
|
|
308
336
|
};
|
|
309
337
|
paymentTerms?: string;
|
|
338
|
+
allowances?: {
|
|
339
|
+
amount: number;
|
|
340
|
+
baseAmount?: number;
|
|
341
|
+
percentage?: number;
|
|
342
|
+
reason?: string;
|
|
343
|
+
reasonCode?: string;
|
|
344
|
+
vatCategoryCode: string;
|
|
345
|
+
vatRate?: number;
|
|
346
|
+
}[];
|
|
347
|
+
charges?: {
|
|
348
|
+
amount: number;
|
|
349
|
+
baseAmount?: number;
|
|
350
|
+
percentage?: number;
|
|
351
|
+
reason?: string;
|
|
352
|
+
reasonCode?: string;
|
|
353
|
+
vatCategoryCode: string;
|
|
354
|
+
vatRate?: number;
|
|
355
|
+
}[];
|
|
310
356
|
totalNetAmount: number;
|
|
311
357
|
totalTaxAmount: number;
|
|
312
358
|
totalGrossAmount: number;
|
|
@@ -643,7 +689,7 @@ interface operations {
|
|
|
643
689
|
franceCtc?: boolean;
|
|
644
690
|
};
|
|
645
691
|
header?: {
|
|
646
|
-
/** @description Pin the validation ruleset for this request. A channel ("latest" or "previous"), or a comma-separated list of exact per-format pins as "<artifactKey>:<version>" (e.g. "xrechnung_schematron:2.4.0"). The two forms are mutually exclusive. Default (no header) uses "latest". Effective on this route only
|
|
692
|
+
/** @description Pin the validation ruleset for this request. A channel ("latest" or "previous"), or a comma-separated list of exact per-format pins as "<artifactKey>:<version>" (e.g. "xrechnung_schematron:2.4.0"). The two forms are mutually exclusive. Default (no header) uses "latest". Effective on this route only: parse/generate/convert accept but ignore it. The applied ruleset is echoed in the Beliq-Ruleset-Resolved response header; see GET /v1/rulesets for selectable channels. */
|
|
647
693
|
"Beliq-Ruleset"?: string;
|
|
648
694
|
};
|
|
649
695
|
path?: never;
|
|
@@ -1057,6 +1103,20 @@ interface operations {
|
|
|
1057
1103
|
name: string;
|
|
1058
1104
|
value: string;
|
|
1059
1105
|
}[];
|
|
1106
|
+
allowances?: {
|
|
1107
|
+
amount: number;
|
|
1108
|
+
baseAmount?: number;
|
|
1109
|
+
percentage?: number;
|
|
1110
|
+
reason?: string;
|
|
1111
|
+
reasonCode?: string;
|
|
1112
|
+
}[];
|
|
1113
|
+
charges?: {
|
|
1114
|
+
amount: number;
|
|
1115
|
+
baseAmount?: number;
|
|
1116
|
+
percentage?: number;
|
|
1117
|
+
reason?: string;
|
|
1118
|
+
reasonCode?: string;
|
|
1119
|
+
}[];
|
|
1060
1120
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
1061
1121
|
}[];
|
|
1062
1122
|
taxSummary?: {
|
|
@@ -1095,6 +1155,24 @@ interface operations {
|
|
|
1095
1155
|
debitedAccountId?: string;
|
|
1096
1156
|
};
|
|
1097
1157
|
paymentTerms?: string;
|
|
1158
|
+
allowances?: {
|
|
1159
|
+
amount: number;
|
|
1160
|
+
baseAmount?: number;
|
|
1161
|
+
percentage?: number;
|
|
1162
|
+
reason?: string;
|
|
1163
|
+
reasonCode?: string;
|
|
1164
|
+
vatCategoryCode: string;
|
|
1165
|
+
vatRate?: number;
|
|
1166
|
+
}[];
|
|
1167
|
+
charges?: {
|
|
1168
|
+
amount: number;
|
|
1169
|
+
baseAmount?: number;
|
|
1170
|
+
percentage?: number;
|
|
1171
|
+
reason?: string;
|
|
1172
|
+
reasonCode?: string;
|
|
1173
|
+
vatCategoryCode: string;
|
|
1174
|
+
vatRate?: number;
|
|
1175
|
+
}[];
|
|
1098
1176
|
totalNetAmount: number;
|
|
1099
1177
|
totalTaxAmount: number;
|
|
1100
1178
|
totalGrossAmount: number;
|
|
@@ -1608,6 +1686,17 @@ interface operations {
|
|
|
1608
1686
|
/** @description ISO 8601 date (YYYY-MM-DD) the authority made this version's successor mandatory, or null when it published no date. Once it has passed, `Beliq-Ruleset: previous` no longer resolves to this version and sets `rulesetFellBack: true`, because a document built to it is rejected by the receiving corner. An exact version pin is unaffected and still reaches it until `retainedUntil`. */
|
|
1609
1687
|
supersededMandatoryOn: string | null;
|
|
1610
1688
|
}[];
|
|
1689
|
+
/** @description What `Beliq-Ruleset: previous` reaches for this format, one row per rule artifact in its run set that retains a version. Empty for a format whose artifacts have never had a breaking bump. A `POST /v1/validate` request on `previous` sets `rulesetFellBack: true` only when EVERY artifact fell back, so this format falls back entirely exactly when no row here has a non-null `previousVersion`. Wider than `retained[]`, which covers only this format's own `versionKey`. */
|
|
1690
|
+
previousChannel: {
|
|
1691
|
+
/** @description The `versions.json` artefact key this row is about. Often this format's own `versionKey`, but not always: an overlay or a severity table that runs under the format's profiles decides its `previous` too, and names no format of its own. */
|
|
1692
|
+
versionKey: string;
|
|
1693
|
+
/** @description The version `latest` serves for this artefact today. The other half of the pair to compare against `previousVersion`. */
|
|
1694
|
+
servingVersion: string;
|
|
1695
|
+
/** @description The version `Beliq-Ruleset: previous` resolves to for this artefact today, or null when the channel falls back to `latest` for it. Pin it exactly as `Beliq-Ruleset: <versionKey>:<previousVersion>` to reach it regardless. */
|
|
1696
|
+
previousVersion: string | null;
|
|
1697
|
+
/** @description Why `previous` reaches nothing for this artefact; null exactly when `previousVersion` is set. `sunset` = every retained version is past its `retainedUntil`, so not even an exact pin resolves. `notice-period` = the only retained version is the one standing in for `latest` until a scheduled bump takes effect, so there is nothing behind it yet. `superseded` = the authority made the successor mandatory, so Beliq will not choose the older ruleset on your behalf; an exact pin still reaches it until `retainedUntil`. */
|
|
1698
|
+
fallbackReason: "sunset" | "notice-period" | "superseded" | null;
|
|
1699
|
+
}[];
|
|
1611
1700
|
}[];
|
|
1612
1701
|
channels: {
|
|
1613
1702
|
id: "latest" | "previous";
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,20 @@ interface components {
|
|
|
30
30
|
name: string;
|
|
31
31
|
value: string;
|
|
32
32
|
}[];
|
|
33
|
+
allowances?: {
|
|
34
|
+
amount: number;
|
|
35
|
+
baseAmount?: number;
|
|
36
|
+
percentage?: number;
|
|
37
|
+
reason?: string;
|
|
38
|
+
reasonCode?: string;
|
|
39
|
+
}[];
|
|
40
|
+
charges?: {
|
|
41
|
+
amount: number;
|
|
42
|
+
baseAmount?: number;
|
|
43
|
+
percentage?: number;
|
|
44
|
+
reason?: string;
|
|
45
|
+
reasonCode?: string;
|
|
46
|
+
}[];
|
|
33
47
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
34
48
|
};
|
|
35
49
|
};
|
|
@@ -269,6 +283,20 @@ interface operations {
|
|
|
269
283
|
name: string;
|
|
270
284
|
value: string;
|
|
271
285
|
}[];
|
|
286
|
+
allowances?: {
|
|
287
|
+
amount: number;
|
|
288
|
+
baseAmount?: number;
|
|
289
|
+
percentage?: number;
|
|
290
|
+
reason?: string;
|
|
291
|
+
reasonCode?: string;
|
|
292
|
+
}[];
|
|
293
|
+
charges?: {
|
|
294
|
+
amount: number;
|
|
295
|
+
baseAmount?: number;
|
|
296
|
+
percentage?: number;
|
|
297
|
+
reason?: string;
|
|
298
|
+
reasonCode?: string;
|
|
299
|
+
}[];
|
|
272
300
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
273
301
|
}[];
|
|
274
302
|
taxSummary?: {
|
|
@@ -307,6 +335,24 @@ interface operations {
|
|
|
307
335
|
debitedAccountId?: string;
|
|
308
336
|
};
|
|
309
337
|
paymentTerms?: string;
|
|
338
|
+
allowances?: {
|
|
339
|
+
amount: number;
|
|
340
|
+
baseAmount?: number;
|
|
341
|
+
percentage?: number;
|
|
342
|
+
reason?: string;
|
|
343
|
+
reasonCode?: string;
|
|
344
|
+
vatCategoryCode: string;
|
|
345
|
+
vatRate?: number;
|
|
346
|
+
}[];
|
|
347
|
+
charges?: {
|
|
348
|
+
amount: number;
|
|
349
|
+
baseAmount?: number;
|
|
350
|
+
percentage?: number;
|
|
351
|
+
reason?: string;
|
|
352
|
+
reasonCode?: string;
|
|
353
|
+
vatCategoryCode: string;
|
|
354
|
+
vatRate?: number;
|
|
355
|
+
}[];
|
|
310
356
|
totalNetAmount: number;
|
|
311
357
|
totalTaxAmount: number;
|
|
312
358
|
totalGrossAmount: number;
|
|
@@ -643,7 +689,7 @@ interface operations {
|
|
|
643
689
|
franceCtc?: boolean;
|
|
644
690
|
};
|
|
645
691
|
header?: {
|
|
646
|
-
/** @description Pin the validation ruleset for this request. A channel ("latest" or "previous"), or a comma-separated list of exact per-format pins as "<artifactKey>:<version>" (e.g. "xrechnung_schematron:2.4.0"). The two forms are mutually exclusive. Default (no header) uses "latest". Effective on this route only
|
|
692
|
+
/** @description Pin the validation ruleset for this request. A channel ("latest" or "previous"), or a comma-separated list of exact per-format pins as "<artifactKey>:<version>" (e.g. "xrechnung_schematron:2.4.0"). The two forms are mutually exclusive. Default (no header) uses "latest". Effective on this route only: parse/generate/convert accept but ignore it. The applied ruleset is echoed in the Beliq-Ruleset-Resolved response header; see GET /v1/rulesets for selectable channels. */
|
|
647
693
|
"Beliq-Ruleset"?: string;
|
|
648
694
|
};
|
|
649
695
|
path?: never;
|
|
@@ -1057,6 +1103,20 @@ interface operations {
|
|
|
1057
1103
|
name: string;
|
|
1058
1104
|
value: string;
|
|
1059
1105
|
}[];
|
|
1106
|
+
allowances?: {
|
|
1107
|
+
amount: number;
|
|
1108
|
+
baseAmount?: number;
|
|
1109
|
+
percentage?: number;
|
|
1110
|
+
reason?: string;
|
|
1111
|
+
reasonCode?: string;
|
|
1112
|
+
}[];
|
|
1113
|
+
charges?: {
|
|
1114
|
+
amount: number;
|
|
1115
|
+
baseAmount?: number;
|
|
1116
|
+
percentage?: number;
|
|
1117
|
+
reason?: string;
|
|
1118
|
+
reasonCode?: string;
|
|
1119
|
+
}[];
|
|
1060
1120
|
subLines?: components["schemas"]["InvoiceLine"][];
|
|
1061
1121
|
}[];
|
|
1062
1122
|
taxSummary?: {
|
|
@@ -1095,6 +1155,24 @@ interface operations {
|
|
|
1095
1155
|
debitedAccountId?: string;
|
|
1096
1156
|
};
|
|
1097
1157
|
paymentTerms?: string;
|
|
1158
|
+
allowances?: {
|
|
1159
|
+
amount: number;
|
|
1160
|
+
baseAmount?: number;
|
|
1161
|
+
percentage?: number;
|
|
1162
|
+
reason?: string;
|
|
1163
|
+
reasonCode?: string;
|
|
1164
|
+
vatCategoryCode: string;
|
|
1165
|
+
vatRate?: number;
|
|
1166
|
+
}[];
|
|
1167
|
+
charges?: {
|
|
1168
|
+
amount: number;
|
|
1169
|
+
baseAmount?: number;
|
|
1170
|
+
percentage?: number;
|
|
1171
|
+
reason?: string;
|
|
1172
|
+
reasonCode?: string;
|
|
1173
|
+
vatCategoryCode: string;
|
|
1174
|
+
vatRate?: number;
|
|
1175
|
+
}[];
|
|
1098
1176
|
totalNetAmount: number;
|
|
1099
1177
|
totalTaxAmount: number;
|
|
1100
1178
|
totalGrossAmount: number;
|
|
@@ -1608,6 +1686,17 @@ interface operations {
|
|
|
1608
1686
|
/** @description ISO 8601 date (YYYY-MM-DD) the authority made this version's successor mandatory, or null when it published no date. Once it has passed, `Beliq-Ruleset: previous` no longer resolves to this version and sets `rulesetFellBack: true`, because a document built to it is rejected by the receiving corner. An exact version pin is unaffected and still reaches it until `retainedUntil`. */
|
|
1609
1687
|
supersededMandatoryOn: string | null;
|
|
1610
1688
|
}[];
|
|
1689
|
+
/** @description What `Beliq-Ruleset: previous` reaches for this format, one row per rule artifact in its run set that retains a version. Empty for a format whose artifacts have never had a breaking bump. A `POST /v1/validate` request on `previous` sets `rulesetFellBack: true` only when EVERY artifact fell back, so this format falls back entirely exactly when no row here has a non-null `previousVersion`. Wider than `retained[]`, which covers only this format's own `versionKey`. */
|
|
1690
|
+
previousChannel: {
|
|
1691
|
+
/** @description The `versions.json` artefact key this row is about. Often this format's own `versionKey`, but not always: an overlay or a severity table that runs under the format's profiles decides its `previous` too, and names no format of its own. */
|
|
1692
|
+
versionKey: string;
|
|
1693
|
+
/** @description The version `latest` serves for this artefact today. The other half of the pair to compare against `previousVersion`. */
|
|
1694
|
+
servingVersion: string;
|
|
1695
|
+
/** @description The version `Beliq-Ruleset: previous` resolves to for this artefact today, or null when the channel falls back to `latest` for it. Pin it exactly as `Beliq-Ruleset: <versionKey>:<previousVersion>` to reach it regardless. */
|
|
1696
|
+
previousVersion: string | null;
|
|
1697
|
+
/** @description Why `previous` reaches nothing for this artefact; null exactly when `previousVersion` is set. `sunset` = every retained version is past its `retainedUntil`, so not even an exact pin resolves. `notice-period` = the only retained version is the one standing in for `latest` until a scheduled bump takes effect, so there is nothing behind it yet. `superseded` = the authority made the successor mandatory, so Beliq will not choose the older ruleset on your behalf; an exact pin still reaches it until `retainedUntil`. */
|
|
1698
|
+
fallbackReason: "sunset" | "notice-period" | "superseded" | null;
|
|
1699
|
+
}[];
|
|
1611
1700
|
}[];
|
|
1612
1701
|
channels: {
|
|
1613
1702
|
id: "latest" | "previous";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beliq/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Official beliq SDK: generate, validate, parse, and convert EU-compliant e-invoices (XRechnung, ZUGFeRD, Factur-X, Peppol BIS) against authority-pinned, drift-checked rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"beliq",
|