@endevops/peppol-schema 0.1.3 → 0.1.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/README.md +5 -5
- package/dist/constants.d.ts +131 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +114 -1
- package/dist/constants.js.map +1 -1
- package/dist/{index-BBzPjq7o.d.ts → index-XG-N6PcG.d.ts} +1702 -724
- package/dist/index-XG-N6PcG.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1247 -200
- package/dist/index.js.map +1 -1
- package/dist/invoice-response-code-not-needs-schema-DNrfKYLh.js +36 -0
- package/dist/invoice-response-code-not-needs-schema-DNrfKYLh.js.map +1 -0
- package/dist/invoice-response-codes.d.ts +28 -0
- package/dist/invoice-response-codes.d.ts.map +1 -1
- package/dist/invoice-response-codes.js +11 -1
- package/dist/invoice-response-codes.js.map +1 -1
- package/dist/{is-valid-abn-160i38PG.js → is-valid-abn-D7eSygBG.js} +115 -2
- package/dist/is-valid-abn-D7eSygBG.js.map +1 -0
- package/dist/{is-valid-mod97-0208-CzMOXMO-.js → is-valid-mod97-0208-CjR324eG.js} +11 -1
- package/dist/is-valid-mod97-0208-CjR324eG.js.map +1 -0
- package/dist/message-level-response-profile-id-B9c0A7S_.js +27 -0
- package/dist/message-level-response-profile-id-B9c0A7S_.js.map +1 -0
- package/dist/{nodable-parser-CyDZtLCK.js → nodable-parser-CupS2H55.js} +31 -1
- package/dist/nodable-parser-CupS2H55.js.map +1 -0
- package/dist/schematron.d.ts +57 -1
- package/dist/schematron.d.ts.map +1 -1
- package/dist/schematron.js +458 -7
- package/dist/schematron.js.map +1 -1
- package/dist/validations.d.ts +132 -0
- package/dist/validations.d.ts.map +1 -1
- package/dist/validations.js +11 -2
- package/dist/validations.js.map +1 -1
- package/dist/values.d.ts +67 -2
- package/dist/values.d.ts.map +1 -1
- package/dist/xml.d.ts +30 -0
- package/dist/xml.d.ts.map +1 -1
- package/dist/xml.js +10 -1
- package/dist/xml.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/credit-note-doctype-id.ts +9 -0
- package/src/constants/credit-note-process-id.ts +9 -0
- package/src/constants/document-scheme.ts +9 -0
- package/src/constants/invoice-doctype-id.ts +9 -0
- package/src/constants/invoice-process-id.ts +10 -0
- package/src/constants/invoice-response-doctype-id.ts +10 -0
- package/src/constants/invoice-response-process-id.ts +9 -0
- package/src/constants/invoice-response-profile-id.ts +9 -0
- package/src/constants/message-level-response-doctype-id.ts +10 -0
- package/src/constants/message-level-response-process-id.ts +9 -0
- package/src/constants/message-level-response-profile-id.ts +9 -0
- package/src/constants/participant-scheme.ts +10 -0
- package/src/constants/process-scheme.ts +9 -0
- package/src/constants/transport-profile.ts +10 -0
- package/src/decoders/fields/decode-invoice-message-document-party.ts +2 -2
- package/src/decoders/fields/decode-parties-tax-scheme.ts +2 -2
- package/src/decoders/fields/decode-party-legal-entity.ts +2 -2
- package/src/decoders/fields/decode-party-tax-scheme.ts +2 -2
- package/src/decoders/fields/decode-tax-category.ts +1 -1
- package/src/decoders/fields/decode-tax-representative-party.ts +2 -2
- package/src/decoders/fields/encode-message-party.ts +2 -2
- package/src/decoders/fields/encode-parties-tax-scheme.ts +3 -3
- package/src/decoders/fields/encode-party-legal-entity.ts +1 -1
- package/src/decoders/fields/encode-party-tax-scheme.ts +2 -2
- package/src/decoders/fields/encode-tax-representative-party.ts +2 -2
- package/src/invoice-response-codes/invoice-response-code-needs-schema.ts +9 -0
- package/src/invoice-response-codes/invoice-response-code-not-needs-schema.ts +9 -0
- package/src/invoice-response-codes/invoice-response-codes-order.ts +10 -0
- package/src/peppol-validations/add-piva.ts +12 -0
- package/src/peppol-validations/check-cf.ts +11 -0
- package/src/peppol-validations/check-cf16.ts +12 -0
- package/src/peppol-validations/check-piva-se-it.ts +11 -0
- package/src/peppol-validations/check-piva.ts +11 -0
- package/src/peppol-validations/check-se-orgnr.ts +9 -0
- package/src/peppol-validations/greek-tin-verification.ts +9 -0
- package/src/peppol-validations/is-valid-abn.ts +9 -0
- package/src/peppol-validations/is-valid-gln.ts +10 -0
- package/src/peppol-validations/is-valid-iban.ts +10 -0
- package/src/peppol-validations/is-valid-mod11.ts +9 -0
- package/src/peppol-validations/is-valid-mod97-0208.ts +10 -0
- package/src/peppol-validations/luhn-check.ts +9 -0
- package/src/schemas/fields/default-customization-id.ts +9 -0
- package/src/schemas/fields/default-profile-id.ts +9 -0
- package/src/schemas/fields/peppol-additional-document-reference-schema.ts +61 -20
- package/src/schemas/fields/peppol-address-schema.ts +25 -2
- package/src/schemas/fields/peppol-allowance-charge-schema.ts +63 -9
- package/src/schemas/fields/peppol-amount-schema.ts +15 -2
- package/src/schemas/fields/peppol-base-line-schema.ts +12 -2
- package/src/schemas/fields/peppol-billing-reference-schema.ts +13 -0
- package/src/schemas/fields/peppol-binary-object-schema.ts +12 -4
- package/src/schemas/fields/peppol-contact-schema.ts +11 -0
- package/src/schemas/fields/peppol-credit-note-line-schema.ts +7 -2
- package/src/schemas/fields/peppol-delivery-schema.ts +44 -2
- package/src/schemas/fields/peppol-identifier-schema.ts +8 -0
- package/src/schemas/fields/peppol-invoice-line-period-schema.ts +11 -0
- package/src/schemas/fields/peppol-invoice-line-schema.ts +9 -2
- package/src/schemas/fields/peppol-invoice-period-schema.ts +2 -2
- package/src/schemas/fields/peppol-item-classification-schema.ts +2 -2
- package/src/schemas/fields/peppol-line-allowance-charge-schema.ts +56 -8
- package/src/schemas/fields/peppol-line-item-schema.ts +66 -6
- package/src/schemas/fields/peppol-line-price-allowance-charge-schema.ts +20 -0
- package/src/schemas/fields/peppol-line-price-schema.ts +2 -0
- package/src/schemas/fields/peppol-order-reference-schema.ts +2 -0
- package/src/schemas/fields/peppol-party-base-schema.ts +36 -4
- package/src/schemas/fields/peppol-party-legal-entity-schema.ts +10 -2
- package/src/schemas/fields/peppol-party-tax-scheme-schema.ts +4 -4
- package/src/schemas/fields/peppol-payee-party-schema.ts +8 -8
- package/src/schemas/fields/peppol-payment-means-schema.ts +62 -2
- package/src/schemas/fields/peppol-payment-terms-schema.ts +2 -0
- package/src/schemas/fields/peppol-quantity-schema.ts +4 -2
- package/src/schemas/fields/peppol-reference-schema.ts +20 -1
- package/src/schemas/fields/peppol-tax-category-schema.ts +12 -2
- package/src/schemas/fields/peppol-tax-representative-schema.ts +2 -2
- package/src/schemas/fields/peppol-tax-subtotal-category-schema.ts +3 -0
- package/src/schemas/fields/peppol-tax-subtotal-schema.ts +2 -0
- package/src/schemas/fields/peppol-tax-totals-base-schema.ts +3 -3
- package/src/schemas/peppol-billing-base-schema.ts +49 -9
- package/src/schemas/peppol-credit-note-schema.ts +2 -2
- package/src/schemas/peppol-document-response-document-reference-schema.ts +12 -4
- package/src/schemas/peppol-document-response-document-schema.ts +5 -5
- package/src/schemas/peppol-document-response-line-response-content-schema.ts +22 -2
- package/src/schemas/peppol-document-response-line-response-schema.ts +23 -2
- package/src/schemas/peppol-document-schema.ts +69 -6
- package/src/schemas/peppol-invoice-response-document-actual-response-schema.ts +53 -4
- package/src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts +22 -4
- package/src/schemas/peppol-invoice-response-schema.ts +54 -6
- package/src/schemas/peppol-invoice-response-status-reason-code-schema.ts +36 -8
- package/src/schemas/peppol-invoice-schema.ts +30 -2
- package/src/schemas/peppol-message-level-response-document-response-schema.ts +10 -0
- package/src/schemas/peppol-message-level-response-party-schema.ts +10 -0
- package/src/schemas/peppol-message-level-response-schema.ts +18 -0
- package/src/schemas/utils/format-quantity-with-unit.ts +19 -0
- package/src/schemas/utils/get-credit-note-type-code-description.ts +12 -0
- package/src/schemas/utils/get-invoice-type-code-description.ts +12 -0
- package/src/schemas/utils/is-valid-credit-note-type-code.ts +13 -0
- package/src/schemas/utils/is-valid-invoice-type-code.ts +13 -0
- package/src/schemas/utils/is-valid-process.ts +13 -0
- package/src/schemas/utils/peppol-base-64-schema.ts +7 -4
- package/src/schemas/utils/peppol-vat-regex-schema.ts +38 -30
- package/src/schemas/utils/peppol-xsd-time-schema.ts +12 -2
- package/src/schemas/utils/quantity-unit-code-to-intl-unit.ts +34 -0
- package/src/schemas/values/additional-document-reference-code-schema.ts +9 -15
- package/src/schemas/values/allowance-charge-reason-code-schema.ts +12 -14
- package/src/schemas/values/application-response-type-code-schema.ts +10 -14
- package/src/schemas/values/charge-reason-code-schema.ts +12 -14
- package/src/schemas/values/credit-note-type-code-schema.ts +8 -14
- package/src/schemas/values/currency-code-schema.ts +13 -16
- package/src/schemas/values/document-type-schemes-schema.ts +9 -5
- package/src/schemas/values/document-type-values-schema.ts +5 -6
- package/src/schemas/values/duty-tax-fee-category-schema.ts +15 -13
- package/src/schemas/values/electronic-codes-schema.ts +10 -12
- package/src/schemas/values/icd-codes-schema.ts +8 -12
- package/src/schemas/values/invoice-status-code-schema.ts +10 -12
- package/src/schemas/values/invoice-type-code-schema.ts +10 -12
- package/src/schemas/values/item-classification-codes-schema.ts +10 -12
- package/src/schemas/values/mime-codes-schema.ts +12 -14
- package/src/schemas/values/op-status-action-schema.ts +10 -12
- package/src/schemas/values/op-status-reason-schema.ts +10 -12
- package/src/schemas/values/participant-identifier-code-schema.ts +10 -13
- package/src/schemas/values/payment-means-code-schema.ts +10 -12
- package/src/schemas/values/peppol-country-code-schema.ts +7 -9
- package/src/schemas/values/peppol-document-type-code-schema.ts +10 -12
- package/src/schemas/values/peppol-document-type-schema.ts +12 -21
- package/src/schemas/values/peppol-process-schema.ts +19 -15
- package/src/schemas/values/process-from-document-type-schema.ts +3 -3
- package/src/schemas/values/quantity-unit-codes-schema.ts +10 -12
- package/src/schemas/values/vat-date-code-schema.ts +12 -5
- package/src/schemas/values/vatex-code-schema.ts +8 -12
- package/src/schematron/errors.ts +14 -0
- package/src/schematron/helpers.ts +457 -11
- package/src/schematron/run-all-rules.ts +10 -0
- package/src/schematron/schematron.ts +25 -0
- package/src/xml/builder-options.ts +9 -0
- package/src/xml/common-xml-options.ts +9 -0
- package/src/xml/nodable-parser.ts +12 -0
- package/src/xml/parser-options.ts +9 -0
- package/dist/index-BBzPjq7o.d.ts.map +0 -1
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js +0 -18
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js.map +0 -1
- package/dist/is-valid-abn-160i38PG.js.map +0 -1
- package/dist/is-valid-mod97-0208-CzMOXMO-.js.map +0 -1
- package/dist/message-level-response-profile-id-DBpOW91B.js +0 -9
- package/dist/message-level-response-profile-id-DBpOW91B.js.map +0 -1
- package/dist/nodable-parser-CyDZtLCK.js.map +0 -1
- package/dist/vat-dates.generated-CxFvt7m3.d.ts +0 -68
- package/dist/vat-dates.generated-CxFvt7m3.d.ts.map +0 -1
package/dist/validations.d.ts
CHANGED
|
@@ -1,54 +1,148 @@
|
|
|
1
1
|
//#region src/peppol-validations/add-piva.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* @description Helper function for calculating weighted sum for Italian PIVA validation.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* addPIVA('123', 0); // 8
|
|
8
|
+
* ```;
|
|
9
|
+
*
|
|
10
|
+
* @param arg - The digit string to sum, processed one character at a time.
|
|
11
|
+
* @param pari - Parity flag toggled at each recursion; `1` maps the digit through the `0246813579` table, `0` keeps it as is.
|
|
12
|
+
*
|
|
13
|
+
* @returns The weighted sum, or `0` when `arg` contains a non-digit.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link checkPIVA}
|
|
4
16
|
*/
|
|
5
17
|
export declare function addPIVA(arg: string, pari: number): number;
|
|
6
18
|
//#endregion
|
|
7
19
|
//#region src/peppol-validations/check-cf.d.ts
|
|
8
20
|
/**
|
|
9
21
|
* @description Validates both 16 and 11 character Italian fiscal codes.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* checkCF('RSSMRA80A01H501U'); // true
|
|
26
|
+
* ```;
|
|
27
|
+
*
|
|
28
|
+
* @param arg - The fiscal code to validate. Whitespace is normalised first.
|
|
29
|
+
*
|
|
30
|
+
* @returns `true` when the normalised code is a valid 16 character personal fiscal code or an 11 digit VAT code, otherwise `false`.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link checkCF16}
|
|
10
33
|
*/
|
|
11
34
|
export declare function checkCF(arg: string): boolean;
|
|
12
35
|
//#endregion
|
|
13
36
|
//#region src/peppol-validations/check-cf16.d.ts
|
|
14
37
|
/**
|
|
15
38
|
* @description Validates 16-character Italian fiscal codes.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* checkCF16('RSSMRA80A01H501U'); // true
|
|
43
|
+
* ```;
|
|
44
|
+
*
|
|
45
|
+
* @param arg - The fiscal code to validate. Whitespace is normalised first.
|
|
46
|
+
*
|
|
47
|
+
* @returns `true` when the normalised code is 16 characters and matches `{6 letters}{2 digits}{letter}{2 digits}{letter}{3 digits}{letter}`,
|
|
48
|
+
* otherwise `false`.
|
|
49
|
+
*
|
|
50
|
+
* @see {@link checkCF}
|
|
16
51
|
*/
|
|
17
52
|
export declare function checkCF16(arg: string): boolean;
|
|
18
53
|
//#endregion
|
|
19
54
|
//#region src/peppol-validations/check-piva-se-it.d.ts
|
|
20
55
|
/**
|
|
21
56
|
* @description Validates Italian VAT numbers with IT prefix.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* checkPIVAseIT('IT00743110157'); // true
|
|
61
|
+
* ```;
|
|
62
|
+
*
|
|
63
|
+
* @param arg - The VAT identifier including its two letter country prefix.
|
|
64
|
+
*
|
|
65
|
+
* @returns `true` when the prefix is not `IT`, or when the 11 digit Italian part passes {@link checkPIVA}; otherwise `false`.
|
|
66
|
+
*
|
|
67
|
+
* @see {@link checkPIVA}
|
|
22
68
|
*/
|
|
23
69
|
export declare function checkPIVAseIT(arg: string): boolean;
|
|
24
70
|
//#endregion
|
|
25
71
|
//#region src/peppol-validations/check-piva.d.ts
|
|
26
72
|
/**
|
|
27
73
|
* @description Validates Italian VAT numbers (PIVA)
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* checkPIVA('00743110157'); // 0
|
|
78
|
+
* ```;
|
|
79
|
+
*
|
|
80
|
+
* @param arg - The Italian VAT number without the `IT` prefix.
|
|
81
|
+
*
|
|
82
|
+
* @returns `0` when valid, otherwise the non-zero remainder of {@link addPIVA}, or `1` when `arg` contains a non-digit.
|
|
83
|
+
*
|
|
84
|
+
* @see {@link addPIVA}
|
|
28
85
|
*/
|
|
29
86
|
export declare function checkPIVA(arg: string): number;
|
|
30
87
|
//#endregion
|
|
31
88
|
//#region src/peppol-validations/check-se-orgnr.d.ts
|
|
32
89
|
/**
|
|
33
90
|
* @description Validates Swedish organization numbers (0007)
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* checkSEOrgnr('5560160680'); // true
|
|
95
|
+
* ```;
|
|
96
|
+
*
|
|
97
|
+
* @param number - The organization number to validate. Whitespace is normalised first.
|
|
98
|
+
*
|
|
99
|
+
* @returns `true` when the normalised number is 10 digits and its Luhn check digit matches, otherwise `false`.
|
|
34
100
|
*/
|
|
35
101
|
export declare function checkSEOrgnr(number: string): boolean;
|
|
36
102
|
//#endregion
|
|
37
103
|
//#region src/peppol-validations/greek-tin-verification.d.ts
|
|
38
104
|
/**
|
|
39
105
|
* @description Greek TIN verification.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* greekTinVerification('123456783'); // true
|
|
110
|
+
* ```;
|
|
111
|
+
*
|
|
112
|
+
* @param val - The nine digit Greek tax identification number.
|
|
113
|
+
*
|
|
114
|
+
* @returns `true` when the value is nine digits and the computed checksum matches the last digit, otherwise `false`.
|
|
40
115
|
*/
|
|
41
116
|
export declare function greekTinVerification(val: string): boolean;
|
|
42
117
|
//#endregion
|
|
43
118
|
//#region src/peppol-validations/is-valid-abn.d.ts
|
|
44
119
|
/**
|
|
45
120
|
* @description Australian Business Number (ABN) validation.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* isValidABN('51 824 753 556'); // true
|
|
125
|
+
* ```;
|
|
126
|
+
*
|
|
127
|
+
* @param val - The ABN to validate. Whitespace is normalised first.
|
|
128
|
+
*
|
|
129
|
+
* @returns `true` when the normalised value is 11 digits and the weighted checksum is divisible by 89, otherwise `false`.
|
|
46
130
|
*/
|
|
47
131
|
export declare function isValidABN(val: string): boolean;
|
|
48
132
|
//#endregion
|
|
49
133
|
//#region src/peppol-validations/is-valid-gln.d.ts
|
|
50
134
|
/**
|
|
51
135
|
* @description [GLN](https://en.wikipedia.org/wiki/Global_Location_Number) check (GS1)
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* isValidGLN('1234567890128'); // { success: true }
|
|
140
|
+
* ```;
|
|
141
|
+
*
|
|
142
|
+
* @param val - The GLN to validate. Whitespace is stripped first.
|
|
143
|
+
*
|
|
144
|
+
* @returns `{ success: true }` when the computed check digit matches the last digit, otherwise `{ success: false, expected, actual }` with the
|
|
145
|
+
* computed and supplied check digits.
|
|
52
146
|
*/
|
|
53
147
|
export declare function isValidGLN(val: string): {
|
|
54
148
|
success: true;
|
|
@@ -61,18 +155,47 @@ export declare function isValidGLN(val: string): {
|
|
|
61
155
|
//#region src/peppol-validations/is-valid-iban.d.ts
|
|
62
156
|
/**
|
|
63
157
|
* @description IBAN validation using mod 97 algorithm.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* isValidIBAN('GB82 WEST 1234 5698 7654 32'); // true
|
|
162
|
+
* ```;
|
|
163
|
+
*
|
|
164
|
+
* @param iban - The IBAN to validate, with or without spaces.
|
|
165
|
+
*
|
|
166
|
+
* @returns `true` when the normalised value matches the `{2 letters}{2 digits}{up to 30 alphanumerics}` shape and its mod 97 remainder is 1,
|
|
167
|
+
* otherwise `false`.
|
|
64
168
|
*/
|
|
65
169
|
export declare function isValidIBAN(iban: string): boolean;
|
|
66
170
|
//#endregion
|
|
67
171
|
//#region src/peppol-validations/is-valid-mod11.d.ts
|
|
68
172
|
/**
|
|
69
173
|
* @description Validates Norwegian organization numbers using mod11 algorithm.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* isValidMod11('923609016'); // true
|
|
178
|
+
* ```;
|
|
179
|
+
*
|
|
180
|
+
* @param val - The organization number to validate. Whitespace is normalised first.
|
|
181
|
+
*
|
|
182
|
+
* @returns `true` when the normalised value is at least two digits and its mod 11 check digit matches, otherwise `false`.
|
|
70
183
|
*/
|
|
71
184
|
export declare function isValidMod11(val: string): boolean;
|
|
72
185
|
//#endregion
|
|
73
186
|
//#region src/peppol-validations/is-valid-mod97-0208.d.ts
|
|
74
187
|
/**
|
|
75
188
|
* @description Belgian enterprise number validation (mod 97-0208)
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* isValidMod97_0208('0123456749'); // { success: true }
|
|
193
|
+
* ```;
|
|
194
|
+
*
|
|
195
|
+
* @param val - The enterprise number to validate. Whitespace is normalised first.
|
|
196
|
+
*
|
|
197
|
+
* @returns `{ success: true }` when the last two digits equal `97 - (first eight digits % 97)`, otherwise `{ success: false, expected, actual }` with
|
|
198
|
+
* the computed and supplied check digits.
|
|
76
199
|
*/
|
|
77
200
|
export declare function isValidMod97_0208(val: string): {
|
|
78
201
|
success: true;
|
|
@@ -85,6 +208,15 @@ export declare function isValidMod97_0208(val: string): {
|
|
|
85
208
|
//#region src/peppol-validations/luhn-check.d.ts
|
|
86
209
|
/**
|
|
87
210
|
* @description Luhn algorithm check (used for credit card validation)
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* luhnCheck('4242424242424242'); // true
|
|
215
|
+
* ```;
|
|
216
|
+
*
|
|
217
|
+
* @param number - The numeric string to check. Whitespace is normalised first.
|
|
218
|
+
*
|
|
219
|
+
* @returns `true` when the value contains only digits and its Luhn checksum is divisible by 10, otherwise `false`.
|
|
88
220
|
*/
|
|
89
221
|
export declare function luhnCheck(number: string): boolean;
|
|
90
222
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","names":[],"sources":["../src/peppol-validations/add-piva.ts","../src/peppol-validations/check-cf.ts","../src/peppol-validations/check-cf16.ts","../src/peppol-validations/check-piva-se-it.ts","../src/peppol-validations/check-piva.ts","../src/peppol-validations/check-se-orgnr.ts","../src/peppol-validations/greek-tin-verification.ts","../src/peppol-validations/is-valid-abn.ts","../src/peppol-validations/is-valid-gln.ts","../src/peppol-validations/is-valid-iban.ts","../src/peppol-validations/is-valid-mod11.ts","../src/peppol-validations/is-valid-mod97-0208.ts","../src/peppol-validations/luhn-check.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.d.ts","names":[],"sources":["../src/peppol-validations/add-piva.ts","../src/peppol-validations/check-cf.ts","../src/peppol-validations/check-cf16.ts","../src/peppol-validations/check-piva-se-it.ts","../src/peppol-validations/check-piva.ts","../src/peppol-validations/check-se-orgnr.ts","../src/peppol-validations/greek-tin-verification.ts","../src/peppol-validations/is-valid-abn.ts","../src/peppol-validations/is-valid-gln.ts","../src/peppol-validations/is-valid-iban.ts","../src/peppol-validations/is-valid-mod11.ts","../src/peppol-validations/is-valid-mod97-0208.ts","../src/peppol-validations/luhn-check.ts"],"mappings":";;;;;;;;;;;;;;;;wBAiBgB,QAAQ,aAAa;;;;;;;;;;;;;;;;;wBCArB,QAAQ;;;;;;;;;;;;;;;;;;wBCAR,UAAU;;;;;;;;;;;;;;;;;wBCDV,cAAc;;;;;;;;;;;;;;;;;wBCAd,UAAU;;;;;;;;;;;;;;;wBCFV,aAAa;;;;;;;;;;;;;;;wBCFb,qBAAqB;;;;;;;;;;;;;;;wBCErB,WAAW;;;;;;;;;;;;;;;;wBCDX,WAAW;EAAgB;;EAAoB;EAAgB;EAAkB;;;;;;;;;;;;;;;;;wBCEjF,YAAY;;;;;;;;;;;;;;;wBCDZ,aAAa;;;;;;;;;;;;;;;;wBCCb,kBAAkB;EAAgB;;EAAoB;EAAgB;EAAkB;;;;;;;;;;;;;;;;wBCDxF,UAAU"}
|
package/dist/validations.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { n as normalizeSpace, t as isValidMod97_0208 } from "./is-valid-mod97-0208-
|
|
2
|
-
import { a as addPIVA, c as isValidGLN, d as isValidIBAN, i as checkPIVA, l as isValidMod11, n as checkSEOrgnr, o as checkCF, r as checkPIVAseIT, s as checkCF16, t as isValidABN, u as greekTinVerification } from "./is-valid-abn-
|
|
1
|
+
import { n as normalizeSpace, t as isValidMod97_0208 } from "./is-valid-mod97-0208-CjR324eG.js";
|
|
2
|
+
import { a as addPIVA, c as isValidGLN, d as isValidIBAN, i as checkPIVA, l as isValidMod11, n as checkSEOrgnr, o as checkCF, r as checkPIVAseIT, s as checkCF16, t as isValidABN, u as greekTinVerification } from "./is-valid-abn-D7eSygBG.js";
|
|
3
3
|
//#region src/peppol-validations/luhn-check.ts
|
|
4
4
|
/**
|
|
5
5
|
* @description Luhn algorithm check (used for credit card validation)
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* luhnCheck('4242424242424242'); // true
|
|
10
|
+
* ```;
|
|
11
|
+
*
|
|
12
|
+
* @param number - The numeric string to check. Whitespace is normalised first.
|
|
13
|
+
*
|
|
14
|
+
* @returns `true` when the value contains only digits and its Luhn checksum is divisible by 10, otherwise `false`.
|
|
6
15
|
*/
|
|
7
16
|
function luhnCheck(number) {
|
|
8
17
|
const s = normalizeSpace(number);
|
package/dist/validations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","names":[],"sources":["../src/peppol-validations/luhn-check.ts"],"sourcesContent":["import { normalizeSpace } from './normalize-space.ts';\n\n/**\n * @description Luhn algorithm check (used for credit card validation)\n */\nexport function luhnCheck(number: string): boolean {\n const s = normalizeSpace(number);\n if (!/^\\d+$/.test(s)) return false;\n let sum = 0;\n let dbl = false;\n for (let i = s.length - 1; i >= 0; i -= 1) {\n let n = s.charCodeAt(i) - 48;\n if (dbl) {\n n *= 2;\n if (n > 9) n -= 9;\n }\n sum += n;\n dbl = !dbl;\n }\n return sum % 10 === 0;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.js","names":[],"sources":["../src/peppol-validations/luhn-check.ts"],"sourcesContent":["import { normalizeSpace } from './normalize-space.ts';\n\n/**\n * @description Luhn algorithm check (used for credit card validation)\n *\n * @example\n * ```ts\n * luhnCheck('4242424242424242'); // true\n * ```;\n *\n * @param number - The numeric string to check. Whitespace is normalised first.\n *\n * @returns `true` when the value contains only digits and its Luhn checksum is divisible by 10, otherwise `false`.\n */\nexport function luhnCheck(number: string): boolean {\n const s = normalizeSpace(number);\n if (!/^\\d+$/.test(s)) return false;\n let sum = 0;\n let dbl = false;\n for (let i = s.length - 1; i >= 0; i -= 1) {\n let n = s.charCodeAt(i) - 48;\n if (dbl) {\n n *= 2;\n if (n > 9) n -= 9;\n }\n sum += n;\n dbl = !dbl;\n }\n return sum % 10 === 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,UAAU,QAAyB;CACjD,MAAM,IAAI,eAAe,MAAM;CAC/B,IAAI,CAAC,QAAQ,KAAK,CAAC,GAAG,OAAO;CAC7B,IAAI,MAAM;CACV,IAAI,MAAM;CACV,KAAK,IAAI,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG;EACzC,IAAI,IAAI,EAAE,WAAW,CAAC,IAAI;EAC1B,IAAI,KAAK;GACP,KAAK;GACL,IAAI,IAAI,GAAG,KAAK;EAClB;EACA,OAAO;EACP,MAAM,CAAC;CACT;CACA,OAAO,MAAM,OAAO;AACtB"}
|
package/dist/values.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as applicationResponseTypeCodes, c as creditNoteTypeCodes, i as ApplicationResponseTypeCodesKeys, l as creditNoteTypeCodesKeys, n as vatDateCodes, o as applicationResponseTypeCodesKeys, r as vatDateCodesKeys, s as CreditNoteTypeCodesKeys, t as VatDateCodesKeys } from "./vat-dates.generated-CxFvt7m3.js";
|
|
2
1
|
import { n as invoiceStatusCodes, r as invoiceStatusCodesKeys, t as InvoiceStatusCodesKeys } from "./invoice-status-codes.generated-DL-agLdx.js";
|
|
3
2
|
//#region src/values/additional-document-reference-codes.generated.d.ts
|
|
4
3
|
/**
|
|
@@ -44,6 +43,28 @@ export type AllowanceChargeReasonCodesKeys = '41' | '42' | '60' | '62' | '63' |
|
|
|
44
43
|
*/
|
|
45
44
|
export declare const allowanceChargeReasonCodesKeys: [string, ...string[]];
|
|
46
45
|
//#endregion
|
|
46
|
+
//#region src/values/application-response-type-codes.generated.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* @version D.17A
|
|
49
|
+
*
|
|
50
|
+
* @category Peppol Values
|
|
51
|
+
*
|
|
52
|
+
* @title Application Response type code (UNCL4343 Subset)
|
|
53
|
+
*
|
|
54
|
+
* @enum
|
|
55
|
+
*
|
|
56
|
+
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4343/
|
|
57
|
+
*/
|
|
58
|
+
export declare const applicationResponseTypeCodes: Record<ApplicationResponseTypeCodesKeys, string>;
|
|
59
|
+
/**
|
|
60
|
+
* @description Keys of {@link applicationResponseTypeCodes}.
|
|
61
|
+
*/
|
|
62
|
+
export type ApplicationResponseTypeCodesKeys = 'AB' | 'AP' | 'RE';
|
|
63
|
+
/**
|
|
64
|
+
* @description Keys of {@link applicationResponseTypeCodes}.
|
|
65
|
+
*/
|
|
66
|
+
export declare const applicationResponseTypeCodesKeys: readonly ['AB', 'AP', 'RE'];
|
|
67
|
+
//#endregion
|
|
47
68
|
//#region src/values/charge-reason-codes.generated.d.ts
|
|
48
69
|
/**
|
|
49
70
|
* @version D.16B
|
|
@@ -88,6 +109,28 @@ export type CountryCodesKeys = 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' |
|
|
|
88
109
|
*/
|
|
89
110
|
export declare const countryCodesKeys: [string, ...string[]];
|
|
90
111
|
//#endregion
|
|
112
|
+
//#region src/values/credit-notes-type-codes.generated.d.ts
|
|
113
|
+
/**
|
|
114
|
+
* @version D.16B
|
|
115
|
+
*
|
|
116
|
+
* @category Peppol Values
|
|
117
|
+
*
|
|
118
|
+
* @title Credit note type code (UNCL1001 subset)
|
|
119
|
+
*
|
|
120
|
+
* @enum
|
|
121
|
+
*
|
|
122
|
+
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1001-cn/
|
|
123
|
+
*/
|
|
124
|
+
export declare const creditNoteTypeCodes: Record<CreditNoteTypeCodesKeys, string>;
|
|
125
|
+
/**
|
|
126
|
+
* @description Keys of {@link creditNoteTypeCodes}.
|
|
127
|
+
*/
|
|
128
|
+
export type CreditNoteTypeCodesKeys = '81' | '83' | '381' | '396' | '532';
|
|
129
|
+
/**
|
|
130
|
+
* @description Keys of {@link creditNoteTypeCodes}.
|
|
131
|
+
*/
|
|
132
|
+
export declare const creditNoteTypeCodesKeys: readonly ['81', '83', '381', '396', '532'];
|
|
133
|
+
//#endregion
|
|
91
134
|
//#region src/values/currency-code.generated.d.ts
|
|
92
135
|
/**
|
|
93
136
|
* @version 2018-01-01
|
|
@@ -420,6 +463,28 @@ export type QuantityUnitCodesKeys = '10' | '11' | '13' | '14' | '15' | '20' | '2
|
|
|
420
463
|
*/
|
|
421
464
|
export declare const quantityUnitCodesKeys: [string, ...string[]];
|
|
422
465
|
//#endregion
|
|
466
|
+
//#region src/values/vat-dates.generated.d.ts
|
|
467
|
+
/**
|
|
468
|
+
* @version D.16B
|
|
469
|
+
*
|
|
470
|
+
* @category Peppol Values
|
|
471
|
+
*
|
|
472
|
+
* @title VAT date code (UNCL2005 subset)
|
|
473
|
+
*
|
|
474
|
+
* @enum
|
|
475
|
+
*
|
|
476
|
+
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL2005/
|
|
477
|
+
*/
|
|
478
|
+
export declare const vatDateCodes: Record<VatDateCodesKeys, string>;
|
|
479
|
+
/**
|
|
480
|
+
* @description Keys of {@link vatDateCodes}.
|
|
481
|
+
*/
|
|
482
|
+
export type VatDateCodesKeys = '3' | '35' | '432';
|
|
483
|
+
/**
|
|
484
|
+
* @description Keys of {@link vatDateCodes}.
|
|
485
|
+
*/
|
|
486
|
+
export declare const vatDateCodesKeys: readonly ['3', '35', '432'];
|
|
487
|
+
//#endregion
|
|
423
488
|
//#region src/values/vatex-codes.generated.d.ts
|
|
424
489
|
/**
|
|
425
490
|
* @category Peppol Values
|
|
@@ -440,5 +505,5 @@ export type VatexCodesKeys = 'VATEX-EU-79-C' | 'VATEX-EU-132' | 'VATEX-EU-132-1A
|
|
|
440
505
|
*/
|
|
441
506
|
export declare const vatexCodesKeys: [string, ...string[]];
|
|
442
507
|
//#endregion
|
|
443
|
-
export {
|
|
508
|
+
export { InvoiceStatusCodesKeys, invoiceStatusCodes, invoiceStatusCodesKeys };
|
|
444
509
|
//# sourceMappingURL=values.d.ts.map
|
package/dist/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","names":[],"sources":["../src/values/additional-document-reference-codes.generated.ts","../src/values/allowance-charge-reason-codes.generated.ts","../src/values/charge-reason-codes.generated.ts","../src/values/country-code.generated.ts","../src/values/currency-code.generated.ts","../src/values/document-type-codes.generated.ts","../src/values/document-type.generated.ts","../src/values/duty-tax-fee-categories.generated.ts","../src/values/eas-codes.generated.ts","../src/values/icd-codes.generated.ts","../src/values/invoice-type-codes.generated.ts","../src/values/item-classification-code.generated.ts","../src/values/mime-codes.generated.ts","../src/values/op-status-action.generated.ts","../src/values/op-status-reason.generated.ts","../src/values/participant-identifier-schemes.generated.ts","../src/values/payment-means-codes.generated.ts","../src/values/processes.generated.ts","../src/values/quantity-unit-codes.generated.ts","../src/values/vatex-codes.generated.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"values.d.ts","names":[],"sources":["../src/values/additional-document-reference-codes.generated.ts","../src/values/allowance-charge-reason-codes.generated.ts","../src/values/application-response-type-codes.generated.ts","../src/values/charge-reason-codes.generated.ts","../src/values/country-code.generated.ts","../src/values/credit-notes-type-codes.generated.ts","../src/values/currency-code.generated.ts","../src/values/document-type-codes.generated.ts","../src/values/document-type.generated.ts","../src/values/duty-tax-fee-categories.generated.ts","../src/values/eas-codes.generated.ts","../src/values/icd-codes.generated.ts","../src/values/invoice-type-codes.generated.ts","../src/values/item-classification-code.generated.ts","../src/values/mime-codes.generated.ts","../src/values/op-status-action.generated.ts","../src/values/op-status-reason.generated.ts","../src/values/participant-identifier-schemes.generated.ts","../src/values/payment-means-codes.generated.ts","../src/values/processes.generated.ts","../src/values/quantity-unit-codes.generated.ts","../src/values/vat-dates.generated.ts","../src/values/vatex-codes.generated.ts"],"mappings":";;;;;;;;;;;;;qBAca,kCAAkC,OAAO;;;;YAkvG1C;;;;qBAuzBC;;;;;;;;;;;;;;qBCziIA,4BAA4B,OAAO;;;;YA2CpC;;;;qBAwBC;;;;;;;;;;;;;;qBCnEA,8BAA8B,OAAO;;;;YAWtC;;;;qBAKC;;;;;;;;;;;;;;qBChBA,mBAAmB,OAAO;;;;YA+sB3B;;;;qBAuLC;;;;;;;;;;;;;;qBCt4BA,cAAc,OAAO;;;;YA2ftB;;;;qBAgQC;;;;;;;;;;;;;;qBC3vBA,qBAAqB,OAAO;;;;YA0B7B;;;;qBAKC;;;;;;;;;;;;;;qBC/BA,eAAe,OAAO;;;;YA2WvB;;;;qBAwLC;;;;;;;;;;;;;;qBCniBA,mBAAmB,OAAO;;;;YAmlG3B;;;;qBA6tBC;;;qBC3zHA,oBAAoB,OAAO,wBAAwB;;;;YA2UpD;;;;qBAKC;qBAEA;qBAEA,yBAAyB,eAAe;EAAQ;EAAgB;;qBAs5BhE;;;;qBAuUA;;;;;;;;;;;;;;qBCtiDA,sBAAsB,OAAO;;;;YAkD9B;;;;qBAKC;;;;;;;;;;;;qBCzDA,wBAAwB,OAAO;;;;YAkMhC;;;;qBAmGC;;;;;;;;;;;;qBCrSA,UAAU,OAAO;;;;YAqsClB;;;;qBAqPC;;;;;;;;;;;;;;qBCx7CA,kBAAkB,OAAO;;;;YAuH1B;;;;qBAgCC;;;;;;;;;;;;;;qBCvJA,yBAAyB,OAAO;;;;YAkvBjC;;;;qBA8LC;;;;;;;;;;;;;;qBCh7BA,WAAW,OAAO;;;;YAiBnB;;;;qBAWC;;;;;;;;;;;;;;qBC5BA,gBAAgB,OAAO;;;;YAkCxB;;;;qBAKC;;;;;;;;;;;;;;qBCvCA,gBAAgB,OAAO;;;;YA+DxB;;;;qBAKC;;;;;;;;;;;;qBCtEA,8BAA8B,OAAO;;;;YA4uCtC;;;;qBA8GC;qBA4GA,yCAAyC,eAAe,MAAM;;;;qBAkH9D;;;;;;;;;;;;;;qBCtjDA,mBAAmB,OAAO;;;;YAsW3B;;;;qBAyFC;;;;;;;;;;;;qBCjcA,WAAW,OAAO,eAAe;;;;YAoHlC;;;;qBAKC;qBAEA;qBAEA;;;;qBAmHA;;;;;;;;;;;;;;qBC9OA,mBAAmB,OAAO;;;;YA6yL3B;;;;qBAunEC;;;;;;;;;;;;;;qBCp6PA,cAAc,OAAO;;;;YAWtB;;;;qBAKC;;;;;;;;;;;;qBClBA,YAAY,OAAO;;;;YAmWpB;;;;qBA6FC"}
|
package/dist/xml.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
//#region src/xml/builder-options.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* @description Default `fast-xml-builder` options for serialising PEPPOL documents: {@link commonXmlOptions} with `suppressEmptyNode` forced on.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* builderOptions.attributeNamePrefix; // '@'
|
|
9
|
+
* builderOptions.suppressEmptyNode; // true
|
|
10
|
+
* ```;
|
|
11
|
+
*/
|
|
3
12
|
export declare const builderOptions: {
|
|
4
13
|
attributeNamePrefix: string;
|
|
5
14
|
format: false;
|
|
@@ -18,9 +27,30 @@ export declare const builderOptions: {
|
|
|
18
27
|
type XmlNode = any;
|
|
19
28
|
//#endregion
|
|
20
29
|
//#region src/xml/nodable-parser.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* @description Parses an XML string into an {@link XmlNode} tree with the nodable compact builder, coercing values and removing `@xmlns`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* parseXmlNodable('<root xmlns="urn:x"><a>1</a></root>'); // { root: { a: 1 } }
|
|
36
|
+
* ```;
|
|
37
|
+
*
|
|
38
|
+
* @param value - The XML document to parse.
|
|
39
|
+
*
|
|
40
|
+
* @returns The parsed {@link XmlNode} tree with `@xmlns` stripped.
|
|
41
|
+
*/
|
|
21
42
|
export declare function parseXmlNodable(value: string): XmlNode;
|
|
22
43
|
//#endregion
|
|
23
44
|
//#region src/xml/parser-options.d.ts
|
|
45
|
+
/**
|
|
46
|
+
* @description Default `fast-xml-parser` options for parsing PEPPOL documents. Equal to {@link commonXmlOptions}.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* parserOptions.attributeNamePrefix; // '@'
|
|
51
|
+
* parserOptions.ignoreAttributes; // false
|
|
52
|
+
* ```;
|
|
53
|
+
*/
|
|
24
54
|
export declare const parserOptions: {
|
|
25
55
|
attributeNamePrefix: string;
|
|
26
56
|
format: false;
|
package/dist/xml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml.d.ts","names":[],"sources":["../src/xml/builder-options.ts","../src/helpers/get-prop.ts","../src/xml/nodable-parser.ts","../src/xml/parser-options.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"xml.d.ts","names":[],"sources":["../src/xml/builder-options.ts","../src/helpers/get-prop.ts","../src/xml/nodable-parser.ts","../src/xml/parser-options.ts"],"mappings":";;;;;;;;;;;qBAaa;;;;;;;;;;;;;;;KCVD;;;;;;;;;;;;;;;wBC8BI,gBAAgB,gBAAgB;;;;;;;;;;;;qBCpBnC"}
|
package/dist/xml.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { n as builderOptions, r as commonXmlOptions, t as parseXmlNodable } from "./nodable-parser-
|
|
1
|
+
import { n as builderOptions, r as commonXmlOptions, t as parseXmlNodable } from "./nodable-parser-CupS2H55.js";
|
|
2
2
|
//#region src/xml/parser-options.ts
|
|
3
|
+
/**
|
|
4
|
+
* @description Default `fast-xml-parser` options for parsing PEPPOL documents. Equal to {@link commonXmlOptions}.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* parserOptions.attributeNamePrefix; // '@'
|
|
9
|
+
* parserOptions.ignoreAttributes; // false
|
|
10
|
+
* ```;
|
|
11
|
+
*/
|
|
3
12
|
const parserOptions = { ...commonXmlOptions };
|
|
4
13
|
//#endregion
|
|
5
14
|
export { builderOptions, parseXmlNodable, parserOptions };
|
package/dist/xml.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml.js","names":[],"sources":["../src/xml/parser-options.ts"],"sourcesContent":["import type { X2jOptions } from 'fast-xml-parser';\n\nimport { commonXmlOptions } from '#/xml/common-xml-options.ts';\n\nexport const parserOptions = { ...commonXmlOptions } satisfies X2jOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"xml.js","names":[],"sources":["../src/xml/parser-options.ts"],"sourcesContent":["import type { X2jOptions } from 'fast-xml-parser';\n\nimport { commonXmlOptions } from '#/xml/common-xml-options.ts';\n\n/**\n * @description Default `fast-xml-parser` options for parsing PEPPOL documents. Equal to {@link commonXmlOptions}.\n *\n * @example\n * ```ts\n * parserOptions.attributeNamePrefix; // '@'\n * parserOptions.ignoreAttributes; // false\n * ```;\n */\nexport const parserOptions = { ...commonXmlOptions } satisfies X2jOptions;\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,gBAAgB,EAAE,GAAG,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/package.json",
|
|
3
3
|
"name": "@endevops/peppol-schema",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"description": "TypeScript Effect Schema models for PEPPOL BIS Billing 3.0 — decode, validate and encode Invoice, Credit Note, Invoice Response and Message Level Response XML, with generated code lists, Schematron rules and identifier validations",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"bis-billing",
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { documentScheme } from '#/constants/document-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL document type identifier for a UBL CreditNote. It combines the {@link documentScheme} scheme with the UBL `CreditNote-2` root element, the EN
|
|
5
|
+
* 16931 / PEPPOL BIS Billing 3.0 customization id, and version 2.1. The document schema it identifies is {@link PeppolCreditNote}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* CREDIT_NOTE_DOCTYPE_ID; // 'busdox-docid-qns::urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##...::2.1'
|
|
10
|
+
* ```;
|
|
11
|
+
*/
|
|
3
12
|
export const CREDIT_NOTE_DOCTYPE_ID =
|
|
4
13
|
`${documentScheme}::urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1` as const;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { processScheme } from '#/constants/process-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL business process identifier for the billing process used by credit notes. It combines the {@link processScheme} scheme with the
|
|
5
|
+
* `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` business process id, the same value used by {@link INVOICE_PROCESS_ID}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* CREDIT_NOTE_PROCESS_ID; // 'cenbii-procid-ubl::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0'
|
|
10
|
+
* ```;
|
|
11
|
+
*/
|
|
3
12
|
export const CREDIT_NOTE_PROCESS_ID = `${processScheme}::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` as const;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Scheme id for PEPPOL document type identifiers. It forms the `<scheme>::` prefix of {@link INVOICE_DOCTYPE_ID}, {@link CREDIT_NOTE_DOCTYPE_ID},
|
|
3
|
+
* {@link INVOICE_RESPONSE_DOCTYPE_ID}, and {@link MESSAGE_LEVEL_RESPONSE_DOCTYPE_ID}.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* documentScheme; // 'busdox-docid-qns'
|
|
8
|
+
* ```;
|
|
9
|
+
*/
|
|
1
10
|
export const documentScheme = 'busdox-docid-qns' as const;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { documentScheme } from '#/constants/document-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL document type identifier for a UBL Invoice. It combines the {@link documentScheme} scheme with the UBL `Invoice-2` root element, the EN 16931
|
|
5
|
+
* / PEPPOL BIS Billing 3.0 customization id, and version 2.1. The document schema it identifies is {@link PeppolInvoice}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* INVOICE_DOCTYPE_ID; // 'busdox-docid-qns::urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##...::2.1'
|
|
10
|
+
* ```;
|
|
11
|
+
*/
|
|
3
12
|
export const INVOICE_DOCTYPE_ID =
|
|
4
13
|
`${documentScheme}::urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1` as const;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { processScheme } from '#/constants/process-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL business process identifier for the billing process. It combines the {@link processScheme} scheme with the
|
|
5
|
+
* `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` business process id, which is the `cbc:ProfileID` value defaulted by the billing document schemas
|
|
6
|
+
* such as {@link PeppolInvoice}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* INVOICE_PROCESS_ID; // 'cenbii-procid-ubl::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0'
|
|
11
|
+
* ```;
|
|
12
|
+
*/
|
|
3
13
|
export const INVOICE_PROCESS_ID = `${processScheme}::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` as const;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { documentScheme } from '#/constants/document-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL document type identifier for a UBL ApplicationResponse carrying an invoice response. It combines the {@link documentScheme} scheme with the
|
|
5
|
+
* UBL `ApplicationResponse-2` root element, the `urn:fdc:peppol.eu:poacc:trns:invoice_response:3` customization id, and version 2.1. The document
|
|
6
|
+
* schema it identifies is {@link PeppolInvoiceResponse}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* INVOICE_RESPONSE_DOCTYPE_ID; // 'busdox-docid-qns::urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::...::2.1'
|
|
11
|
+
* ```;
|
|
12
|
+
*/
|
|
3
13
|
export const INVOICE_RESPONSE_DOCTYPE_ID =
|
|
4
14
|
`${documentScheme}::urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:invoice_response:3::2.1` as const;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { INVOICE_RESPONSE_PROFILE_ID } from '#/constants/invoice-response-profile-id.ts';
|
|
2
2
|
import { processScheme } from '#/constants/process-scheme.ts';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @description PEPPOL business process identifier for the invoice response process. It combines the {@link processScheme} scheme with
|
|
6
|
+
* {@link INVOICE_RESPONSE_PROFILE_ID}, which is the `cbc:ProfileID` value fixed by {@link PeppolInvoiceResponse}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* INVOICE_RESPONSE_PROCESS_ID; // 'cenbii-procid-ubl::urn:fdc:peppol.eu:poacc:bis:invoice_response:3'
|
|
11
|
+
* ```;
|
|
12
|
+
*/
|
|
4
13
|
export const INVOICE_RESPONSE_PROCESS_ID = `${processScheme}::${INVOICE_RESPONSE_PROFILE_ID}` as const;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description PEPPOL profile id for the invoice response, version 3. It is the `cbc:ProfileID` value fixed by {@link PeppolInvoiceResponse} and is matched when
|
|
3
|
+
* dispatching `ApplicationResponse` documents to that schema.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* INVOICE_RESPONSE_PROFILE_ID; // 'urn:fdc:peppol.eu:poacc:bis:invoice_response:3'
|
|
8
|
+
* ```;
|
|
9
|
+
*/
|
|
1
10
|
export const INVOICE_RESPONSE_PROFILE_ID = 'urn:fdc:peppol.eu:poacc:bis:invoice_response:3' as const;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { documentScheme } from '#/constants/document-scheme.ts';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description PEPPOL document type identifier for a UBL ApplicationResponse carrying a message level response. It combines the {@link documentScheme} scheme with
|
|
5
|
+
* the UBL `ApplicationResponse-2` root element, the `urn:fdc:peppol.eu:poacc:trns:mlr:3` customization id, and version 2.1. The document schema it
|
|
6
|
+
* identifies is {@link PeppolMessageLevelResponse}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* MESSAGE_LEVEL_RESPONSE_DOCTYPE_ID; // 'busdox-docid-qns::urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::...::2.1'
|
|
11
|
+
* ```;
|
|
12
|
+
*/
|
|
3
13
|
export const MESSAGE_LEVEL_RESPONSE_DOCTYPE_ID =
|
|
4
14
|
`${documentScheme}::urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:mlr:3::2.1` as const;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { MESSAGE_LEVEL_RESPONSE_PROFILE_ID } from '#/constants/message-level-response-profile-id.ts';
|
|
2
2
|
import { processScheme } from '#/constants/process-scheme.ts';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @description PEPPOL business process identifier for the message level response process. It combines the {@link processScheme} scheme with
|
|
6
|
+
* {@link MESSAGE_LEVEL_RESPONSE_PROFILE_ID}, which is the `cbc:ProfileID` value fixed by {@link PeppolMessageLevelResponse}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* MESSAGE_LEVEL_RESPONSE_PROCESS_ID; // 'cenbii-procid-ubl::urn:fdc:peppol.eu:poacc:bis:mlr:3'
|
|
11
|
+
* ```;
|
|
12
|
+
*/
|
|
4
13
|
export const MESSAGE_LEVEL_RESPONSE_PROCESS_ID = `${processScheme}::${MESSAGE_LEVEL_RESPONSE_PROFILE_ID}` as const;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description PEPPOL profile id for the message level response, version 3. It is the `cbc:ProfileID` value fixed by {@link PeppolMessageLevelResponse} and is
|
|
3
|
+
* matched when dispatching `ApplicationResponse` documents to that schema.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* MESSAGE_LEVEL_RESPONSE_PROFILE_ID; // 'urn:fdc:peppol.eu:poacc:bis:mlr:3'
|
|
8
|
+
* ```;
|
|
9
|
+
*/
|
|
1
10
|
export const MESSAGE_LEVEL_RESPONSE_PROFILE_ID = 'urn:fdc:peppol.eu:poacc:bis:mlr:3' as const;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Scheme id for ISO 6523 actor identifiers, used to qualify PEPPOL participant and endpoint identifiers.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* PARTICIPANT_SCHEME; // 'iso6523-actorid-upis'
|
|
7
|
+
* ```;
|
|
8
|
+
*/
|
|
1
9
|
export const PARTICIPANT_SCHEME = 'iso6523-actorid-upis' as const;
|
|
2
10
|
/**
|
|
11
|
+
* @description Deprecated alias of {@link PARTICIPANT_SCHEME}.
|
|
12
|
+
*
|
|
3
13
|
* @deprecated use `PARTICIPANT_SCHEME` instead.
|
|
4
14
|
*/
|
|
5
15
|
export const participantScheme = PARTICIPANT_SCHEME;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Process scheme id for PEPPOL UBL business process identifiers. It forms the `<scheme>::` prefix of {@link INVOICE_PROCESS_ID},
|
|
3
|
+
* {@link CREDIT_NOTE_PROCESS_ID}, {@link INVOICE_RESPONSE_PROCESS_ID}, and {@link MESSAGE_LEVEL_RESPONSE_PROCESS_ID}.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* processScheme; // 'cenbii-procid-ubl'
|
|
8
|
+
* ```;
|
|
9
|
+
*/
|
|
1
10
|
export const processScheme = 'cenbii-procid-ubl' as const;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description PEPPOL AS4 transport profile identifier for transport profile version 2.0.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* TRANSPORT_PROFILE; // 'peppol-transport-as4-v2_0'
|
|
7
|
+
* ```;
|
|
8
|
+
*/
|
|
1
9
|
export const TRANSPORT_PROFILE = 'peppol-transport-as4-v2_0' as const;
|
|
2
10
|
/**
|
|
11
|
+
* @description Deprecated alias of {@link TRANSPORT_PROFILE}.
|
|
12
|
+
*
|
|
3
13
|
* @deprecated
|
|
4
14
|
*/
|
|
5
15
|
export const transportProfile = TRANSPORT_PROFILE;
|