@beliq/sdk 0.4.2 → 0.4.5
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 +62 -1
- package/README.md +1 -1
- package/dist/{constants-BZuNzqbV.d.cts → constants-DFGl_MXW.d.cts} +15 -6
- package/dist/{constants-BZuNzqbV.d.ts → constants-DFGl_MXW.d.ts} +15 -6
- 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 +21 -3
- package/dist/index.d.cts +190 -47
- package/dist/index.d.ts +190 -47
- package/dist/index.js +21 -3
- package/package.json +1 -1
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] ?? [];
|
|
@@ -292,6 +305,11 @@ async function send(config, req) {
|
|
|
292
305
|
|
|
293
306
|
// src/client.ts
|
|
294
307
|
var TEST_KEY_PREFIX = "blq_test_";
|
|
308
|
+
function trimTrailingSlashes(url) {
|
|
309
|
+
let end = url.length;
|
|
310
|
+
while (end > 0 && url[end - 1] === "/") end--;
|
|
311
|
+
return url.slice(0, end);
|
|
312
|
+
}
|
|
295
313
|
function livemodeHeader(headers) {
|
|
296
314
|
const raw = headers.get("x-beliq-livemode");
|
|
297
315
|
if (raw === "true") return true;
|
|
@@ -356,7 +374,7 @@ var Beliq = class {
|
|
|
356
374
|
this.livemode = !options.apiKey.startsWith(TEST_KEY_PREFIX);
|
|
357
375
|
this.#config = {
|
|
358
376
|
apiKey: options.apiKey,
|
|
359
|
-
baseUrl: (options.baseUrl ?? DEFAULT_BASE_URL)
|
|
377
|
+
baseUrl: trimTrailingSlashes(options.baseUrl ?? DEFAULT_BASE_URL),
|
|
360
378
|
auth: options.auth ?? "header",
|
|
361
379
|
fetchImpl,
|
|
362
380
|
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beliq/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
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",
|