@beliq/sdk 0.4.6 → 0.5.0
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 +37 -0
- package/dist/index.d.cts +35 -235
- package/dist/index.d.ts +35 -235
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,43 @@
|
|
|
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.5.0 - 2026-10-08
|
|
8
|
+
|
|
9
|
+
A minor, because code that reads a `parse()` result can stop compiling, and a
|
|
10
|
+
`^0.4.0` range does not reach a minor. Only the types of `parse()` change. No
|
|
11
|
+
method does.
|
|
12
|
+
|
|
13
|
+
- `ParseResult['invoice']` is the invoice `POST /v1/parse` declares for its
|
|
14
|
+
answer, where it was the invoice `generate()` takes. It lists the 13 fields
|
|
15
|
+
the parser returns, and only `lines` is always present:
|
|
16
|
+
`result.invoice.number` was a `string` and is a `string | undefined`. Below
|
|
17
|
+
the invoice nothing is required but the `id` of a `delivery.locationId`,
|
|
18
|
+
which is optional itself. The 35 fields of the generate invoice that parse
|
|
19
|
+
does not return, such as `allowances`, `paymentMeans` and `taxSummary`, are
|
|
20
|
+
gone from the type. A line lists 7 fields where it listed 20, a party 4
|
|
21
|
+
where it listed 9, and a party's address 5 where it listed 9.
|
|
22
|
+
- What stops compiling: a read of a field parse does not return, and
|
|
23
|
+
`result.invoice` passed where an `Invoice` is expected, or a party, a line,
|
|
24
|
+
an address or the delivery of it passed where that part of an `Invoice` is.
|
|
25
|
+
With `strictNullChecks` on, which `strict` includes, so does a field used
|
|
26
|
+
as always present, such as `result.invoice.seller.name` or a `string` taken
|
|
27
|
+
from `result.invoice.number`. Check for a field before reading it.
|
|
28
|
+
- The types follow the API, which changed first. Since 2026-10-07
|
|
29
|
+
`POST /v1/parse` returns a field only when the parser has a value for it,
|
|
30
|
+
and puts nothing in the place of an absent one. `parse()` hands the answer
|
|
31
|
+
on as it is, so an installed 0.4.6 gets the same answer, and its types still
|
|
32
|
+
say that nine fields of the invoice are always there, and more inside a
|
|
33
|
+
party, an address and a line.
|
|
34
|
+
https://beliq.eu/changelog/ has the API change under that date.
|
|
35
|
+
https://docs.beliq.eu/api-reference/parse/ says what an absent field means,
|
|
36
|
+
and when a `PARSE_VALUE_NOT_FOUND` warning in `result.warnings` names it.
|
|
37
|
+
- The vendored `openapi.json` is document `0.12.0` of the API, up from
|
|
38
|
+
`0.9.0`. Besides the parsed invoice one thing differs: the 14 nullable
|
|
39
|
+
fields of `GET /v1/me` and `GET /v1/rulesets` are spelled with
|
|
40
|
+
`nullable: true`, which is what OpenAPI 3.0 has for a nullable field, where
|
|
41
|
+
each had an `anyOf` with a `"type": "null"` arm. The type generated for each
|
|
42
|
+
of the 14 is the same, and two gain an `@enum` doc tag.
|
|
43
|
+
|
|
7
44
|
## 0.4.6 - 2026-10-06
|
|
8
45
|
|
|
9
46
|
- The vendored `openapi.json` carries the four fields `POST /v1/parse` answers
|
package/dist/index.d.cts
CHANGED
|
@@ -1091,172 +1091,44 @@ interface operations {
|
|
|
1091
1091
|
businessProcessId?: string;
|
|
1092
1092
|
franceCtcDetected?: boolean;
|
|
1093
1093
|
invoice: {
|
|
1094
|
-
number
|
|
1095
|
-
issueDate
|
|
1096
|
-
|
|
1097
|
-
vatPointDate?: string;
|
|
1098
|
-
vatPointDateCode?: "3" | "35" | "432";
|
|
1099
|
-
invoicingPeriod?: {
|
|
1100
|
-
startDate?: string;
|
|
1101
|
-
endDate?: string;
|
|
1102
|
-
};
|
|
1103
|
-
currencyCode: string;
|
|
1104
|
-
taxCurrencyCode?: string;
|
|
1105
|
-
taxTotalInAccountingCurrency?: number;
|
|
1094
|
+
number?: string;
|
|
1095
|
+
issueDate?: string;
|
|
1096
|
+
currencyCode?: string;
|
|
1106
1097
|
documentType?: "invoice" | "creditnote";
|
|
1107
1098
|
typeCode?: string;
|
|
1108
|
-
precedingInvoiceReference?: {
|
|
1109
|
-
id: string;
|
|
1110
|
-
issueDate?: string;
|
|
1111
|
-
};
|
|
1112
1099
|
buyerReference?: string;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
contractReference?: string;
|
|
1116
|
-
projectReference?: string;
|
|
1117
|
-
receivingAdviceReference?: string;
|
|
1118
|
-
despatchAdviceReference?: string;
|
|
1119
|
-
tenderReference?: string;
|
|
1120
|
-
invoicedObjectIdentifier?: {
|
|
1121
|
-
id: string;
|
|
1122
|
-
schemeId?: string;
|
|
1123
|
-
};
|
|
1124
|
-
buyerAccountingReference?: string;
|
|
1125
|
-
supportingDocuments?: {
|
|
1126
|
-
id: string;
|
|
1127
|
-
description?: string;
|
|
1128
|
-
externalLocation?: string;
|
|
1129
|
-
attachment?: {
|
|
1130
|
-
content: string;
|
|
1131
|
-
mimeCode: string;
|
|
1132
|
-
filename: string;
|
|
1133
|
-
};
|
|
1134
|
-
}[];
|
|
1135
|
-
note?: string;
|
|
1136
|
-
seller: {
|
|
1137
|
-
name: string;
|
|
1100
|
+
seller?: {
|
|
1101
|
+
name?: string;
|
|
1138
1102
|
vatId?: string;
|
|
1139
1103
|
taxId?: string;
|
|
1140
|
-
|
|
1141
|
-
/** Format: email */
|
|
1142
|
-
email?: string;
|
|
1143
|
-
phone?: string;
|
|
1144
|
-
address: {
|
|
1104
|
+
address?: {
|
|
1145
1105
|
street?: string;
|
|
1146
1106
|
additionalStreet?: string;
|
|
1147
|
-
city
|
|
1148
|
-
postalCode
|
|
1149
|
-
countryCode
|
|
1150
|
-
state?: string;
|
|
1151
|
-
region?: string;
|
|
1152
|
-
province?: string;
|
|
1153
|
-
countrySubentity?: string;
|
|
1154
|
-
};
|
|
1155
|
-
contactName?: string;
|
|
1156
|
-
peppol?: {
|
|
1157
|
-
schemeId: string;
|
|
1158
|
-
id: string;
|
|
1107
|
+
city?: string;
|
|
1108
|
+
postalCode?: string;
|
|
1109
|
+
countryCode?: string;
|
|
1159
1110
|
};
|
|
1160
1111
|
};
|
|
1161
|
-
buyer
|
|
1162
|
-
name
|
|
1112
|
+
buyer?: {
|
|
1113
|
+
name?: string;
|
|
1163
1114
|
vatId?: string;
|
|
1164
1115
|
taxId?: string;
|
|
1165
|
-
|
|
1166
|
-
/** Format: email */
|
|
1167
|
-
email?: string;
|
|
1168
|
-
phone?: string;
|
|
1169
|
-
address: {
|
|
1170
|
-
street?: string;
|
|
1171
|
-
additionalStreet?: string;
|
|
1172
|
-
city: string;
|
|
1173
|
-
postalCode: string;
|
|
1174
|
-
countryCode: string;
|
|
1175
|
-
state?: string;
|
|
1176
|
-
region?: string;
|
|
1177
|
-
province?: string;
|
|
1178
|
-
countrySubentity?: string;
|
|
1179
|
-
};
|
|
1180
|
-
contactName?: string;
|
|
1181
|
-
peppol?: {
|
|
1182
|
-
schemeId: string;
|
|
1183
|
-
id: string;
|
|
1184
|
-
};
|
|
1185
|
-
};
|
|
1186
|
-
payee?: {
|
|
1187
|
-
name: string;
|
|
1188
|
-
identifier?: {
|
|
1189
|
-
id: string;
|
|
1190
|
-
schemeId?: string;
|
|
1191
|
-
};
|
|
1192
|
-
registrationId?: string;
|
|
1193
|
-
};
|
|
1194
|
-
taxRepresentative?: {
|
|
1195
|
-
name: string;
|
|
1196
|
-
vatId: string;
|
|
1197
|
-
address: {
|
|
1116
|
+
address?: {
|
|
1198
1117
|
street?: string;
|
|
1199
1118
|
additionalStreet?: string;
|
|
1200
1119
|
city?: string;
|
|
1201
1120
|
postalCode?: string;
|
|
1202
|
-
countryCode
|
|
1203
|
-
countrySubentity?: string;
|
|
1121
|
+
countryCode?: string;
|
|
1204
1122
|
};
|
|
1205
1123
|
};
|
|
1206
1124
|
lines: {
|
|
1207
|
-
description
|
|
1208
|
-
quantity
|
|
1209
|
-
unitCode
|
|
1210
|
-
unitPrice
|
|
1211
|
-
lineTotal
|
|
1212
|
-
vatRate
|
|
1213
|
-
vatCategoryCode
|
|
1214
|
-
itemId?: string;
|
|
1215
|
-
buyerItemId?: string;
|
|
1216
|
-
grossPrice?: number;
|
|
1217
|
-
priceDiscount?: number;
|
|
1218
|
-
priceBaseQuantity?: number;
|
|
1219
|
-
standardItemId?: {
|
|
1220
|
-
id: string;
|
|
1221
|
-
schemeId: string;
|
|
1222
|
-
};
|
|
1223
|
-
classifications?: {
|
|
1224
|
-
code: string;
|
|
1225
|
-
listId: string;
|
|
1226
|
-
listVersionId?: string;
|
|
1227
|
-
}[];
|
|
1228
|
-
originCountryCode?: string;
|
|
1229
|
-
attributes?: {
|
|
1230
|
-
name: string;
|
|
1231
|
-
value: string;
|
|
1232
|
-
}[];
|
|
1233
|
-
allowances?: {
|
|
1234
|
-
amount: number;
|
|
1235
|
-
baseAmount?: number;
|
|
1236
|
-
percentage?: number;
|
|
1237
|
-
reason?: string;
|
|
1238
|
-
reasonCode?: string;
|
|
1239
|
-
}[];
|
|
1240
|
-
charges?: {
|
|
1241
|
-
amount: number;
|
|
1242
|
-
baseAmount?: number;
|
|
1243
|
-
percentage?: number;
|
|
1244
|
-
reason?: string;
|
|
1245
|
-
reasonCode?: string;
|
|
1246
|
-
}[];
|
|
1247
|
-
invoicingPeriod?: {
|
|
1248
|
-
startDate?: string;
|
|
1249
|
-
endDate?: string;
|
|
1250
|
-
};
|
|
1251
|
-
subLines?: components["schemas"]["InvoiceLine"][];
|
|
1252
|
-
}[];
|
|
1253
|
-
taxSummary?: {
|
|
1254
|
-
vatCategoryCode: string;
|
|
1255
|
-
vatRate: number;
|
|
1256
|
-
taxableAmount: number;
|
|
1257
|
-
taxAmount: number;
|
|
1258
|
-
exemptionReasonText?: string;
|
|
1259
|
-
exemptionReasonCode?: string;
|
|
1125
|
+
description?: string;
|
|
1126
|
+
quantity?: number;
|
|
1127
|
+
unitCode?: string;
|
|
1128
|
+
unitPrice?: number;
|
|
1129
|
+
lineTotal?: number;
|
|
1130
|
+
vatRate?: number;
|
|
1131
|
+
vatCategoryCode?: string;
|
|
1260
1132
|
}[];
|
|
1261
1133
|
delivery?: {
|
|
1262
1134
|
name?: string;
|
|
@@ -1270,94 +1142,13 @@ interface operations {
|
|
|
1270
1142
|
additionalStreet?: string;
|
|
1271
1143
|
city?: string;
|
|
1272
1144
|
postalCode?: string;
|
|
1273
|
-
countryCode: string;
|
|
1274
1145
|
countrySubentity?: string;
|
|
1146
|
+
countryCode?: string;
|
|
1275
1147
|
};
|
|
1276
1148
|
};
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
bic?: string;
|
|
1281
|
-
bankName?: string;
|
|
1282
|
-
paymentReference?: string;
|
|
1283
|
-
information?: string;
|
|
1284
|
-
mandateReference?: string;
|
|
1285
|
-
creditorId?: string;
|
|
1286
|
-
debitedAccountId?: string;
|
|
1287
|
-
};
|
|
1288
|
-
paymentTerms?: string;
|
|
1289
|
-
allowances?: {
|
|
1290
|
-
amount: number;
|
|
1291
|
-
baseAmount?: number;
|
|
1292
|
-
percentage?: number;
|
|
1293
|
-
reason?: string;
|
|
1294
|
-
reasonCode?: string;
|
|
1295
|
-
vatCategoryCode: string;
|
|
1296
|
-
vatRate?: number;
|
|
1297
|
-
}[];
|
|
1298
|
-
charges?: {
|
|
1299
|
-
amount: number;
|
|
1300
|
-
baseAmount?: number;
|
|
1301
|
-
percentage?: number;
|
|
1302
|
-
reason?: string;
|
|
1303
|
-
reasonCode?: string;
|
|
1304
|
-
vatCategoryCode: string;
|
|
1305
|
-
vatRate?: number;
|
|
1306
|
-
}[];
|
|
1307
|
-
totalNetAmount: number;
|
|
1308
|
-
totalTaxAmount: number;
|
|
1309
|
-
totalGrossAmount: number;
|
|
1310
|
-
paidAmount?: number;
|
|
1311
|
-
roundingAmount?: number;
|
|
1312
|
-
franceCtc?: boolean;
|
|
1313
|
-
businessProcessId?: "S8" | "B8" | "M8";
|
|
1314
|
-
italy?: {
|
|
1315
|
-
codiceDestinatario?: string;
|
|
1316
|
-
regimeFiscale?: string;
|
|
1317
|
-
progressivoInvio?: string;
|
|
1318
|
-
idTrasmittente?: {
|
|
1319
|
-
country: string;
|
|
1320
|
-
id: string;
|
|
1321
|
-
};
|
|
1322
|
-
tipoDocumento?: string;
|
|
1323
|
-
condizioniPagamento?: string;
|
|
1324
|
-
modalitaPagamento?: string;
|
|
1325
|
-
esigibilitaIVA?: string;
|
|
1326
|
-
causale?: string[];
|
|
1327
|
-
};
|
|
1328
|
-
romania?: Record<string, never>;
|
|
1329
|
-
netherlands?: Record<string, never>;
|
|
1330
|
-
spain?: {
|
|
1331
|
-
modality?: "I" | "L";
|
|
1332
|
-
invoiceIssuerType?: "EM" | "RE" | "TE";
|
|
1333
|
-
invoiceDocumentType?: string;
|
|
1334
|
-
invoiceClass?: string;
|
|
1335
|
-
taxTypeCode?: string;
|
|
1336
|
-
languageName?: string;
|
|
1337
|
-
batchIdentifier?: string;
|
|
1338
|
-
seller?: {
|
|
1339
|
-
personTypeCode?: "J" | "F";
|
|
1340
|
-
residenceTypeCode?: "R" | "U" | "E";
|
|
1341
|
-
};
|
|
1342
|
-
buyer?: {
|
|
1343
|
-
personTypeCode?: "J" | "F";
|
|
1344
|
-
residenceTypeCode?: "R" | "U" | "E";
|
|
1345
|
-
};
|
|
1346
|
-
};
|
|
1347
|
-
slovenia?: Record<string, never>;
|
|
1348
|
-
poland?: {
|
|
1349
|
-
adnotacje?: {
|
|
1350
|
-
P_16?: "1" | "2";
|
|
1351
|
-
P_17?: "1" | "2";
|
|
1352
|
-
P_18?: "1" | "2";
|
|
1353
|
-
P_18A?: "1" | "2";
|
|
1354
|
-
P_23?: "1" | "2";
|
|
1355
|
-
};
|
|
1356
|
-
dataWytworzenia?: string;
|
|
1357
|
-
placeOfIssue?: string;
|
|
1358
|
-
jst?: "1" | "2";
|
|
1359
|
-
gv?: "1" | "2";
|
|
1360
|
-
};
|
|
1149
|
+
totalNetAmount?: number;
|
|
1150
|
+
totalTaxAmount?: number;
|
|
1151
|
+
totalGrossAmount?: number;
|
|
1361
1152
|
};
|
|
1362
1153
|
warnings: {
|
|
1363
1154
|
code: "PARSE_NOT_RETURNED" | "PARSE_VALUE_NOT_FOUND";
|
|
@@ -1824,6 +1615,7 @@ interface operations {
|
|
|
1824
1615
|
rulesetVersion: string;
|
|
1825
1616
|
rulesetArtefact: string;
|
|
1826
1617
|
versionKey: string;
|
|
1618
|
+
/** @enum {string|null} */
|
|
1827
1619
|
verificationTier: "conformance-verified" | "builder-round-trip" | "reconstructed-rules" | "xsd-structural" | null;
|
|
1828
1620
|
rulesProvenance: "authority-conformance" | "authority-artifact" | "community" | "beliq-authored" | "none";
|
|
1829
1621
|
verificationBadge: "authority-verified" | "independently-rule-checked" | "structure-checked";
|
|
@@ -1850,7 +1642,10 @@ interface operations {
|
|
|
1850
1642
|
servingVersion: string;
|
|
1851
1643
|
/** @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. */
|
|
1852
1644
|
previousVersion: string | null;
|
|
1853
|
-
/**
|
|
1645
|
+
/**
|
|
1646
|
+
* @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`.
|
|
1647
|
+
* @enum {string|null}
|
|
1648
|
+
*/
|
|
1854
1649
|
fallbackReason: "sunset" | "notice-period" | "superseded" | null;
|
|
1855
1650
|
}[];
|
|
1856
1651
|
}[];
|
|
@@ -1952,7 +1747,12 @@ type ValidationResult = Json200Data<'validateInvoice'>;
|
|
|
1952
1747
|
type ValidationIssue = ValidationResult['errors'][number];
|
|
1953
1748
|
type Severity = ValidationIssue['severity'];
|
|
1954
1749
|
type ValidationFormat = ValidationResult['format'];
|
|
1955
|
-
/**
|
|
1750
|
+
/**
|
|
1751
|
+
* What POST /v1/parse read from a document. Of `invoice`, only `lines` is
|
|
1752
|
+
* always present. Every other field is left out when the answer holds no value
|
|
1753
|
+
* for it, so check for a field before reading it.
|
|
1754
|
+
* https://docs.beliq.eu/api-reference/parse/ says what an absent field means.
|
|
1755
|
+
*/
|
|
1956
1756
|
type ParseResult = Json200Data<'parseInvoice'>;
|
|
1957
1757
|
/** One warning about what the document holds and the parsed invoice does not. */
|
|
1958
1758
|
type ParseWarning = ParseResult['warnings'][number];
|
package/dist/index.d.ts
CHANGED
|
@@ -1091,172 +1091,44 @@ interface operations {
|
|
|
1091
1091
|
businessProcessId?: string;
|
|
1092
1092
|
franceCtcDetected?: boolean;
|
|
1093
1093
|
invoice: {
|
|
1094
|
-
number
|
|
1095
|
-
issueDate
|
|
1096
|
-
|
|
1097
|
-
vatPointDate?: string;
|
|
1098
|
-
vatPointDateCode?: "3" | "35" | "432";
|
|
1099
|
-
invoicingPeriod?: {
|
|
1100
|
-
startDate?: string;
|
|
1101
|
-
endDate?: string;
|
|
1102
|
-
};
|
|
1103
|
-
currencyCode: string;
|
|
1104
|
-
taxCurrencyCode?: string;
|
|
1105
|
-
taxTotalInAccountingCurrency?: number;
|
|
1094
|
+
number?: string;
|
|
1095
|
+
issueDate?: string;
|
|
1096
|
+
currencyCode?: string;
|
|
1106
1097
|
documentType?: "invoice" | "creditnote";
|
|
1107
1098
|
typeCode?: string;
|
|
1108
|
-
precedingInvoiceReference?: {
|
|
1109
|
-
id: string;
|
|
1110
|
-
issueDate?: string;
|
|
1111
|
-
};
|
|
1112
1099
|
buyerReference?: string;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
contractReference?: string;
|
|
1116
|
-
projectReference?: string;
|
|
1117
|
-
receivingAdviceReference?: string;
|
|
1118
|
-
despatchAdviceReference?: string;
|
|
1119
|
-
tenderReference?: string;
|
|
1120
|
-
invoicedObjectIdentifier?: {
|
|
1121
|
-
id: string;
|
|
1122
|
-
schemeId?: string;
|
|
1123
|
-
};
|
|
1124
|
-
buyerAccountingReference?: string;
|
|
1125
|
-
supportingDocuments?: {
|
|
1126
|
-
id: string;
|
|
1127
|
-
description?: string;
|
|
1128
|
-
externalLocation?: string;
|
|
1129
|
-
attachment?: {
|
|
1130
|
-
content: string;
|
|
1131
|
-
mimeCode: string;
|
|
1132
|
-
filename: string;
|
|
1133
|
-
};
|
|
1134
|
-
}[];
|
|
1135
|
-
note?: string;
|
|
1136
|
-
seller: {
|
|
1137
|
-
name: string;
|
|
1100
|
+
seller?: {
|
|
1101
|
+
name?: string;
|
|
1138
1102
|
vatId?: string;
|
|
1139
1103
|
taxId?: string;
|
|
1140
|
-
|
|
1141
|
-
/** Format: email */
|
|
1142
|
-
email?: string;
|
|
1143
|
-
phone?: string;
|
|
1144
|
-
address: {
|
|
1104
|
+
address?: {
|
|
1145
1105
|
street?: string;
|
|
1146
1106
|
additionalStreet?: string;
|
|
1147
|
-
city
|
|
1148
|
-
postalCode
|
|
1149
|
-
countryCode
|
|
1150
|
-
state?: string;
|
|
1151
|
-
region?: string;
|
|
1152
|
-
province?: string;
|
|
1153
|
-
countrySubentity?: string;
|
|
1154
|
-
};
|
|
1155
|
-
contactName?: string;
|
|
1156
|
-
peppol?: {
|
|
1157
|
-
schemeId: string;
|
|
1158
|
-
id: string;
|
|
1107
|
+
city?: string;
|
|
1108
|
+
postalCode?: string;
|
|
1109
|
+
countryCode?: string;
|
|
1159
1110
|
};
|
|
1160
1111
|
};
|
|
1161
|
-
buyer
|
|
1162
|
-
name
|
|
1112
|
+
buyer?: {
|
|
1113
|
+
name?: string;
|
|
1163
1114
|
vatId?: string;
|
|
1164
1115
|
taxId?: string;
|
|
1165
|
-
|
|
1166
|
-
/** Format: email */
|
|
1167
|
-
email?: string;
|
|
1168
|
-
phone?: string;
|
|
1169
|
-
address: {
|
|
1170
|
-
street?: string;
|
|
1171
|
-
additionalStreet?: string;
|
|
1172
|
-
city: string;
|
|
1173
|
-
postalCode: string;
|
|
1174
|
-
countryCode: string;
|
|
1175
|
-
state?: string;
|
|
1176
|
-
region?: string;
|
|
1177
|
-
province?: string;
|
|
1178
|
-
countrySubentity?: string;
|
|
1179
|
-
};
|
|
1180
|
-
contactName?: string;
|
|
1181
|
-
peppol?: {
|
|
1182
|
-
schemeId: string;
|
|
1183
|
-
id: string;
|
|
1184
|
-
};
|
|
1185
|
-
};
|
|
1186
|
-
payee?: {
|
|
1187
|
-
name: string;
|
|
1188
|
-
identifier?: {
|
|
1189
|
-
id: string;
|
|
1190
|
-
schemeId?: string;
|
|
1191
|
-
};
|
|
1192
|
-
registrationId?: string;
|
|
1193
|
-
};
|
|
1194
|
-
taxRepresentative?: {
|
|
1195
|
-
name: string;
|
|
1196
|
-
vatId: string;
|
|
1197
|
-
address: {
|
|
1116
|
+
address?: {
|
|
1198
1117
|
street?: string;
|
|
1199
1118
|
additionalStreet?: string;
|
|
1200
1119
|
city?: string;
|
|
1201
1120
|
postalCode?: string;
|
|
1202
|
-
countryCode
|
|
1203
|
-
countrySubentity?: string;
|
|
1121
|
+
countryCode?: string;
|
|
1204
1122
|
};
|
|
1205
1123
|
};
|
|
1206
1124
|
lines: {
|
|
1207
|
-
description
|
|
1208
|
-
quantity
|
|
1209
|
-
unitCode
|
|
1210
|
-
unitPrice
|
|
1211
|
-
lineTotal
|
|
1212
|
-
vatRate
|
|
1213
|
-
vatCategoryCode
|
|
1214
|
-
itemId?: string;
|
|
1215
|
-
buyerItemId?: string;
|
|
1216
|
-
grossPrice?: number;
|
|
1217
|
-
priceDiscount?: number;
|
|
1218
|
-
priceBaseQuantity?: number;
|
|
1219
|
-
standardItemId?: {
|
|
1220
|
-
id: string;
|
|
1221
|
-
schemeId: string;
|
|
1222
|
-
};
|
|
1223
|
-
classifications?: {
|
|
1224
|
-
code: string;
|
|
1225
|
-
listId: string;
|
|
1226
|
-
listVersionId?: string;
|
|
1227
|
-
}[];
|
|
1228
|
-
originCountryCode?: string;
|
|
1229
|
-
attributes?: {
|
|
1230
|
-
name: string;
|
|
1231
|
-
value: string;
|
|
1232
|
-
}[];
|
|
1233
|
-
allowances?: {
|
|
1234
|
-
amount: number;
|
|
1235
|
-
baseAmount?: number;
|
|
1236
|
-
percentage?: number;
|
|
1237
|
-
reason?: string;
|
|
1238
|
-
reasonCode?: string;
|
|
1239
|
-
}[];
|
|
1240
|
-
charges?: {
|
|
1241
|
-
amount: number;
|
|
1242
|
-
baseAmount?: number;
|
|
1243
|
-
percentage?: number;
|
|
1244
|
-
reason?: string;
|
|
1245
|
-
reasonCode?: string;
|
|
1246
|
-
}[];
|
|
1247
|
-
invoicingPeriod?: {
|
|
1248
|
-
startDate?: string;
|
|
1249
|
-
endDate?: string;
|
|
1250
|
-
};
|
|
1251
|
-
subLines?: components["schemas"]["InvoiceLine"][];
|
|
1252
|
-
}[];
|
|
1253
|
-
taxSummary?: {
|
|
1254
|
-
vatCategoryCode: string;
|
|
1255
|
-
vatRate: number;
|
|
1256
|
-
taxableAmount: number;
|
|
1257
|
-
taxAmount: number;
|
|
1258
|
-
exemptionReasonText?: string;
|
|
1259
|
-
exemptionReasonCode?: string;
|
|
1125
|
+
description?: string;
|
|
1126
|
+
quantity?: number;
|
|
1127
|
+
unitCode?: string;
|
|
1128
|
+
unitPrice?: number;
|
|
1129
|
+
lineTotal?: number;
|
|
1130
|
+
vatRate?: number;
|
|
1131
|
+
vatCategoryCode?: string;
|
|
1260
1132
|
}[];
|
|
1261
1133
|
delivery?: {
|
|
1262
1134
|
name?: string;
|
|
@@ -1270,94 +1142,13 @@ interface operations {
|
|
|
1270
1142
|
additionalStreet?: string;
|
|
1271
1143
|
city?: string;
|
|
1272
1144
|
postalCode?: string;
|
|
1273
|
-
countryCode: string;
|
|
1274
1145
|
countrySubentity?: string;
|
|
1146
|
+
countryCode?: string;
|
|
1275
1147
|
};
|
|
1276
1148
|
};
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
bic?: string;
|
|
1281
|
-
bankName?: string;
|
|
1282
|
-
paymentReference?: string;
|
|
1283
|
-
information?: string;
|
|
1284
|
-
mandateReference?: string;
|
|
1285
|
-
creditorId?: string;
|
|
1286
|
-
debitedAccountId?: string;
|
|
1287
|
-
};
|
|
1288
|
-
paymentTerms?: string;
|
|
1289
|
-
allowances?: {
|
|
1290
|
-
amount: number;
|
|
1291
|
-
baseAmount?: number;
|
|
1292
|
-
percentage?: number;
|
|
1293
|
-
reason?: string;
|
|
1294
|
-
reasonCode?: string;
|
|
1295
|
-
vatCategoryCode: string;
|
|
1296
|
-
vatRate?: number;
|
|
1297
|
-
}[];
|
|
1298
|
-
charges?: {
|
|
1299
|
-
amount: number;
|
|
1300
|
-
baseAmount?: number;
|
|
1301
|
-
percentage?: number;
|
|
1302
|
-
reason?: string;
|
|
1303
|
-
reasonCode?: string;
|
|
1304
|
-
vatCategoryCode: string;
|
|
1305
|
-
vatRate?: number;
|
|
1306
|
-
}[];
|
|
1307
|
-
totalNetAmount: number;
|
|
1308
|
-
totalTaxAmount: number;
|
|
1309
|
-
totalGrossAmount: number;
|
|
1310
|
-
paidAmount?: number;
|
|
1311
|
-
roundingAmount?: number;
|
|
1312
|
-
franceCtc?: boolean;
|
|
1313
|
-
businessProcessId?: "S8" | "B8" | "M8";
|
|
1314
|
-
italy?: {
|
|
1315
|
-
codiceDestinatario?: string;
|
|
1316
|
-
regimeFiscale?: string;
|
|
1317
|
-
progressivoInvio?: string;
|
|
1318
|
-
idTrasmittente?: {
|
|
1319
|
-
country: string;
|
|
1320
|
-
id: string;
|
|
1321
|
-
};
|
|
1322
|
-
tipoDocumento?: string;
|
|
1323
|
-
condizioniPagamento?: string;
|
|
1324
|
-
modalitaPagamento?: string;
|
|
1325
|
-
esigibilitaIVA?: string;
|
|
1326
|
-
causale?: string[];
|
|
1327
|
-
};
|
|
1328
|
-
romania?: Record<string, never>;
|
|
1329
|
-
netherlands?: Record<string, never>;
|
|
1330
|
-
spain?: {
|
|
1331
|
-
modality?: "I" | "L";
|
|
1332
|
-
invoiceIssuerType?: "EM" | "RE" | "TE";
|
|
1333
|
-
invoiceDocumentType?: string;
|
|
1334
|
-
invoiceClass?: string;
|
|
1335
|
-
taxTypeCode?: string;
|
|
1336
|
-
languageName?: string;
|
|
1337
|
-
batchIdentifier?: string;
|
|
1338
|
-
seller?: {
|
|
1339
|
-
personTypeCode?: "J" | "F";
|
|
1340
|
-
residenceTypeCode?: "R" | "U" | "E";
|
|
1341
|
-
};
|
|
1342
|
-
buyer?: {
|
|
1343
|
-
personTypeCode?: "J" | "F";
|
|
1344
|
-
residenceTypeCode?: "R" | "U" | "E";
|
|
1345
|
-
};
|
|
1346
|
-
};
|
|
1347
|
-
slovenia?: Record<string, never>;
|
|
1348
|
-
poland?: {
|
|
1349
|
-
adnotacje?: {
|
|
1350
|
-
P_16?: "1" | "2";
|
|
1351
|
-
P_17?: "1" | "2";
|
|
1352
|
-
P_18?: "1" | "2";
|
|
1353
|
-
P_18A?: "1" | "2";
|
|
1354
|
-
P_23?: "1" | "2";
|
|
1355
|
-
};
|
|
1356
|
-
dataWytworzenia?: string;
|
|
1357
|
-
placeOfIssue?: string;
|
|
1358
|
-
jst?: "1" | "2";
|
|
1359
|
-
gv?: "1" | "2";
|
|
1360
|
-
};
|
|
1149
|
+
totalNetAmount?: number;
|
|
1150
|
+
totalTaxAmount?: number;
|
|
1151
|
+
totalGrossAmount?: number;
|
|
1361
1152
|
};
|
|
1362
1153
|
warnings: {
|
|
1363
1154
|
code: "PARSE_NOT_RETURNED" | "PARSE_VALUE_NOT_FOUND";
|
|
@@ -1824,6 +1615,7 @@ interface operations {
|
|
|
1824
1615
|
rulesetVersion: string;
|
|
1825
1616
|
rulesetArtefact: string;
|
|
1826
1617
|
versionKey: string;
|
|
1618
|
+
/** @enum {string|null} */
|
|
1827
1619
|
verificationTier: "conformance-verified" | "builder-round-trip" | "reconstructed-rules" | "xsd-structural" | null;
|
|
1828
1620
|
rulesProvenance: "authority-conformance" | "authority-artifact" | "community" | "beliq-authored" | "none";
|
|
1829
1621
|
verificationBadge: "authority-verified" | "independently-rule-checked" | "structure-checked";
|
|
@@ -1850,7 +1642,10 @@ interface operations {
|
|
|
1850
1642
|
servingVersion: string;
|
|
1851
1643
|
/** @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. */
|
|
1852
1644
|
previousVersion: string | null;
|
|
1853
|
-
/**
|
|
1645
|
+
/**
|
|
1646
|
+
* @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`.
|
|
1647
|
+
* @enum {string|null}
|
|
1648
|
+
*/
|
|
1854
1649
|
fallbackReason: "sunset" | "notice-period" | "superseded" | null;
|
|
1855
1650
|
}[];
|
|
1856
1651
|
}[];
|
|
@@ -1952,7 +1747,12 @@ type ValidationResult = Json200Data<'validateInvoice'>;
|
|
|
1952
1747
|
type ValidationIssue = ValidationResult['errors'][number];
|
|
1953
1748
|
type Severity = ValidationIssue['severity'];
|
|
1954
1749
|
type ValidationFormat = ValidationResult['format'];
|
|
1955
|
-
/**
|
|
1750
|
+
/**
|
|
1751
|
+
* What POST /v1/parse read from a document. Of `invoice`, only `lines` is
|
|
1752
|
+
* always present. Every other field is left out when the answer holds no value
|
|
1753
|
+
* for it, so check for a field before reading it.
|
|
1754
|
+
* https://docs.beliq.eu/api-reference/parse/ says what an absent field means.
|
|
1755
|
+
*/
|
|
1956
1756
|
type ParseResult = Json200Data<'parseInvoice'>;
|
|
1957
1757
|
/** One warning about what the document holds and the parsed invoice does not. */
|
|
1958
1758
|
type ParseWarning = ParseResult['warnings'][number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beliq/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|