@beliq/sdk 0.4.4 → 0.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 +36 -0
- package/dist/{constants-CIRzGHqn.d.cts → constants-DFGl_MXW.d.cts} +14 -5
- package/dist/{constants-CIRzGHqn.d.ts → constants-DFGl_MXW.d.ts} +14 -5
- package/dist/helpers.cjs +15 -2
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +15 -2
- package/dist/index.cjs +15 -2
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +15 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,42 @@
|
|
|
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.6 - 2026-10-06
|
|
8
|
+
|
|
9
|
+
- The vendored `openapi.json` carries the four fields `POST /v1/parse` answers
|
|
10
|
+
with and the previous copy did not. `warnings` is always present, and empty
|
|
11
|
+
when the parser read every element that holds something: `PARSE_NOT_RETURNED`
|
|
12
|
+
lists what the document carries beyond the parsed `invoice`, by path and
|
|
13
|
+
count, and `PARSE_VALUE_NOT_FOUND` names a field no value could be read for.
|
|
14
|
+
`profileUrn` (BT-24) and `businessProcessId` (BT-23) carry what the document
|
|
15
|
+
states, and the latter is not the `businessProcessId` a `generate()` invoice
|
|
16
|
+
takes, which is an input limited to the three French Flux 2 codes.
|
|
17
|
+
`franceCtcDetected` is true when BT-23 is one of the French cadre de
|
|
18
|
+
facturation codes or BT-24 is the EXTENDED-CTC-FR URN, and absent otherwise.
|
|
19
|
+
- `ParseResult` picks all four up from the regenerated schema, and
|
|
20
|
+
`ParseWarning` and `ParseWarningCode` are exported beside it, the way
|
|
21
|
+
`ValidationIssue` is exported beside `ValidationResult`, so a caller can
|
|
22
|
+
annotate a warning without indexing into the result type.
|
|
23
|
+
|
|
24
|
+
## 0.4.5 - 2026-10-03
|
|
25
|
+
|
|
26
|
+
- `LIVE_GENERATE_STANDARDS` carries all eight standards `POST /v1/generate`
|
|
27
|
+
accepts, where it had carried four. The four added are the national XSD
|
|
28
|
+
formats: `fatturapa`, `facturae`, `eslog` and `ksef`. Each is Schema-checked,
|
|
29
|
+
meaning structure only and no business rules, because its authority publishes
|
|
30
|
+
no machine-readable rule pack, and `GET /v1/rulesets` carries the badge.
|
|
31
|
+
`LIVE_PROFILES_BY_STANDARD` gains the one profile each allows: `ordinaria`
|
|
32
|
+
for `fatturapa` and `facturae`, `eracun` for `eslog`, `fa3` for `ksef`. The
|
|
33
|
+
map stays narrower than the engine in one place, the Factur-X `minimum` and
|
|
34
|
+
`basic` profiles, for FNFE-MPE source gating. `LIVE_GENERATE_PRESETS` is
|
|
35
|
+
unchanged at five entries: it mirrors what beliq.eu's own generator offers.
|
|
36
|
+
- The vendored `openapi.json` carries the corrected `/v1/validate` description.
|
|
37
|
+
It had said that matching a verdict's `rulesetArtifacts` rows against the
|
|
38
|
+
`GET /v1/rulesets` catalog covers publicly-supported formats only, and that a
|
|
39
|
+
national format's components are kept off the catalog. Both were false: the
|
|
40
|
+
catalog publishes every format beliq carries and the component rows each
|
|
41
|
+
ruleset is built from.
|
|
42
|
+
|
|
7
43
|
## 0.4.4 - 2026-10-02
|
|
8
44
|
|
|
9
45
|
- Invoices carry additional supporting documents (BG-24) as
|
|
@@ -20,7 +20,13 @@ declare const DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
|
20
20
|
declare const DEFAULT_TIMEOUT_MS = 90000;
|
|
21
21
|
/** Extra attempts after the first, for 429 / 502 / 503 only. */
|
|
22
22
|
declare const DEFAULT_MAX_RETRIES = 3;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Every `standard` POST /v1/generate accepts, in the order its enum lists them.
|
|
25
|
+
* The four national formats are Schema-checked: their authority publishes a
|
|
26
|
+
* schema and no machine-readable business rules, so beliq checks structure and
|
|
27
|
+
* says so. GET /v1/rulesets carries each one's badge.
|
|
28
|
+
*/
|
|
29
|
+
declare const LIVE_GENERATE_STANDARDS: readonly ["xrechnung", "zugferd", "facturx", "peppol-bis", "fatturapa", "facturae", "eslog", "ksef"];
|
|
24
30
|
/** A named generate target: the API `standard` plus the `profile`/`facturxProfile`/`output` it needs. */
|
|
25
31
|
interface GeneratePreset {
|
|
26
32
|
id: string;
|
|
@@ -56,10 +62,9 @@ declare const LIVE_PROFILES: readonly ["basicwl", "en16931", "extended", "extend
|
|
|
56
62
|
* `peppol-bis`, and `extended-ctc-fr` is the AFNOR XP Z12-012 France CTC overlay
|
|
57
63
|
* with no ZUGFeRD-branded counterpart.
|
|
58
64
|
*
|
|
59
|
-
*
|
|
60
|
-
* `minimum` and `basic` Factur-X profiles are
|
|
61
|
-
* (FNFE-MPE source gating)
|
|
62
|
-
* and the standards outside LIVE_GENERATE_STANDARDS are absent entirely.
|
|
65
|
+
* It carries every standard the API accepts. It stays narrower than the
|
|
66
|
+
* engine's table in one place: the `minimum` and `basic` Factur-X profiles are
|
|
67
|
+
* engine-supported but not offered here (FNFE-MPE source gating).
|
|
63
68
|
*
|
|
64
69
|
* `scripts/check-profile-drift.mjs` compares this against the engine's table.
|
|
65
70
|
*/
|
|
@@ -68,6 +73,10 @@ declare const LIVE_PROFILES_BY_STANDARD: {
|
|
|
68
73
|
readonly 'peppol-bis': readonly ["peppol", "romania-ro-cius", "netherlands-nlcius"];
|
|
69
74
|
readonly zugferd: readonly ["basicwl", "en16931", "extended"];
|
|
70
75
|
readonly facturx: readonly ["basicwl", "en16931", "extended", "extended-ctc-fr"];
|
|
76
|
+
readonly fatturapa: readonly ["ordinaria"];
|
|
77
|
+
readonly facturae: readonly ["ordinaria"];
|
|
78
|
+
readonly eslog: readonly ["eracun"];
|
|
79
|
+
readonly ksef: readonly ["fa3"];
|
|
71
80
|
};
|
|
72
81
|
/** The profiles a caller may choose for `standard`; empty for an unknown standard. */
|
|
73
82
|
declare function profilesForStandard(standard: string): readonly string[];
|
|
@@ -20,7 +20,13 @@ declare const DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
|
20
20
|
declare const DEFAULT_TIMEOUT_MS = 90000;
|
|
21
21
|
/** Extra attempts after the first, for 429 / 502 / 503 only. */
|
|
22
22
|
declare const DEFAULT_MAX_RETRIES = 3;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Every `standard` POST /v1/generate accepts, in the order its enum lists them.
|
|
25
|
+
* The four national formats are Schema-checked: their authority publishes a
|
|
26
|
+
* schema and no machine-readable business rules, so beliq checks structure and
|
|
27
|
+
* says so. GET /v1/rulesets carries each one's badge.
|
|
28
|
+
*/
|
|
29
|
+
declare const LIVE_GENERATE_STANDARDS: readonly ["xrechnung", "zugferd", "facturx", "peppol-bis", "fatturapa", "facturae", "eslog", "ksef"];
|
|
24
30
|
/** A named generate target: the API `standard` plus the `profile`/`facturxProfile`/`output` it needs. */
|
|
25
31
|
interface GeneratePreset {
|
|
26
32
|
id: string;
|
|
@@ -56,10 +62,9 @@ declare const LIVE_PROFILES: readonly ["basicwl", "en16931", "extended", "extend
|
|
|
56
62
|
* `peppol-bis`, and `extended-ctc-fr` is the AFNOR XP Z12-012 France CTC overlay
|
|
57
63
|
* with no ZUGFeRD-branded counterpart.
|
|
58
64
|
*
|
|
59
|
-
*
|
|
60
|
-
* `minimum` and `basic` Factur-X profiles are
|
|
61
|
-
* (FNFE-MPE source gating)
|
|
62
|
-
* and the standards outside LIVE_GENERATE_STANDARDS are absent entirely.
|
|
65
|
+
* It carries every standard the API accepts. It stays narrower than the
|
|
66
|
+
* engine's table in one place: the `minimum` and `basic` Factur-X profiles are
|
|
67
|
+
* engine-supported but not offered here (FNFE-MPE source gating).
|
|
63
68
|
*
|
|
64
69
|
* `scripts/check-profile-drift.mjs` compares this against the engine's table.
|
|
65
70
|
*/
|
|
@@ -68,6 +73,10 @@ declare const LIVE_PROFILES_BY_STANDARD: {
|
|
|
68
73
|
readonly 'peppol-bis': readonly ["peppol", "romania-ro-cius", "netherlands-nlcius"];
|
|
69
74
|
readonly zugferd: readonly ["basicwl", "en16931", "extended"];
|
|
70
75
|
readonly facturx: readonly ["basicwl", "en16931", "extended", "extended-ctc-fr"];
|
|
76
|
+
readonly fatturapa: readonly ["ordinaria"];
|
|
77
|
+
readonly facturae: readonly ["ordinaria"];
|
|
78
|
+
readonly eslog: readonly ["eracun"];
|
|
79
|
+
readonly ksef: readonly ["fa3"];
|
|
71
80
|
};
|
|
72
81
|
/** The profiles a caller may choose for `standard`; empty for an unknown standard. */
|
|
73
82
|
declare function profilesForStandard(standard: string): readonly string[];
|
package/dist/helpers.cjs
CHANGED
|
@@ -165,7 +165,16 @@ function buildRequest(params) {
|
|
|
165
165
|
|
|
166
166
|
// src/constants.ts
|
|
167
167
|
var DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
168
|
-
var LIVE_GENERATE_STANDARDS = [
|
|
168
|
+
var LIVE_GENERATE_STANDARDS = [
|
|
169
|
+
"xrechnung",
|
|
170
|
+
"zugferd",
|
|
171
|
+
"facturx",
|
|
172
|
+
"peppol-bis",
|
|
173
|
+
"fatturapa",
|
|
174
|
+
"facturae",
|
|
175
|
+
"eslog",
|
|
176
|
+
"ksef"
|
|
177
|
+
];
|
|
169
178
|
var LIVE_GENERATE_PRESETS = [
|
|
170
179
|
{ id: "xrechnung", label: "XRechnung", standard: "xrechnung", output: "xml" },
|
|
171
180
|
{ id: "factur-x", label: "Factur-X", standard: "facturx", output: "pdf", facturxProfile: "en16931" },
|
|
@@ -178,7 +187,11 @@ var LIVE_PROFILES_BY_STANDARD = {
|
|
|
178
187
|
xrechnung: ["xrechnung"],
|
|
179
188
|
"peppol-bis": ["peppol", "romania-ro-cius", "netherlands-nlcius"],
|
|
180
189
|
zugferd: ["basicwl", "en16931", "extended"],
|
|
181
|
-
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"]
|
|
190
|
+
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"],
|
|
191
|
+
fatturapa: ["ordinaria"],
|
|
192
|
+
facturae: ["ordinaria"],
|
|
193
|
+
eslog: ["eracun"],
|
|
194
|
+
ksef: ["fa3"]
|
|
182
195
|
};
|
|
183
196
|
function profilesForStandard(standard) {
|
|
184
197
|
return LIVE_PROFILES_BY_STANDARD[standard] ?? [];
|
package/dist/helpers.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlainObject } from './constants-
|
|
2
|
-
export { D as DEFAULT_BASE_URL, a as DocumentInput, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, i as compactQuery, j as decodeUtf8, k as isPlainObject, l as isProfileAllowedForStandard, m as mergeDeep, p as profilesForStandard, s as sniffContentType, t as toBytes } from './constants-
|
|
1
|
+
import { P as PlainObject } from './constants-DFGl_MXW.cjs';
|
|
2
|
+
export { D as DEFAULT_BASE_URL, a as DocumentInput, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, i as compactQuery, j as decodeUtf8, k as isPlainObject, l as isProfileAllowedForStandard, m as mergeDeep, p as profilesForStandard, s as sniffContentType, t as toBytes } from './constants-DFGl_MXW.cjs';
|
|
3
3
|
|
|
4
4
|
type Operation = 'me' | 'generate' | 'validate' | 'parse' | 'convert';
|
|
5
5
|
/** 'json' => parse the `{ success, data }` envelope; 'binary' => return raw bytes. */
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlainObject } from './constants-
|
|
2
|
-
export { D as DEFAULT_BASE_URL, a as DocumentInput, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, i as compactQuery, j as decodeUtf8, k as isPlainObject, l as isProfileAllowedForStandard, m as mergeDeep, p as profilesForStandard, s as sniffContentType, t as toBytes } from './constants-
|
|
1
|
+
import { P as PlainObject } from './constants-DFGl_MXW.js';
|
|
2
|
+
export { D as DEFAULT_BASE_URL, a as DocumentInput, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, i as compactQuery, j as decodeUtf8, k as isPlainObject, l as isProfileAllowedForStandard, m as mergeDeep, p as profilesForStandard, s as sniffContentType, t as toBytes } from './constants-DFGl_MXW.js';
|
|
3
3
|
|
|
4
4
|
type Operation = 'me' | 'generate' | 'validate' | 'parse' | 'convert';
|
|
5
5
|
/** 'json' => parse the `{ success, data }` envelope; 'binary' => return raw bytes. */
|
package/dist/helpers.js
CHANGED
|
@@ -122,7 +122,16 @@ function buildRequest(params) {
|
|
|
122
122
|
|
|
123
123
|
// src/constants.ts
|
|
124
124
|
var DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
125
|
-
var LIVE_GENERATE_STANDARDS = [
|
|
125
|
+
var LIVE_GENERATE_STANDARDS = [
|
|
126
|
+
"xrechnung",
|
|
127
|
+
"zugferd",
|
|
128
|
+
"facturx",
|
|
129
|
+
"peppol-bis",
|
|
130
|
+
"fatturapa",
|
|
131
|
+
"facturae",
|
|
132
|
+
"eslog",
|
|
133
|
+
"ksef"
|
|
134
|
+
];
|
|
126
135
|
var LIVE_GENERATE_PRESETS = [
|
|
127
136
|
{ id: "xrechnung", label: "XRechnung", standard: "xrechnung", output: "xml" },
|
|
128
137
|
{ id: "factur-x", label: "Factur-X", standard: "facturx", output: "pdf", facturxProfile: "en16931" },
|
|
@@ -135,7 +144,11 @@ var LIVE_PROFILES_BY_STANDARD = {
|
|
|
135
144
|
xrechnung: ["xrechnung"],
|
|
136
145
|
"peppol-bis": ["peppol", "romania-ro-cius", "netherlands-nlcius"],
|
|
137
146
|
zugferd: ["basicwl", "en16931", "extended"],
|
|
138
|
-
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"]
|
|
147
|
+
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"],
|
|
148
|
+
fatturapa: ["ordinaria"],
|
|
149
|
+
facturae: ["ordinaria"],
|
|
150
|
+
eslog: ["eracun"],
|
|
151
|
+
ksef: ["fa3"]
|
|
139
152
|
};
|
|
140
153
|
function profilesForStandard(standard) {
|
|
141
154
|
return LIVE_PROFILES_BY_STANDARD[standard] ?? [];
|
package/dist/index.cjs
CHANGED
|
@@ -211,7 +211,16 @@ function errorFromResponse(status, bytes) {
|
|
|
211
211
|
var DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
212
212
|
var DEFAULT_TIMEOUT_MS = 9e4;
|
|
213
213
|
var DEFAULT_MAX_RETRIES = 3;
|
|
214
|
-
var LIVE_GENERATE_STANDARDS = [
|
|
214
|
+
var LIVE_GENERATE_STANDARDS = [
|
|
215
|
+
"xrechnung",
|
|
216
|
+
"zugferd",
|
|
217
|
+
"facturx",
|
|
218
|
+
"peppol-bis",
|
|
219
|
+
"fatturapa",
|
|
220
|
+
"facturae",
|
|
221
|
+
"eslog",
|
|
222
|
+
"ksef"
|
|
223
|
+
];
|
|
215
224
|
var LIVE_GENERATE_PRESETS = [
|
|
216
225
|
{ id: "xrechnung", label: "XRechnung", standard: "xrechnung", output: "xml" },
|
|
217
226
|
{ id: "factur-x", label: "Factur-X", standard: "facturx", output: "pdf", facturxProfile: "en16931" },
|
|
@@ -224,7 +233,11 @@ var LIVE_PROFILES_BY_STANDARD = {
|
|
|
224
233
|
xrechnung: ["xrechnung"],
|
|
225
234
|
"peppol-bis": ["peppol", "romania-ro-cius", "netherlands-nlcius"],
|
|
226
235
|
zugferd: ["basicwl", "en16931", "extended"],
|
|
227
|
-
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"]
|
|
236
|
+
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"],
|
|
237
|
+
fatturapa: ["ordinaria"],
|
|
238
|
+
facturae: ["ordinaria"],
|
|
239
|
+
eslog: ["eracun"],
|
|
240
|
+
ksef: ["fa3"]
|
|
228
241
|
};
|
|
229
242
|
function profilesForStandard(standard) {
|
|
230
243
|
return LIVE_PROFILES_BY_STANDARD[standard] ?? [];
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlainObject, a as DocumentInput } from './constants-
|
|
2
|
-
export { D as DEFAULT_BASE_URL, n as DEFAULT_MAX_RETRIES, o as DEFAULT_TIMEOUT_MS, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, l as isProfileAllowedForStandard, p as profilesForStandard } from './constants-
|
|
1
|
+
import { P as PlainObject, a as DocumentInput } from './constants-DFGl_MXW.cjs';
|
|
2
|
+
export { D as DEFAULT_BASE_URL, n as DEFAULT_MAX_RETRIES, o as DEFAULT_TIMEOUT_MS, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, l as isProfileAllowedForStandard, p as profilesForStandard } from './constants-DFGl_MXW.cjs';
|
|
3
3
|
|
|
4
4
|
interface components {
|
|
5
5
|
schemas: {
|
|
@@ -1087,6 +1087,9 @@ interface operations {
|
|
|
1087
1087
|
data?: {
|
|
1088
1088
|
format: "cii" | "ubl";
|
|
1089
1089
|
profileDetected?: string;
|
|
1090
|
+
profileUrn?: string;
|
|
1091
|
+
businessProcessId?: string;
|
|
1092
|
+
franceCtcDetected?: boolean;
|
|
1090
1093
|
invoice: {
|
|
1091
1094
|
number: string;
|
|
1092
1095
|
issueDate: string;
|
|
@@ -1356,6 +1359,16 @@ interface operations {
|
|
|
1356
1359
|
gv?: "1" | "2";
|
|
1357
1360
|
};
|
|
1358
1361
|
};
|
|
1362
|
+
warnings: {
|
|
1363
|
+
code: "PARSE_NOT_RETURNED" | "PARSE_VALUE_NOT_FOUND";
|
|
1364
|
+
message: string;
|
|
1365
|
+
field?: string;
|
|
1366
|
+
terms?: string[];
|
|
1367
|
+
elements?: {
|
|
1368
|
+
path: string;
|
|
1369
|
+
count: number;
|
|
1370
|
+
}[];
|
|
1371
|
+
}[];
|
|
1359
1372
|
};
|
|
1360
1373
|
error?: {
|
|
1361
1374
|
code: "VALIDATION_ERROR" | "INVALID_INVOICE" | "PROFILE_STANDARD_MISMATCH" | "DOCUMENT_TYPE_STANDARD_MISMATCH" | "PARSE_FAILED" | "AUTHENTICATION_REQUIRED" | "INVALID_API_KEY" | "INSUFFICIENT_ROLE" | "QUOTA_EXCEEDED" | "RATE_LIMITED" | "ACCOUNT_THROTTLED" | "ENGINE_UNAVAILABLE" | "INTERNAL_ERROR" | "NOT_FOUND" | "CONVERSION_UNSUPPORTED_PAIR" | "CONVERSION_LOSSY_FAILCLOSED" | "CONVERSION_TOOL_UNAVAILABLE" | "CONVERSION_TOOL_ERROR" | "PDF_TEMPLATE_AUTH_REQUIRED" | "PDF_TEMPLATE_NOT_FOUND" | "PDF_TEMPLATE_INVALID" | "TRANSMISSION_DISABLED" | "TRANSMISSION_NO_PROVIDER" | "IDEMPOTENCY_KEY_REUSED" | "INVALID_IDEMPOTENCY_KEY" | "SENDER_NOT_REGISTERED" | "CONTENT_ALREADY_SENT" | "INBOX_UNKNOWN_PROVIDER" | "INBOX_VERIFICATION_FAILED" | "INBOX_SIGNATURE_EXPIRED" | "ENROLLMENT_MODE_UNSUPPORTED" | "ENROLLMENT_REFUSED" | "RECIPIENT_NOT_ROUTABLE" | "SENDER_COUNTRY_MISSING" | "DOCUMENT_PARTY_MISMATCH" | "FRENCH_DOMESTIC_FLOW" | "FRANCE_CTC_BLOCKING_FINDINGS" | "FRANCE_CTC_NOT_JUDGED" | "FRANCE_INVOICE_NUMBER_BURNED" | "UNSUPPORTED_SYNTAX" | "MALFORMED_DOCUMENT" | "EMPTY_DOCUMENT" | "MISSING_CUSTOMIZATION_ID" | "MISSING_PROCESS_ID";
|
|
@@ -1941,6 +1954,9 @@ type Severity = ValidationIssue['severity'];
|
|
|
1941
1954
|
type ValidationFormat = ValidationResult['format'];
|
|
1942
1955
|
/** Structured invoice extracted from a document (POST /v1/parse). */
|
|
1943
1956
|
type ParseResult = Json200Data<'parseInvoice'>;
|
|
1957
|
+
/** One warning about what the document holds and the parsed invoice does not. */
|
|
1958
|
+
type ParseWarning = ParseResult['warnings'][number];
|
|
1959
|
+
type ParseWarningCode = ParseWarning['code'];
|
|
1944
1960
|
/** The JSON-mode generate envelope (Accept: application/json): the seal. */
|
|
1945
1961
|
type GenerateResponse = Json200Data<'generateInvoice'>;
|
|
1946
1962
|
/** One row of the ruleset fingerprint (key, version, file hash). */
|
|
@@ -2104,4 +2120,4 @@ declare class BeliqApiError extends Error {
|
|
|
2104
2120
|
});
|
|
2105
2121
|
}
|
|
2106
2122
|
|
|
2107
|
-
export { type AccountInfo, type ApiError, type ApiErrorCode, Beliq, BeliqApiError, type BeliqOptions, type ConvertMeta, type ConvertOptions, type ConvertResult, type ConvertSourceFormat, type ConvertTargetFormat, DocumentInput, type DocumentOptions, type FacturxProfile, type GenerateBody, type GenerateInput, type GenerateMeta, type GenerateProfile, type GenerateResponse, type GenerateResult, type Invoice, type ParseFormat, type ParseOptions, type ParseResult, type RulesetArtifact, type Severity, type Standard, type ValidateFormat, type ValidateOptions, type ValidationFormat, type ValidationIssue, type ValidationResult };
|
|
2123
|
+
export { type AccountInfo, type ApiError, type ApiErrorCode, Beliq, BeliqApiError, type BeliqOptions, type ConvertMeta, type ConvertOptions, type ConvertResult, type ConvertSourceFormat, type ConvertTargetFormat, DocumentInput, type DocumentOptions, type FacturxProfile, type GenerateBody, type GenerateInput, type GenerateMeta, type GenerateProfile, type GenerateResponse, type GenerateResult, type Invoice, type ParseFormat, type ParseOptions, type ParseResult, type ParseWarning, type ParseWarningCode, type RulesetArtifact, type Severity, type Standard, type ValidateFormat, type ValidateOptions, type ValidationFormat, type ValidationIssue, type ValidationResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlainObject, a as DocumentInput } from './constants-
|
|
2
|
-
export { D as DEFAULT_BASE_URL, n as DEFAULT_MAX_RETRIES, o as DEFAULT_TIMEOUT_MS, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, l as isProfileAllowedForStandard, p as profilesForStandard } from './constants-
|
|
1
|
+
import { P as PlainObject, a as DocumentInput } from './constants-DFGl_MXW.js';
|
|
2
|
+
export { D as DEFAULT_BASE_URL, n as DEFAULT_MAX_RETRIES, o as DEFAULT_TIMEOUT_MS, G as GeneratePreset, L as LIVE_CONVERT_SOURCE_FORMATS, b as LIVE_CONVERT_TARGET_FORMATS, c as LIVE_GENERATE_PRESETS, d as LIVE_GENERATE_STANDARDS, e as LIVE_PARSE_FORMATS, f as LIVE_PROFILES, g as LIVE_PROFILES_BY_STANDARD, h as LIVE_VALIDATE_FORMATS, l as isProfileAllowedForStandard, p as profilesForStandard } from './constants-DFGl_MXW.js';
|
|
3
3
|
|
|
4
4
|
interface components {
|
|
5
5
|
schemas: {
|
|
@@ -1087,6 +1087,9 @@ interface operations {
|
|
|
1087
1087
|
data?: {
|
|
1088
1088
|
format: "cii" | "ubl";
|
|
1089
1089
|
profileDetected?: string;
|
|
1090
|
+
profileUrn?: string;
|
|
1091
|
+
businessProcessId?: string;
|
|
1092
|
+
franceCtcDetected?: boolean;
|
|
1090
1093
|
invoice: {
|
|
1091
1094
|
number: string;
|
|
1092
1095
|
issueDate: string;
|
|
@@ -1356,6 +1359,16 @@ interface operations {
|
|
|
1356
1359
|
gv?: "1" | "2";
|
|
1357
1360
|
};
|
|
1358
1361
|
};
|
|
1362
|
+
warnings: {
|
|
1363
|
+
code: "PARSE_NOT_RETURNED" | "PARSE_VALUE_NOT_FOUND";
|
|
1364
|
+
message: string;
|
|
1365
|
+
field?: string;
|
|
1366
|
+
terms?: string[];
|
|
1367
|
+
elements?: {
|
|
1368
|
+
path: string;
|
|
1369
|
+
count: number;
|
|
1370
|
+
}[];
|
|
1371
|
+
}[];
|
|
1359
1372
|
};
|
|
1360
1373
|
error?: {
|
|
1361
1374
|
code: "VALIDATION_ERROR" | "INVALID_INVOICE" | "PROFILE_STANDARD_MISMATCH" | "DOCUMENT_TYPE_STANDARD_MISMATCH" | "PARSE_FAILED" | "AUTHENTICATION_REQUIRED" | "INVALID_API_KEY" | "INSUFFICIENT_ROLE" | "QUOTA_EXCEEDED" | "RATE_LIMITED" | "ACCOUNT_THROTTLED" | "ENGINE_UNAVAILABLE" | "INTERNAL_ERROR" | "NOT_FOUND" | "CONVERSION_UNSUPPORTED_PAIR" | "CONVERSION_LOSSY_FAILCLOSED" | "CONVERSION_TOOL_UNAVAILABLE" | "CONVERSION_TOOL_ERROR" | "PDF_TEMPLATE_AUTH_REQUIRED" | "PDF_TEMPLATE_NOT_FOUND" | "PDF_TEMPLATE_INVALID" | "TRANSMISSION_DISABLED" | "TRANSMISSION_NO_PROVIDER" | "IDEMPOTENCY_KEY_REUSED" | "INVALID_IDEMPOTENCY_KEY" | "SENDER_NOT_REGISTERED" | "CONTENT_ALREADY_SENT" | "INBOX_UNKNOWN_PROVIDER" | "INBOX_VERIFICATION_FAILED" | "INBOX_SIGNATURE_EXPIRED" | "ENROLLMENT_MODE_UNSUPPORTED" | "ENROLLMENT_REFUSED" | "RECIPIENT_NOT_ROUTABLE" | "SENDER_COUNTRY_MISSING" | "DOCUMENT_PARTY_MISMATCH" | "FRENCH_DOMESTIC_FLOW" | "FRANCE_CTC_BLOCKING_FINDINGS" | "FRANCE_CTC_NOT_JUDGED" | "FRANCE_INVOICE_NUMBER_BURNED" | "UNSUPPORTED_SYNTAX" | "MALFORMED_DOCUMENT" | "EMPTY_DOCUMENT" | "MISSING_CUSTOMIZATION_ID" | "MISSING_PROCESS_ID";
|
|
@@ -1941,6 +1954,9 @@ type Severity = ValidationIssue['severity'];
|
|
|
1941
1954
|
type ValidationFormat = ValidationResult['format'];
|
|
1942
1955
|
/** Structured invoice extracted from a document (POST /v1/parse). */
|
|
1943
1956
|
type ParseResult = Json200Data<'parseInvoice'>;
|
|
1957
|
+
/** One warning about what the document holds and the parsed invoice does not. */
|
|
1958
|
+
type ParseWarning = ParseResult['warnings'][number];
|
|
1959
|
+
type ParseWarningCode = ParseWarning['code'];
|
|
1944
1960
|
/** The JSON-mode generate envelope (Accept: application/json): the seal. */
|
|
1945
1961
|
type GenerateResponse = Json200Data<'generateInvoice'>;
|
|
1946
1962
|
/** One row of the ruleset fingerprint (key, version, file hash). */
|
|
@@ -2104,4 +2120,4 @@ declare class BeliqApiError extends Error {
|
|
|
2104
2120
|
});
|
|
2105
2121
|
}
|
|
2106
2122
|
|
|
2107
|
-
export { type AccountInfo, type ApiError, type ApiErrorCode, Beliq, BeliqApiError, type BeliqOptions, type ConvertMeta, type ConvertOptions, type ConvertResult, type ConvertSourceFormat, type ConvertTargetFormat, DocumentInput, type DocumentOptions, type FacturxProfile, type GenerateBody, type GenerateInput, type GenerateMeta, type GenerateProfile, type GenerateResponse, type GenerateResult, type Invoice, type ParseFormat, type ParseOptions, type ParseResult, type RulesetArtifact, type Severity, type Standard, type ValidateFormat, type ValidateOptions, type ValidationFormat, type ValidationIssue, type ValidationResult };
|
|
2123
|
+
export { type AccountInfo, type ApiError, type ApiErrorCode, Beliq, BeliqApiError, type BeliqOptions, type ConvertMeta, type ConvertOptions, type ConvertResult, type ConvertSourceFormat, type ConvertTargetFormat, DocumentInput, type DocumentOptions, type FacturxProfile, type GenerateBody, type GenerateInput, type GenerateMeta, type GenerateProfile, type GenerateResponse, type GenerateResult, type Invoice, type ParseFormat, type ParseOptions, type ParseResult, type ParseWarning, type ParseWarningCode, type RulesetArtifact, type Severity, type Standard, type ValidateFormat, type ValidateOptions, type ValidationFormat, type ValidationIssue, type ValidationResult };
|
package/dist/index.js
CHANGED
|
@@ -171,7 +171,16 @@ function errorFromResponse(status, bytes) {
|
|
|
171
171
|
var DEFAULT_BASE_URL = "https://api.beliq.eu";
|
|
172
172
|
var DEFAULT_TIMEOUT_MS = 9e4;
|
|
173
173
|
var DEFAULT_MAX_RETRIES = 3;
|
|
174
|
-
var LIVE_GENERATE_STANDARDS = [
|
|
174
|
+
var LIVE_GENERATE_STANDARDS = [
|
|
175
|
+
"xrechnung",
|
|
176
|
+
"zugferd",
|
|
177
|
+
"facturx",
|
|
178
|
+
"peppol-bis",
|
|
179
|
+
"fatturapa",
|
|
180
|
+
"facturae",
|
|
181
|
+
"eslog",
|
|
182
|
+
"ksef"
|
|
183
|
+
];
|
|
175
184
|
var LIVE_GENERATE_PRESETS = [
|
|
176
185
|
{ id: "xrechnung", label: "XRechnung", standard: "xrechnung", output: "xml" },
|
|
177
186
|
{ id: "factur-x", label: "Factur-X", standard: "facturx", output: "pdf", facturxProfile: "en16931" },
|
|
@@ -184,7 +193,11 @@ var LIVE_PROFILES_BY_STANDARD = {
|
|
|
184
193
|
xrechnung: ["xrechnung"],
|
|
185
194
|
"peppol-bis": ["peppol", "romania-ro-cius", "netherlands-nlcius"],
|
|
186
195
|
zugferd: ["basicwl", "en16931", "extended"],
|
|
187
|
-
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"]
|
|
196
|
+
facturx: ["basicwl", "en16931", "extended", "extended-ctc-fr"],
|
|
197
|
+
fatturapa: ["ordinaria"],
|
|
198
|
+
facturae: ["ordinaria"],
|
|
199
|
+
eslog: ["eracun"],
|
|
200
|
+
ksef: ["fa3"]
|
|
188
201
|
};
|
|
189
202
|
function profilesForStandard(standard) {
|
|
190
203
|
return LIVE_PROFILES_BY_STANDARD[standard] ?? [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beliq/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
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",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"clean": "rm -rf dist",
|
|
70
70
|
"build": "npm run clean && tsup",
|
|
71
71
|
"typecheck": "tsc --noEmit",
|
|
72
|
-
"lint": "eslint src test",
|
|
73
|
-
"lint:fix": "eslint src test --fix",
|
|
72
|
+
"lint": "eslint src test scripts",
|
|
73
|
+
"lint:fix": "eslint src test scripts --fix",
|
|
74
74
|
"scrub:check": "bash scripts/scrub-check.sh",
|
|
75
75
|
"sync:spec": "node scripts/sync-spec.mjs",
|
|
76
76
|
"gen:types": "node scripts/gen-types.mjs",
|