@beliq/sdk 0.4.5 → 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 CHANGED
@@ -4,6 +4,23 @@
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
+
7
24
  ## 0.4.5 - 2026-10-03
8
25
 
9
26
  - `LIVE_GENERATE_STANDARDS` carries all eight standards `POST /v1/generate`
package/dist/index.d.cts CHANGED
@@ -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
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beliq/sdk",
3
- "version": "0.4.5",
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",