@endevops/peppol-schema 0.1.0-beta.4 → 0.1.0-beta.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/README.md +9 -6
- package/dist/constants.d.ts +51 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +48 -0
- package/dist/constants.js.map +1 -0
- package/dist/eas-codes.generated-D8jjHFij.js.map +1 -1
- package/dist/index-CiW698HY.d.ts +3507 -0
- package/dist/index-CiW698HY.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2613
- package/dist/index.js +3122 -1563
- package/dist/index.js.map +1 -1
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js +18 -0
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js.map +1 -0
- package/dist/invoice-response-codes.d.ts +11 -0
- package/dist/invoice-response-codes.d.ts.map +1 -0
- package/dist/invoice-response-codes.js +32 -0
- package/dist/invoice-response-codes.js.map +1 -0
- package/dist/invoice-status-codes.generated-DL-agLdx.d.ts +24 -0
- package/dist/invoice-status-codes.generated-DL-agLdx.d.ts.map +1 -0
- package/dist/message-level-response-profile-id-DBpOW91B.js +9 -0
- package/dist/message-level-response-profile-id-DBpOW91B.js.map +1 -0
- package/dist/peppol-iso-date-string-BXLxzxdz.js +30 -0
- package/dist/peppol-iso-date-string-BXLxzxdz.js.map +1 -0
- package/dist/schematron.d.ts +408 -365
- package/dist/schematron.d.ts.map +1 -1
- package/dist/schematron.js +2040 -1547
- package/dist/schematron.js.map +1 -1
- package/dist/values.d.ts +95 -13218
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +1 -1
- package/dist/vat-dates.generated-CxFvt7m3.d.ts +68 -0
- package/dist/vat-dates.generated-CxFvt7m3.d.ts.map +1 -0
- package/dist/{vatex-codes.generated-BSgP3n5t.js → vatex-codes.generated-N7wsUrLh.js} +8 -9
- package/dist/vatex-codes.generated-N7wsUrLh.js.map +1 -0
- package/package.json +16 -18
- package/src/constants/transport-profile.ts +5 -1
- package/src/decoders/decode-billing.ts +1 -1
- package/src/decoders/decode-credit-note.ts +2 -4
- package/src/decoders/decode-invoice-response.ts +15 -37
- package/src/decoders/decode-invoice.ts +2 -4
- package/src/decoders/decode-message-level-response.ts +21 -48
- package/src/decoders/encode-credit-note.ts +1 -1
- package/src/decoders/encode-invoice-response.ts +7 -4
- package/src/decoders/encode-invoice.ts +1 -1
- package/src/decoders/encode-message-level-response.ts +4 -10
- package/src/decoders/fields/decode-additional-document-references.ts +1 -1
- package/src/decoders/fields/decode-address.ts +1 -1
- package/src/decoders/fields/decode-allowance-charges.ts +7 -15
- package/src/decoders/fields/decode-amount.ts +2 -2
- package/src/decoders/fields/decode-application-response.ts +21 -0
- package/src/decoders/fields/decode-billing-references.ts +1 -1
- package/src/decoders/fields/decode-contact.ts +1 -1
- package/src/decoders/fields/decode-credit-note-lines.ts +7 -15
- package/src/decoders/fields/decode-delivery.ts +1 -1
- package/src/decoders/fields/decode-electronic-address.ts +1 -1
- package/src/decoders/fields/decode-identifier.ts +1 -1
- package/src/decoders/fields/decode-invoice-line-period.ts +1 -1
- package/src/decoders/fields/decode-invoice-lines.ts +6 -14
- package/src/decoders/fields/decode-invoice-message-document-party.ts +2 -2
- package/src/decoders/fields/decode-invoice-message-party.ts +1 -6
- package/src/decoders/fields/decode-invoice-period.ts +7 -13
- package/src/decoders/fields/decode-legal-monetary-total.ts +1 -1
- package/src/decoders/fields/decode-line-allowance-charges.ts +7 -14
- package/src/decoders/fields/decode-line-price.ts +1 -7
- package/src/decoders/fields/decode-line-shared.ts +2 -4
- package/src/decoders/fields/decode-message-level-party.ts +1 -1
- package/src/decoders/fields/decode-node-list.ts +15 -0
- package/src/decoders/fields/decode-order-reference.ts +1 -1
- package/src/decoders/fields/decode-parties-tax-scheme.ts +1 -1
- package/src/decoders/fields/decode-party-legal-entity.ts +1 -1
- package/src/decoders/fields/decode-party-tax-scheme.ts +1 -1
- package/src/decoders/fields/decode-party.ts +3 -14
- package/src/decoders/fields/decode-payee-party.ts +1 -1
- package/src/decoders/fields/decode-payment-means.ts +2 -2
- package/src/decoders/fields/decode-payment-terms.ts +1 -1
- package/src/decoders/fields/decode-price-allowance-charge.ts +1 -7
- package/src/decoders/fields/decode-quantity.ts +1 -6
- package/src/decoders/fields/decode-simple-identifier.ts +1 -1
- package/src/decoders/fields/decode-tax-category.ts +1 -1
- package/src/decoders/fields/decode-tax-representative-party.ts +1 -1
- package/src/decoders/fields/decode-tax-totals.ts +2 -2
- package/src/decoders/fields/encode-additional-document-references.ts +3 -2
- package/src/decoders/fields/encode-address.ts +1 -1
- package/src/decoders/fields/encode-allowance-charges.ts +3 -2
- package/src/decoders/fields/encode-amount.ts +1 -1
- package/src/decoders/fields/encode-billing-references.ts +2 -2
- package/src/decoders/fields/encode-contact.ts +1 -1
- package/src/decoders/fields/encode-credit-note-lines.ts +2 -2
- package/src/decoders/fields/encode-delivery.ts +1 -1
- package/src/decoders/fields/encode-identifier.ts +1 -1
- package/src/decoders/fields/encode-invoice-line-period.ts +1 -1
- package/src/decoders/fields/encode-invoice-lines.ts +2 -2
- package/src/decoders/fields/encode-invoice-period.ts +1 -1
- package/src/decoders/fields/encode-legal-monetary-total.ts +1 -1
- package/src/decoders/fields/encode-line-allowance-charges.ts +2 -2
- package/src/decoders/fields/encode-line-price.ts +1 -1
- package/src/decoders/fields/encode-line-shared.ts +1 -1
- package/src/decoders/fields/encode-message-party.ts +26 -13
- package/src/decoders/fields/encode-order-reference.ts +1 -1
- package/src/decoders/fields/encode-parties-tax-scheme.ts +1 -1
- package/src/decoders/fields/encode-party-tax-scheme.ts +1 -1
- package/src/decoders/fields/encode-party.ts +1 -1
- package/src/decoders/fields/encode-payee-party.ts +1 -1
- package/src/decoders/fields/encode-payment-means.ts +2 -2
- package/src/decoders/fields/encode-payment-terms.ts +1 -1
- package/src/decoders/fields/encode-price-allowance-charges.ts +1 -1
- package/src/decoders/fields/encode-quantity.ts +1 -1
- package/src/decoders/fields/encode-tax-category.ts +1 -1
- package/src/decoders/fields/encode-tax-representative-party.ts +1 -1
- package/src/decoders/fields/encode-tax-totals.ts +4 -4
- package/src/helpers/bool.ts +9 -12
- package/src/helpers/get-prop.ts +2 -4
- package/src/helpers/str-or-und.ts +3 -4
- package/src/helpers/str.ts +12 -8
- package/src/index.ts +56 -6
- package/src/schemas/fields/peppol-additional-document-reference-schema.ts +123 -0
- package/src/schemas/fields/peppol-address-schema.ts +112 -0
- package/src/schemas/fields/peppol-allowance-charge-schema.ts +104 -0
- package/src/schemas/fields/peppol-amount-schema.ts +23 -0
- package/src/schemas/fields/peppol-base-line-schema.ts +141 -0
- package/src/{effect → schemas}/fields/peppol-billing-reference-schema.ts +25 -20
- package/src/schemas/fields/peppol-binary-object-schema.ts +52 -0
- package/src/schemas/fields/peppol-contact-schema.ts +20 -0
- package/src/schemas/fields/peppol-credit-note-line-schema.ts +44 -0
- package/src/schemas/fields/peppol-delivery-schema.ts +109 -0
- package/src/schemas/fields/peppol-identifier-schema.ts +21 -0
- package/src/schemas/fields/peppol-invoice-line-period-schema.ts +35 -0
- package/src/{effect → schemas}/fields/peppol-invoice-line-schema.ts +10 -10
- package/src/schemas/fields/peppol-invoice-period-schema.ts +31 -0
- package/src/schemas/fields/peppol-item-classification-schema.ts +46 -0
- package/src/schemas/fields/peppol-legal-monetary-total-schema.ts +127 -0
- package/src/schemas/fields/peppol-line-allowance-charge-schema.ts +68 -0
- package/src/schemas/fields/peppol-line-item-schema.ts +196 -0
- package/src/schemas/fields/peppol-line-price-allowance-charge-schema.ts +41 -0
- package/src/schemas/fields/peppol-line-price-schema.ts +32 -0
- package/src/schemas/fields/peppol-order-reference-schema.ts +38 -0
- package/src/schemas/fields/peppol-party-base-schema.ts +145 -0
- package/src/schemas/fields/peppol-party-legal-entity-schema.ts +32 -0
- package/src/schemas/fields/peppol-party-tax-scheme-schema.ts +41 -0
- package/src/schemas/fields/peppol-payee-party-schema.ts +119 -0
- package/src/schemas/fields/peppol-payment-means-schema.ts +224 -0
- package/src/schemas/fields/peppol-payment-terms-schema.ts +25 -0
- package/src/schemas/fields/peppol-quantity-schema.ts +22 -0
- package/src/schemas/fields/peppol-reference-schema.ts +9 -0
- package/src/schemas/fields/peppol-tax-category-schema.ts +47 -0
- package/src/schemas/fields/peppol-tax-representative-schema.ts +26 -0
- package/src/{effect → schemas}/fields/peppol-tax-subtotal-category-schema.ts +7 -6
- package/src/schemas/fields/peppol-tax-subtotal-schema.ts +33 -0
- package/src/schemas/fields/peppol-tax-totals-base-schema.ts +28 -0
- package/src/schemas/peppol-billing-base-schema.ts +366 -0
- package/src/schemas/peppol-credit-note-schema.ts +31 -0
- package/src/schemas/peppol-document-response-document-reference-schema.ts +41 -0
- package/src/schemas/peppol-document-response-document-schema.ts +38 -0
- package/src/schemas/peppol-document-response-line-response-content-schema.ts +49 -0
- package/src/schemas/peppol-document-response-line-response-schema.ts +40 -0
- package/src/schemas/peppol-document-schema.ts +120 -0
- package/src/{effect → schemas}/peppol-invoice-response-document-actual-response-schema.ts +25 -16
- package/src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts +63 -0
- package/src/schemas/peppol-invoice-response-schema.ts +176 -0
- package/src/schemas/peppol-invoice-response-status-reason-code-schema.ts +40 -0
- package/src/schemas/peppol-invoice-schema.ts +45 -0
- package/src/schemas/peppol-iso-date-string.ts +20 -0
- package/src/schemas/peppol-message-level-response-document-response-schema.ts +35 -0
- package/src/schemas/peppol-message-level-response-party-schema.ts +20 -0
- package/src/schemas/peppol-message-level-response-schema.ts +98 -0
- package/src/schemas/utils/format-xsd-time.ts +80 -0
- package/src/{effect → schemas}/utils/index.ts +1 -1
- package/src/schemas/utils/is-valid-process.ts +1 -1
- package/src/schemas/utils/opaque.ts +19 -0
- package/src/{effect → schemas}/utils/peppol-vat-regex-schema.ts +0 -2
- package/src/schemas/utils/peppol-xsd-time-schema.ts +79 -0
- package/src/schemas/utils/quantity-unit-code-to-intl-unit.ts +2 -2
- package/src/schemas/values/credit-note-type-code-schema.ts +3 -5
- package/src/schemas/values/document-type-schemes-schema.ts +3 -5
- package/src/schemas/values/document-type-values-schema.ts +4 -7
- package/src/{effect → schemas}/values/duty-tax-fee-category-schema.ts +3 -3
- package/src/schemas/values/invoice-type-code-schema.ts +4 -8
- package/src/schemas/values/process-from-document-type-schema.ts +10 -12
- package/src/schemas/values/quantity-unit-codes-schema.ts +4 -8
- package/src/schematron/cen/ae/cen-en16931-br-ae-01.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-02.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-03.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-04.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-05.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-06.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-07.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-08.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-09.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-10.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-01.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-02.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-03.ts +6 -10
- package/src/schematron/cen/af/cen-en16931-br-af-04.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-05.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-06.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-07.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-08.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-09.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-10.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-01.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-02.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-03.ts +6 -10
- package/src/schematron/cen/ag/cen-en16931-br-ag-04.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-05.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-06.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-07.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-08.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-09.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-10.ts +6 -5
- package/src/schematron/cen/b/cen-en16931-br-b-01.ts +6 -5
- package/src/schematron/cen/b/cen-en16931-br-b-02.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-01.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-02.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-03.ts +9 -6
- package/src/schematron/cen/cen-en16931-br-04.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-05.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-06.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-07.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-08.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-09.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-10.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-11.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-12.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-13.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-14.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-15.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-16.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-17.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-18.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-19.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-20.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-21.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-22.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-23.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-24.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-25.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-26.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-27.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-28.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-29.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-30.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-31.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-32.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-33.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-36.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-37.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-38.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-41.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-42.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-43.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-44.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-45.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-46.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-47.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-48.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-49.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-50.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-51.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-52.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-53.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-54.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-55.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-56.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-57.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-61.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-62.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-63.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-64.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-65.ts +6 -5
- package/src/schematron/cen/cl/cen-en16931-br-cl-08.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-03.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-04.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-05.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-06.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-07.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-08.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-09.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-10.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-11.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-12.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-13.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-14.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-15.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-16.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-17.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-18.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-19.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-20.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-21.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-22.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-23.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-24.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-25.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-26.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-01.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-02.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-05.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-06.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-09.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-10.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-11.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-12.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-13.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-14.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-15.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-16.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-17.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-18.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-19.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-20.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-23.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-24.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-25.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-27.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-28.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-01.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-02.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-03.ts +6 -10
- package/src/schematron/cen/e/cen-en16931-br-e-04.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-05.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-06.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-07.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-08.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-09.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-10.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-01.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-02.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-03.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-04.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-05.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-06.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-07.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-08.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-09.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-10.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-01.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-02.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-03.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-04.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-05.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-06.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-07.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-08.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-09.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-10.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-11.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-12.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-01.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-02.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-03.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-04.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-05.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-06.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-07.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-08.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-09.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-10.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-11.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-12.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-13.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-14.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-01.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-02.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-03.ts +6 -10
- package/src/schematron/cen/s/cen-en16931-br-s-04.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-05.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-06.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-07.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-08.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-09.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-10.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-01.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-02.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-03.ts +6 -10
- package/src/schematron/cen/z/cen-en16931-br-z-04.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-05.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-06.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-07.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-08.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-09.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-10.ts +6 -5
- package/src/schematron/de/de-r-001.ts +8 -7
- package/src/schematron/de/de-r-002.ts +8 -7
- package/src/schematron/de/de-r-003.ts +8 -7
- package/src/schematron/de/de-r-004.ts +8 -7
- package/src/schematron/de/de-r-005.ts +8 -7
- package/src/schematron/de/de-r-006.ts +8 -7
- package/src/schematron/de/de-r-007.ts +8 -7
- package/src/schematron/de/de-r-008.ts +8 -7
- package/src/schematron/de/de-r-009.ts +8 -7
- package/src/schematron/de/de-r-010.ts +9 -8
- package/src/schematron/de/de-r-011.ts +9 -8
- package/src/schematron/de/de-r-014.ts +8 -7
- package/src/schematron/de/de-r-015.ts +8 -7
- package/src/schematron/de/de-r-016.ts +9 -8
- package/src/schematron/de/de-r-017.ts +8 -7
- package/src/schematron/de/de-r-018.ts +10 -9
- package/src/schematron/de/de-r-019.ts +8 -7
- package/src/schematron/de/de-r-020.ts +8 -7
- package/src/schematron/de/de-r-022.ts +8 -7
- package/src/schematron/de/de-r-023-1.ts +8 -7
- package/src/schematron/de/de-r-023-2.ts +8 -7
- package/src/schematron/de/de-r-024-1.ts +8 -7
- package/src/schematron/de/de-r-024-2.ts +8 -7
- package/src/schematron/de/de-r-025-1.ts +8 -7
- package/src/schematron/de/de-r-025-2.ts +8 -7
- package/src/schematron/de/de-r-026.ts +9 -8
- package/src/schematron/de/de-r-027.ts +8 -7
- package/src/schematron/de/de-r-028.ts +8 -7
- package/src/schematron/de/de-r-030.ts +9 -8
- package/src/schematron/de/de-r-031.ts +8 -7
- package/src/schematron/dk/dk-r-002.ts +7 -6
- package/src/schematron/dk/dk-r-003.ts +8 -7
- package/src/schematron/dk/dk-r-004.ts +8 -7
- package/src/schematron/dk/dk-r-005.ts +8 -7
- package/src/schematron/dk/dk-r-006.ts +8 -7
- package/src/schematron/dk/dk-r-007.ts +8 -7
- package/src/schematron/dk/dk-r-008.ts +8 -7
- package/src/schematron/dk/dk-r-009.ts +8 -7
- package/src/schematron/dk/dk-r-010.ts +8 -7
- package/src/schematron/dk/dk-r-011.ts +8 -7
- package/src/schematron/dk/dk-r-013.ts +8 -7
- package/src/schematron/dk/dk-r-014.ts +7 -6
- package/src/schematron/dk/dk-r-016.ts +8 -7
- package/src/schematron/dk/dk-r-017.ts +8 -7
- package/src/schematron/errors.ts +17 -0
- package/src/schematron/gr/gr-r-001-1.ts +7 -6
- package/src/schematron/gr/gr-r-001-2.ts +8 -7
- package/src/schematron/gr/gr-r-001-3.ts +14 -9
- package/src/schematron/gr/gr-r-001-4.ts +8 -7
- package/src/schematron/gr/gr-r-001-5.ts +8 -7
- package/src/schematron/gr/gr-r-001-6.ts +7 -6
- package/src/schematron/gr/gr-r-001-7.ts +7 -6
- package/src/schematron/gr/gr-r-002.ts +7 -6
- package/src/schematron/gr/gr-r-003.ts +8 -7
- package/src/schematron/gr/gr-r-004-1.ts +7 -6
- package/src/schematron/gr/gr-r-004-2.ts +7 -6
- package/src/schematron/gr/gr-r-005.ts +7 -6
- package/src/schematron/gr/gr-r-006.ts +12 -11
- package/src/schematron/gr/gr-r-008-2.ts +7 -6
- package/src/schematron/gr/gr-r-008-3.ts +7 -6
- package/src/schematron/gr/gr-r-009.ts +7 -6
- package/src/schematron/gr/gr-r-010.ts +7 -6
- package/src/schematron/gr/gr-s-008-1.ts +7 -6
- package/src/schematron/gr/gr-s-011.ts +8 -7
- package/src/schematron/helpers.ts +46 -23
- package/src/schematron/index.ts +6 -1
- package/src/schematron/is/is-r-001.ts +7 -6
- package/src/schematron/is/is-r-002.ts +7 -6
- package/src/schematron/is/is-r-003.ts +7 -6
- package/src/schematron/is/is-r-004.ts +7 -6
- package/src/schematron/is/is-r-005.ts +7 -6
- package/src/schematron/is/is-r-006.ts +8 -7
- package/src/schematron/is/is-r-007.ts +8 -7
- package/src/schematron/is/is-r-008.ts +8 -7
- package/src/schematron/is/is-r-009.ts +8 -7
- package/src/schematron/is/is-r-010.ts +9 -8
- package/src/schematron/it/it-r-001.ts +7 -6
- package/src/schematron/it/it-r-002.ts +7 -6
- package/src/schematron/it/it-r-003.ts +7 -6
- package/src/schematron/it/it-r-004.ts +7 -6
- package/src/schematron/nl/nl-r-001.ts +7 -6
- package/src/schematron/nl/nl-r-002.ts +7 -6
- package/src/schematron/nl/nl-r-003.ts +8 -7
- package/src/schematron/nl/nl-r-004.ts +7 -6
- package/src/schematron/nl/nl-r-005.ts +8 -7
- package/src/schematron/nl/nl-r-006.ts +8 -7
- package/src/schematron/nl/nl-r-007.ts +8 -7
- package/src/schematron/nl/nl-r-008.ts +7 -6
- package/src/schematron/nl/nl-r-009.ts +8 -7
- package/src/schematron/no/no-r-001.ts +8 -7
- package/src/schematron/no/no-r-002.ts +7 -6
- package/src/schematron/peppol/cl/peppol-en16931-cl001.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl002.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl003.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl006.ts +7 -6
- package/src/schematron/peppol/cl/peppol-en16931-cl007.ts +27 -26
- package/src/schematron/peppol/cl/peppol-en16931-cl008.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r040.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r041.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r042.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r043.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r044.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r045.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r046.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r047.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r049.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r050.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r052.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r053.ts +6 -5
- package/src/schematron/peppol/f/peppol-en16931-f001.ts +27 -14
- package/src/schematron/peppol/p/peppol-en16931-p0100.ts +8 -7
- package/src/schematron/peppol/p/peppol-en16931-p0101.ts +8 -7
- package/src/schematron/peppol/p/peppol-en16931-p0104.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0105.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0106.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0107.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0108.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0109.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0110.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0111.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0112.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r001.ts +11 -13
- package/src/schematron/peppol/r/peppol-en16931-r002.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r003.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r004.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r005.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r007.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r008.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r010.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r020.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r040.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r041.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r042.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r043.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r044.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r046.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r051.ts +48 -27
- package/src/schematron/peppol/r/peppol-en16931-r053.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r054.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r055.ts +8 -7
- package/src/schematron/peppol/r/peppol-en16931-r061.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r100.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r101.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r110.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r111.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r120.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r121.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r130.ts +6 -5
- package/src/schematron/run-all-rules.ts +2 -7
- package/src/schematron/schematron.ts +36 -0
- package/src/schematron/se/se-r-001.ts +7 -6
- package/src/schematron/se/se-r-002.ts +7 -6
- package/src/schematron/se/se-r-003.ts +7 -6
- package/src/schematron/se/se-r-004.ts +7 -6
- package/src/schematron/se/se-r-005.ts +8 -7
- package/src/schematron/se/se-r-006.ts +7 -6
- package/src/schematron/se/se-r-007.ts +7 -6
- package/src/schematron/se/se-r-008.ts +7 -6
- package/src/schematron/se/se-r-009.ts +7 -6
- package/src/schematron/se/se-r-010.ts +7 -6
- package/src/schematron/se/se-r-011.ts +7 -6
- package/src/schematron/se/se-r-012.ts +7 -6
- package/src/schematron/se/se-r-013.ts +7 -6
- package/src/values/additional-document-reference-codes.generated.ts +2 -3
- package/src/values/allowance-charge-reason-codes.generated.ts +1 -1
- package/src/values/application-response-type-codes.generated.ts +1 -1
- package/src/values/charge-reason-codes.generated.ts +1 -1
- package/src/values/country-code.generated.ts +1 -1
- package/src/values/credit-notes-type-codes.generated.ts +1 -1
- package/src/values/currency-code.generated.ts +1 -1
- package/src/values/document-type-codes.generated.ts +1 -1
- package/src/values/document-type.generated.ts +2 -2
- package/src/values/duty-tax-fee-categories.generated.ts +1 -1
- package/src/values/eas-codes.generated.ts +1 -1
- package/src/values/icd-codes.generated.ts +7 -7
- package/src/values/invoice-status-codes.generated.ts +1 -1
- package/src/values/invoice-type-codes.generated.ts +1 -1
- package/src/values/item-classification-code.generated.ts +1 -1
- package/src/values/mime-codes.generated.ts +1 -1
- package/src/values/op-status-action.generated.ts +1 -1
- package/src/values/op-status-reason.generated.ts +1 -1
- package/src/values/participant-identifier-schemes.generated.ts +2 -2
- package/src/values/payment-means-codes.generated.ts +1 -1
- package/src/values/processes.generated.ts +1 -1
- package/src/values/quantity-unit-codes.generated.ts +1 -1
- package/src/values/vat-dates.generated.ts +1 -1
- package/src/values/vatex-codes.generated.ts +1 -1
- package/dist/all-union-fields-CxoyKBpI.d.ts +0 -445
- package/dist/all-union-fields-CxoyKBpI.d.ts.map +0 -1
- package/dist/document-DCcObB-a.d.ts +0 -1466
- package/dist/document-DCcObB-a.d.ts.map +0 -1
- package/dist/effect.d.ts +0 -6291
- package/dist/effect.d.ts.map +0 -1
- package/dist/effect.js +0 -3240
- package/dist/effect.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/is-valid-process-CSWL-q9f.js +0 -1590
- package/dist/is-valid-process-CSWL-q9f.js.map +0 -1
- package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts +0 -168
- package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts.map +0 -1
- package/dist/vat-dates.generated-DTVWQAdn.d.ts +0 -4812
- package/dist/vat-dates.generated-DTVWQAdn.d.ts.map +0 -1
- package/dist/vatex-codes.generated-BSgP3n5t.js.map +0 -1
- package/src/decoders/errors.ts +0 -11
- package/src/document-parser.ts +0 -70
- package/src/document.ts +0 -19
- package/src/effect/fields/default-customization-id.ts +0 -1
- package/src/effect/fields/default-profile-id.ts +0 -1
- package/src/effect/fields/peppol-additional-document-reference-schema.ts +0 -114
- package/src/effect/fields/peppol-address-schema.ts +0 -105
- package/src/effect/fields/peppol-allowance-charge-schema.ts +0 -95
- package/src/effect/fields/peppol-amount-schema.ts +0 -22
- package/src/effect/fields/peppol-base-line-schema.ts +0 -138
- package/src/effect/fields/peppol-binary-object-schema.ts +0 -51
- package/src/effect/fields/peppol-contact-schema.ts +0 -18
- package/src/effect/fields/peppol-credit-note-line-schema.ts +0 -42
- package/src/effect/fields/peppol-delivery-schema.ts +0 -100
- package/src/effect/fields/peppol-identifier-schema.ts +0 -19
- package/src/effect/fields/peppol-invoice-line-period-schema.ts +0 -34
- package/src/effect/fields/peppol-invoice-period-schema.ts +0 -30
- package/src/effect/fields/peppol-item-classification-schema.ts +0 -45
- package/src/effect/fields/peppol-legal-monetary-total-schema.ts +0 -126
- package/src/effect/fields/peppol-line-allowance-charge-schema.ts +0 -64
- package/src/effect/fields/peppol-line-item-schema.ts +0 -185
- package/src/effect/fields/peppol-line-price-allowance-charge-schema.ts +0 -38
- package/src/effect/fields/peppol-line-price-schema.ts +0 -31
- package/src/effect/fields/peppol-order-reference-schema.ts +0 -36
- package/src/effect/fields/peppol-party-base-schema.ts +0 -138
- package/src/effect/fields/peppol-party-legal-entity-schema.ts +0 -29
- package/src/effect/fields/peppol-party-tax-scheme-schema.ts +0 -33
- package/src/effect/fields/peppol-payee-party-schema.ts +0 -112
- package/src/effect/fields/peppol-payment-means-schema.ts +0 -210
- package/src/effect/fields/peppol-payment-terms-schema.ts +0 -23
- package/src/effect/fields/peppol-quantity-schema.ts +0 -21
- package/src/effect/fields/peppol-reference-schema.ts +0 -5
- package/src/effect/fields/peppol-tax-category-schema.ts +0 -42
- package/src/effect/fields/peppol-tax-representative-schema.ts +0 -23
- package/src/effect/fields/peppol-tax-subtotal-schema.ts +0 -32
- package/src/effect/fields/peppol-tax-totals-base-schema.ts +0 -25
- package/src/effect/index.ts +0 -56
- package/src/effect/peppol-billing-base-schema.ts +0 -355
- package/src/effect/peppol-credit-note-schema.ts +0 -30
- package/src/effect/peppol-document-response-document-reference-schema.ts +0 -38
- package/src/effect/peppol-document-response-document-schema.ts +0 -35
- package/src/effect/peppol-document-response-line-response-content-schema.ts +0 -44
- package/src/effect/peppol-document-response-line-response-schema.ts +0 -33
- package/src/effect/peppol-document-schema.ts +0 -142
- package/src/effect/peppol-invoice-response-document-actual-response-status-schema.ts +0 -60
- package/src/effect/peppol-invoice-response-schema.ts +0 -168
- package/src/effect/peppol-invoice-response-status-reason-code-schema.ts +0 -31
- package/src/effect/peppol-invoice-schema.ts +0 -42
- package/src/effect/peppol-iso-date-string-schema.ts +0 -19
- package/src/effect/peppol-message-level-response-document-response-schema.ts +0 -33
- package/src/effect/peppol-message-level-response-party-schema.ts +0 -19
- package/src/effect/peppol-message-level-response-schema.ts +0 -97
- package/src/effect/utils/format-quantity-with-unit.ts +0 -1
- package/src/effect/utils/get-credit-note-type-code-description.ts +0 -1
- package/src/effect/utils/get-invoice-type-code-description.ts +0 -1
- package/src/effect/utils/is-valid-credit-note-type-code.ts +0 -1
- package/src/effect/utils/is-valid-invoice-type-code.ts +0 -1
- package/src/effect/utils/is-valid-process.ts +0 -1
- package/src/effect/utils/peppol-xsd-time-schema.ts +0 -13
- package/src/effect/utils/quantity-unit-code-to-intl-unit.ts +0 -2
- package/src/effect/values/credit-note-type-code-schema.ts +0 -23
- package/src/effect/values/document-type-schemes-schema.ts +0 -14
- package/src/effect/values/document-type-values-schema.ts +0 -16
- package/src/effect/values/invoice-type-code-schema.ts +0 -21
- package/src/effect/values/process-from-document-type-schema.ts +0 -26
- package/src/effect/values/quantity-unit-codes-schema.ts +0 -24
- package/src/helpers/errors.ts +0 -6
- package/src/helpers/is-defined.ts +0 -3
- package/src/schemas/billing-base.ts +0 -362
- package/src/schemas/credit-note.ts +0 -28
- package/src/schemas/document-response-document-reference-schema.ts +0 -37
- package/src/schemas/document-response-document-schema.ts +0 -34
- package/src/schemas/document-response-line-response-content.ts +0 -43
- package/src/schemas/document-response-line-response-schema.ts +0 -33
- package/src/schemas/fields/additional-document-reference-schema.ts +0 -112
- package/src/schemas/fields/address-schema.ts +0 -105
- package/src/schemas/fields/allowance-charge-schema.ts +0 -86
- package/src/schemas/fields/amount-schema.ts +0 -21
- package/src/schemas/fields/base-line-schema.ts +0 -136
- package/src/schemas/fields/billing-references-schema.ts +0 -44
- package/src/schemas/fields/binary-object-schema.ts +0 -45
- package/src/schemas/fields/contact-schema.ts +0 -18
- package/src/schemas/fields/credit-note-line-schema.ts +0 -37
- package/src/schemas/fields/date-only-fn.ts +0 -6
- package/src/schemas/fields/date-only-parser.ts +0 -20
- package/src/schemas/fields/delivery-schema.ts +0 -95
- package/src/schemas/fields/identifier-schema.ts +0 -24
- package/src/schemas/fields/invoice-line-period-schema.ts +0 -31
- package/src/schemas/fields/invoice-line-schema.ts +0 -41
- package/src/schemas/fields/invoice-period-schema.ts +0 -27
- package/src/schemas/fields/legal-monetary-total-schema.ts +0 -125
- package/src/schemas/fields/line-allowance-charge-schema.ts +0 -59
- package/src/schemas/fields/line-item-schema.ts +0 -183
- package/src/schemas/fields/line-price-allowance-charge-schema.ts +0 -33
- package/src/schemas/fields/list-identifier-schema.ts +0 -43
- package/src/schemas/fields/order-reference-schema.ts +0 -36
- package/src/schemas/fields/party-base-schema.ts +0 -131
- package/src/schemas/fields/party-legal-entity-schema.ts +0 -29
- package/src/schemas/fields/party-tax-schema.ts +0 -33
- package/src/schemas/fields/payee-party.ts +0 -107
- package/src/schemas/fields/payment-means-schema.ts +0 -209
- package/src/schemas/fields/payment-terms-schema.ts +0 -23
- package/src/schemas/fields/price-schema.ts +0 -31
- package/src/schemas/fields/quantity-schema.ts +0 -21
- package/src/schemas/fields/reference-schema.ts +0 -4
- package/src/schemas/fields/tax-category-schema.ts +0 -41
- package/src/schemas/fields/tax-representative-party-schema.ts +0 -23
- package/src/schemas/fields/tax-subtotal-category-schema.ts +0 -26
- package/src/schemas/fields/tax-subtotal-schema.ts +0 -32
- package/src/schemas/fields/tax-totals.ts +0 -25
- package/src/schemas/fields/time-only.ts +0 -23
- package/src/schemas/invoice-response-document-actual-response-status.ts +0 -58
- package/src/schemas/invoice-response-document-actual-response.ts +0 -73
- package/src/schemas/invoice-response-schema.ts +0 -155
- package/src/schemas/invoice-response-status-reason-code.ts +0 -30
- package/src/schemas/invoice.ts +0 -43
- package/src/schemas/message-level-response-document-response-schema.ts +0 -33
- package/src/schemas/message-level-response-party-schema.ts +0 -18
- package/src/schemas/message-level-response-schema.ts +0 -96
- package/src/schemas/utils/base-64.ts +0 -34
- package/src/schemas/utils/vat-regex.ts +0 -51
- package/src/schemas/utils/xsd-time.ts +0 -9
- package/src/schemas/values/additional-document-reference-code.ts +0 -27
- package/src/schemas/values/allowance-charge-reason-code.ts +0 -29
- package/src/schemas/values/application-response-type-codes.ts +0 -25
- package/src/schemas/values/charge-reason-code.ts +0 -29
- package/src/schemas/values/country-code.ts +0 -36
- package/src/schemas/values/currency-codes.ts +0 -35
- package/src/schemas/values/document-type-codes.ts +0 -25
- package/src/schemas/values/document-type-schema.ts +0 -49
- package/src/schemas/values/duty-tax-fee-cateogries.ts +0 -28
- package/src/schemas/values/eas-codes.ts +0 -35
- package/src/schemas/values/icd-codes.ts +0 -28
- package/src/schemas/values/invoice-status-codes.ts +0 -25
- package/src/schemas/values/item-classification-code-schema.ts +0 -28
- package/src/schemas/values/mime-code.ts +0 -28
- package/src/schemas/values/op-status-action.ts +0 -25
- package/src/schemas/values/op-status-reason.ts +0 -25
- package/src/schemas/values/participant-identifier-code.ts +0 -25
- package/src/schemas/values/payment-means-codes-schema.ts +0 -36
- package/src/schemas/values/process-schema.ts +0 -41
- package/src/schemas/values/process-xml-identifier-schema.ts +0 -27
- package/src/schemas/values/vat-date-code.ts +0 -15
- package/src/schemas/values/vatex-code.ts +0 -28
- package/src/schemas.ts +0 -97
- /package/src/{effect → schemas}/utils/peppol-base-64-schema.ts +0 -0
- /package/src/{effect → schemas}/values/additional-document-reference-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/allowance-charge-reason-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/application-response-type-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/charge-reason-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/currency-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/electronic-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/icd-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/index.ts +0 -0
- /package/src/{effect → schemas}/values/invoice-status-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/item-classification-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/mime-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/op-status-action-schema.ts +0 -0
- /package/src/{effect → schemas}/values/op-status-reason-schema.ts +0 -0
- /package/src/{effect → schemas}/values/participant-identifier-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/payment-means-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-country-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-document-type-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-document-type-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-process-schema.ts +0 -0
- /package/src/{effect → schemas}/values/vat-date-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/vatex-code-schema.ts +0 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ICD/
|
|
12
12
|
*/
|
|
13
|
-
export const icdCodes = {
|
|
13
|
+
export const icdCodes: Record<IcdCodesKeys, string> = {
|
|
14
14
|
/**
|
|
15
15
|
* @description Notes on Use of Code: The Sirene number is used in France mainly for the official registration in the Trade Register and as the only number used
|
|
16
16
|
* between authorities and organizations, and between authorities when dealing with data interchange on organizations. Issuing agency: Institut
|
|
@@ -95,8 +95,8 @@ export const icdCodes = {
|
|
|
95
95
|
*/
|
|
96
96
|
'0017': 'COMMON LANGUAGE',
|
|
97
97
|
/**
|
|
98
|
-
* @description Notes on Use of Code: The ICD code will also form the initial part of the OSI Network addressing and naming tree as depicted in Addendum 2 to ISO
|
|
99
|
-
*
|
|
98
|
+
* @description Notes on Use of Code: The ICD code will also form the initial part of the OSI Network addressing and naming tree as depicted in Addendum 2 to ISO 8348.
|
|
99
|
+
* Issuing agency: International Business Machines Corporation, USA.
|
|
100
100
|
*/
|
|
101
101
|
'0018': 'SNA/OSI Network',
|
|
102
102
|
/**
|
|
@@ -401,8 +401,8 @@ export const icdCodes = {
|
|
|
401
401
|
*/
|
|
402
402
|
'0078': 'Mitel terminal or switching equipment',
|
|
403
403
|
/**
|
|
404
|
-
* @description Notes on Use of Code: The ICD code will also form part of the Initial Domain Part of the OSI network addressing as specified in Addendum 2 to ISO
|
|
405
|
-
*
|
|
404
|
+
* @description Notes on Use of Code: The ICD code will also form part of the Initial Domain Part of the OSI network addressing as specified in Addendum 2 to ISO 8348.
|
|
405
|
+
* Issuing agency: The ATM Forum, USA.
|
|
406
406
|
*/
|
|
407
407
|
'0079': 'ATM Forum',
|
|
408
408
|
/**
|
|
@@ -419,8 +419,8 @@ export const icdCodes = {
|
|
|
419
419
|
*/
|
|
420
420
|
'0082': "Norwegian Telecommunications Authority's, NTA'S, EDI, identifier scheme (EDIRA compliant)",
|
|
421
421
|
/**
|
|
422
|
-
* @description Notes on Use of Code: The ICD code will also form part of the Initial Domain Part of the OSI network addressing as specified in Addendum 2 to ISO
|
|
423
|
-
*
|
|
422
|
+
* @description Notes on Use of Code: The ICD code will also form part of the Initial Domain Part of the OSI network addressing as specified in Addendum 2 to ISO 8348.
|
|
423
|
+
* Issuing agency: ATM Ltd, ENGLAND.
|
|
424
424
|
*/
|
|
425
425
|
'0083': 'Advanced Telecommunications Modules Limited, Corporate Network',
|
|
426
426
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4343-T111/
|
|
14
14
|
*/
|
|
15
|
-
export const invoiceStatusCodes = {
|
|
15
|
+
export const invoiceStatusCodes: Record<InvoiceStatusCodesKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description Indicates that an acknowledgement relating to receipt of message or transaction is required. Status is used when Buyer has received a readable
|
|
18
18
|
* invoice message that can be understood and submitted for processing by the Buyer.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1001-inv/
|
|
14
14
|
*/
|
|
15
|
-
export const invoiceTypeCodes = {
|
|
15
|
+
export const invoiceTypeCodes: Record<InvoiceTypeCodesKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description Document/message issued by a creditor to a debtor to request payment of one or more invoices past due.
|
|
18
18
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL7143/
|
|
14
14
|
*/
|
|
15
|
-
export const itemClassificationCodes = {
|
|
15
|
+
export const itemClassificationCodes: Record<ItemClassificationCodesKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description Number assigned by manufacturer or seller to identify the release of a product.
|
|
18
18
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/OPStatusReason/
|
|
14
14
|
*/
|
|
15
|
-
export const opStatusReason = {
|
|
15
|
+
export const opStatusReason: Record<OpStatusReasonKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description Indicates that receiver of the documents sends the message just to update the status and there are no problems with document processing.
|
|
18
18
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @enum
|
|
12
12
|
*/
|
|
13
|
-
export const participantIdentifierSchemes = {
|
|
13
|
+
export const participantIdentifierSchemes: Record<ParticipantIdentifierSchemesKeys, string> = {
|
|
14
14
|
/**
|
|
15
15
|
* @since 1.0.0
|
|
16
16
|
*
|
|
@@ -1488,7 +1488,7 @@ export const participantIdentifierSchemesKeys = [
|
|
|
1488
1488
|
'9959',
|
|
1489
1489
|
] as [string, ...string[]];
|
|
1490
1490
|
|
|
1491
|
-
export const participantIdentifierSchemesValidations = {
|
|
1491
|
+
export const participantIdentifierSchemesValidations: Record<string, Array<RegExp> | undefined> = {
|
|
1492
1492
|
'0002': [/[0-9]{9}([0-9]{5})?/g],
|
|
1493
1493
|
'0007': [/[0-9]{10}/g],
|
|
1494
1494
|
'0009': [/[0-9]{14}/g],
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4461/
|
|
14
14
|
*/
|
|
15
|
-
export const paymentMeansCodes = {
|
|
15
|
+
export const paymentMeansCodes: Record<PaymentMeansCodesKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description Not defined legally enforceable agreement between two or more parties (expressing a contractual right or a right to the payment of money).
|
|
18
18
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNECERec20/
|
|
14
14
|
*/
|
|
15
|
-
export const quantityUnitCodes = {
|
|
15
|
+
export const quantityUnitCodes: Record<QuantityUnitCodesKeys, string> = {
|
|
16
16
|
/**
|
|
17
17
|
* @description A unit of count defining the number of groups (group: set of items classified together).
|
|
18
18
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL2005/
|
|
14
14
|
*/
|
|
15
|
-
export const vatDateCodes = {
|
|
15
|
+
export const vatDateCodes: Record<VatDateCodesKeys, string> = {
|
|
16
16
|
'3': 'Invoice document issue date time',
|
|
17
17
|
|
|
18
18
|
'35': 'Delivery date/time, actual',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/vatex/
|
|
12
12
|
*/
|
|
13
|
-
export const vatexCodes = {
|
|
13
|
+
export const vatexCodes: Record<VatexCodesKeys, string> = {
|
|
14
14
|
/**
|
|
15
15
|
* @description Exemptions relating to repayment of expenditures. Remark, Repayment of expenditure is not an exemption in the sense of the VAT Directive but may
|
|
16
16
|
* be handled as such in the context of the EN16931.
|
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/primitive.d.ts
|
|
2
|
-
/**
|
|
3
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
4
|
-
|
|
5
|
-
@category Type
|
|
6
|
-
*/
|
|
7
|
-
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/union-to-intersection.d.ts
|
|
10
|
-
/**
|
|
11
|
-
Convert a union type to an intersection type.
|
|
12
|
-
|
|
13
|
-
Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
|
|
14
|
-
|
|
15
|
-
@example
|
|
16
|
-
```
|
|
17
|
-
import type {UnionToIntersection} from 'type-fest';
|
|
18
|
-
|
|
19
|
-
type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
|
|
20
|
-
|
|
21
|
-
type Intersection = UnionToIntersection<Union>;
|
|
22
|
-
//=> {the(): void} & {great(arg: string): void} & {escape: boolean}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
@category Type
|
|
26
|
-
*/
|
|
27
|
-
type UnionToIntersection<Union> = (
|
|
28
|
-
// `extends unknown` is always going to be the case and is used to convert the
|
|
29
|
-
// `Union` into a [distributive conditional
|
|
30
|
-
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
31
|
-
Union extends unknown ?
|
|
32
|
-
// The union type is used as the only argument to a function since the union
|
|
33
|
-
// of function arguments is an intersection.
|
|
34
|
-
(distributedUnion: Union) => void :
|
|
35
|
-
// This won't happen.
|
|
36
|
-
never
|
|
37
|
-
// Infer the `Intersection` type since TypeScript represents the positional
|
|
38
|
-
// arguments of unions of functions as an intersection of the union.
|
|
39
|
-
) extends ((mergedIntersection: infer Intersection) => void) ?
|
|
40
|
-
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
41
|
-
Intersection & Union : never;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/keys-of-union.d.ts
|
|
44
|
-
/**
|
|
45
|
-
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
46
|
-
|
|
47
|
-
Unlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member.
|
|
48
|
-
|
|
49
|
-
@link https://stackoverflow.com/a/49402091
|
|
50
|
-
|
|
51
|
-
@example
|
|
52
|
-
```
|
|
53
|
-
import type {KeysOfUnion} from 'type-fest';
|
|
54
|
-
|
|
55
|
-
type A = {
|
|
56
|
-
common: string;
|
|
57
|
-
a: number;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
type B = {
|
|
61
|
-
common: string;
|
|
62
|
-
b: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
type C = {
|
|
66
|
-
common: string;
|
|
67
|
-
c: boolean;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
type Union = A | B | C;
|
|
71
|
-
|
|
72
|
-
type CommonKeys = keyof Union;
|
|
73
|
-
//=> 'common'
|
|
74
|
-
|
|
75
|
-
type AllKeys = KeysOfUnion<Union>;
|
|
76
|
-
//=> 'common' | 'a' | 'b' | 'c'
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
@category Object
|
|
80
|
-
*/
|
|
81
|
-
type KeysOfUnion<ObjectType> =
|
|
82
|
-
// Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
83
|
-
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-never.d.ts
|
|
86
|
-
/**
|
|
87
|
-
Returns a boolean for whether the given type is `never`.
|
|
88
|
-
|
|
89
|
-
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
90
|
-
@link https://stackoverflow.com/a/53984913/10292952
|
|
91
|
-
@link https://www.zhenghao.io/posts/ts-never
|
|
92
|
-
|
|
93
|
-
Useful in type utilities, such as checking if something does not occur.
|
|
94
|
-
|
|
95
|
-
@example
|
|
96
|
-
```
|
|
97
|
-
import type {IsNever, And} from 'type-fest';
|
|
98
|
-
|
|
99
|
-
type A = IsNever<never>;
|
|
100
|
-
//=> true
|
|
101
|
-
|
|
102
|
-
type B = IsNever<any>;
|
|
103
|
-
//=> false
|
|
104
|
-
|
|
105
|
-
type C = IsNever<unknown>;
|
|
106
|
-
//=> false
|
|
107
|
-
|
|
108
|
-
type D = IsNever<never[]>;
|
|
109
|
-
//=> false
|
|
110
|
-
|
|
111
|
-
type E = IsNever<object>;
|
|
112
|
-
//=> false
|
|
113
|
-
|
|
114
|
-
type F = IsNever<string>;
|
|
115
|
-
//=> false
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
@example
|
|
119
|
-
```
|
|
120
|
-
import type {IsNever} from 'type-fest';
|
|
121
|
-
|
|
122
|
-
type IsTrue<T> = T extends true ? true : false;
|
|
123
|
-
|
|
124
|
-
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
125
|
-
type A = IsTrue<never>;
|
|
126
|
-
//=> never
|
|
127
|
-
|
|
128
|
-
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
129
|
-
type IsTrueFixed<T> =
|
|
130
|
-
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
131
|
-
|
|
132
|
-
type B = IsTrueFixed<never>;
|
|
133
|
-
//=> false
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
@category Type Guard
|
|
137
|
-
@category Utilities
|
|
138
|
-
*/
|
|
139
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
142
|
-
/**
|
|
143
|
-
Represents an array with `unknown` value.
|
|
144
|
-
|
|
145
|
-
Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
146
|
-
|
|
147
|
-
@example
|
|
148
|
-
```
|
|
149
|
-
import type {UnknownArray} from 'type-fest';
|
|
150
|
-
|
|
151
|
-
type IsArray<T> = T extends UnknownArray ? true : false;
|
|
152
|
-
|
|
153
|
-
type A = IsArray<['foo']>;
|
|
154
|
-
//=> true
|
|
155
|
-
|
|
156
|
-
type B = IsArray<readonly number[]>;
|
|
157
|
-
//=> true
|
|
158
|
-
|
|
159
|
-
type C = IsArray<string>;
|
|
160
|
-
//=> false
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
@category Type
|
|
164
|
-
@category Array
|
|
165
|
-
*/
|
|
166
|
-
type UnknownArray = readonly unknown[];
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/type.d.ts
|
|
169
|
-
/**
|
|
170
|
-
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
171
|
-
*/
|
|
172
|
-
type BuiltIns = Primitive | void | Date | RegExp;
|
|
173
|
-
/**
|
|
174
|
-
Matches non-recursive types.
|
|
175
|
-
*/
|
|
176
|
-
type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown) | Promise<unknown>;
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/simplify.d.ts
|
|
179
|
-
/**
|
|
180
|
-
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
181
|
-
|
|
182
|
-
@example
|
|
183
|
-
```
|
|
184
|
-
import type {Simplify} from 'type-fest';
|
|
185
|
-
|
|
186
|
-
type PositionProps = {
|
|
187
|
-
top: number;
|
|
188
|
-
left: number;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
type SizeProps = {
|
|
192
|
-
width: number;
|
|
193
|
-
height: number;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// In your editor, hovering over `Props` will show a flattened object with all the properties.
|
|
197
|
-
type Props = Simplify<PositionProps & SizeProps>;
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
|
|
201
|
-
|
|
202
|
-
If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
|
|
203
|
-
|
|
204
|
-
@example
|
|
205
|
-
```
|
|
206
|
-
import type {Simplify} from 'type-fest';
|
|
207
|
-
|
|
208
|
-
interface SomeInterface {
|
|
209
|
-
foo: number;
|
|
210
|
-
bar?: string;
|
|
211
|
-
baz: number | undefined;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
type SomeType = {
|
|
215
|
-
foo: number;
|
|
216
|
-
bar?: string;
|
|
217
|
-
baz: number | undefined;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
221
|
-
const someType: SomeType = literal;
|
|
222
|
-
const someInterface: SomeInterface = literal;
|
|
223
|
-
|
|
224
|
-
declare function fn(object: Record<string, unknown>): void;
|
|
225
|
-
|
|
226
|
-
fn(literal); // Good: literal object type is sealed
|
|
227
|
-
fn(someType); // Good: type is sealed
|
|
228
|
-
// @ts-expect-error
|
|
229
|
-
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
230
|
-
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
234
|
-
@see {@link SimplifyDeep}
|
|
235
|
-
@category Object
|
|
236
|
-
*/
|
|
237
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-equal.d.ts
|
|
240
|
-
/**
|
|
241
|
-
Returns a boolean for whether the two given types are equal.
|
|
242
|
-
|
|
243
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
244
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
245
|
-
|
|
246
|
-
Use-cases:
|
|
247
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
248
|
-
|
|
249
|
-
@example
|
|
250
|
-
```
|
|
251
|
-
import type {IsEqual} from 'type-fest';
|
|
252
|
-
|
|
253
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
254
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
255
|
-
type Includes<Value extends readonly any[], Item> =
|
|
256
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
257
|
-
? IsEqual<Value[0], Item> extends true
|
|
258
|
-
? true
|
|
259
|
-
: Includes<rest, Item>
|
|
260
|
-
: false;
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
@category Type Guard
|
|
264
|
-
@category Utilities
|
|
265
|
-
*/
|
|
266
|
-
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
267
|
-
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
268
|
-
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/object.d.ts
|
|
271
|
-
/**
|
|
272
|
-
Extract all possible values for a given key from a union of object types.
|
|
273
|
-
|
|
274
|
-
@example
|
|
275
|
-
```
|
|
276
|
-
type Statuses = ValueOfUnion<{id: 1; status: 'open'} | {id: 2; status: 'closed'}, 'status'>;
|
|
277
|
-
//=> "open" | "closed"
|
|
278
|
-
```
|
|
279
|
-
*/
|
|
280
|
-
type ValueOfUnion<Union, Key extends KeysOfUnion<Union>> = Union extends unknown ? Key extends keyof Union ? Union[Key] : never : never;
|
|
281
|
-
/**
|
|
282
|
-
Extract all readonly keys from a union of object types.
|
|
283
|
-
|
|
284
|
-
@example
|
|
285
|
-
```
|
|
286
|
-
type User = {
|
|
287
|
-
readonly id: string;
|
|
288
|
-
name: string;
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
type Post = {
|
|
292
|
-
readonly id: string;
|
|
293
|
-
readonly author: string;
|
|
294
|
-
body: string;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
type ReadonlyKeys = ReadonlyKeysOfUnion<User | Post>;
|
|
298
|
-
//=> "id" | "author"
|
|
299
|
-
```
|
|
300
|
-
*/
|
|
301
|
-
type ReadonlyKeysOfUnion<Union> = Union extends unknown ? keyof { [Key in keyof Union as IsEqual<{ [K in Key]: Union[Key]; }, { readonly [K in Key]: Union[Key]; }> extends true ? Key : never]: never; } : never;
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/shared-union-fields.d.ts
|
|
304
|
-
/**
|
|
305
|
-
Create a type with shared fields from a union of object types.
|
|
306
|
-
|
|
307
|
-
Use-cases:
|
|
308
|
-
- You want a safe object type where each key exists in the union object.
|
|
309
|
-
- You want to focus on the common fields of the union type and don't want to have to care about the other fields.
|
|
310
|
-
|
|
311
|
-
@example
|
|
312
|
-
```
|
|
313
|
-
import type {SharedUnionFields} from 'type-fest';
|
|
314
|
-
|
|
315
|
-
type Cat = {
|
|
316
|
-
name: string;
|
|
317
|
-
type: 'cat';
|
|
318
|
-
catType: string;
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
type Dog = {
|
|
322
|
-
name: string;
|
|
323
|
-
type: 'dog';
|
|
324
|
-
dogType: string;
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
function displayPetInfo(petInfo: Cat | Dog) {
|
|
328
|
-
// typeof petInfo =>
|
|
329
|
-
// {
|
|
330
|
-
// name: string;
|
|
331
|
-
// type: 'cat';
|
|
332
|
-
// catType: string; // Needn't care about this field, because it's not a common pet info field.
|
|
333
|
-
// } | {
|
|
334
|
-
// name: string;
|
|
335
|
-
// type: 'dog';
|
|
336
|
-
// dogType: string; // Needn't care about this field, because it's not a common pet info field.
|
|
337
|
-
// }
|
|
338
|
-
|
|
339
|
-
// petInfo type is complex and have some needless fields
|
|
340
|
-
|
|
341
|
-
console.log('name:', petInfo.name);
|
|
342
|
-
console.log('type:', petInfo.type);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
function displayPetInfoWithSharedUnionFields(petInfo: SharedUnionFields<Cat | Dog>) {
|
|
346
|
-
// typeof petInfo =>
|
|
347
|
-
// {
|
|
348
|
-
// name: string;
|
|
349
|
-
// type: 'cat' | 'dog';
|
|
350
|
-
// }
|
|
351
|
-
|
|
352
|
-
// petInfo type is simple and clear
|
|
353
|
-
|
|
354
|
-
console.log('name:', petInfo.name);
|
|
355
|
-
console.log('type:', petInfo.type);
|
|
356
|
-
}
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
@see {@link SharedUnionFieldsDeep}
|
|
360
|
-
@see {@link AllUnionFields}
|
|
361
|
-
|
|
362
|
-
@category Object
|
|
363
|
-
@category Union
|
|
364
|
-
*/
|
|
365
|
-
type SharedUnionFields<Union> = Extract<Union, NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | UnknownArray> extends (infer SkippedMembers) ? Exclude<Union, SkippedMembers> extends (infer RelevantMembers) ?
|
|
366
|
-
// eslint-disable-line @stylistic/operator-linebreak
|
|
367
|
-
SkippedMembers | (IsNever<RelevantMembers> extends true ? never : Simplify<Pick<RelevantMembers, keyof RelevantMembers>>) : never : never;
|
|
368
|
-
//#endregion
|
|
369
|
-
//#region node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/all-union-fields.d.ts
|
|
370
|
-
/**
|
|
371
|
-
Create a type with all fields from a union of object types.
|
|
372
|
-
|
|
373
|
-
Use-cases:
|
|
374
|
-
- You want a safe object type where each key exists in the union object.
|
|
375
|
-
|
|
376
|
-
@example
|
|
377
|
-
```
|
|
378
|
-
import type {AllUnionFields} from 'type-fest';
|
|
379
|
-
|
|
380
|
-
type Cat = {
|
|
381
|
-
name: string;
|
|
382
|
-
type: 'cat';
|
|
383
|
-
catType: string;
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
type Dog = {
|
|
387
|
-
name: string;
|
|
388
|
-
type: 'dog';
|
|
389
|
-
dogType: string;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
function displayPetInfo(petInfo: Cat | Dog) {
|
|
393
|
-
// typeof petInfo =>
|
|
394
|
-
// {
|
|
395
|
-
// name: string;
|
|
396
|
-
// type: 'cat';
|
|
397
|
-
// catType: string;
|
|
398
|
-
// } | {
|
|
399
|
-
// name: string;
|
|
400
|
-
// type: 'dog';
|
|
401
|
-
// dogType: string;
|
|
402
|
-
// }
|
|
403
|
-
|
|
404
|
-
console.log('name:', petInfo.name);
|
|
405
|
-
console.log('type:', petInfo.type);
|
|
406
|
-
|
|
407
|
-
// TypeScript complains about `catType` and `dogType` not existing on type `Cat | Dog`.
|
|
408
|
-
// @ts-expect-error
|
|
409
|
-
console.log('animal type:', petInfo.catType ?? petInfo.dogType);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
function displayPetInfoWithAllUnionFields(petInfo: AllUnionFields<Cat | Dog>) {
|
|
413
|
-
// typeof petInfo =>
|
|
414
|
-
// {
|
|
415
|
-
// name: string;
|
|
416
|
-
// type: 'cat' | 'dog';
|
|
417
|
-
// catType?: string;
|
|
418
|
-
// dogType?: string;
|
|
419
|
-
// }
|
|
420
|
-
|
|
421
|
-
console.log('name:', petInfo.name);
|
|
422
|
-
console.log('type:', petInfo.type);
|
|
423
|
-
|
|
424
|
-
// No TypeScript error.
|
|
425
|
-
console.log('animal type:', petInfo.catType ?? petInfo.dogType);
|
|
426
|
-
}
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
@see {@link SharedUnionFields}
|
|
430
|
-
|
|
431
|
-
@category Object
|
|
432
|
-
@category Union
|
|
433
|
-
*/
|
|
434
|
-
type AllUnionFields<Union> = Extract<Union, NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | UnknownArray> extends (infer SkippedMembers) ? Exclude<Union, SkippedMembers> extends (infer RelevantMembers) ?
|
|
435
|
-
// eslint-disable-line @stylistic/operator-linebreak
|
|
436
|
-
SkippedMembers | Simplify<
|
|
437
|
-
// Include fields that are common in all union members
|
|
438
|
-
SharedUnionFields<RelevantMembers> &
|
|
439
|
-
// Include readonly fields present in any union member
|
|
440
|
-
{ readonly [P in ReadonlyKeysOfUnion<RelevantMembers>]?: ValueOfUnion<RelevantMembers, P & KeysOfUnion<RelevantMembers>>; } &
|
|
441
|
-
// Include remaining fields that are neither common nor readonly
|
|
442
|
-
{ [P in Exclude<KeysOfUnion<RelevantMembers>, ReadonlyKeysOfUnion<RelevantMembers> | keyof RelevantMembers>]?: ValueOfUnion<RelevantMembers, P>; }> : never : never;
|
|
443
|
-
//#endregion
|
|
444
|
-
export { AllUnionFields as t };
|
|
445
|
-
//# sourceMappingURL=all-union-fields-CxoyKBpI.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"all-union-fields-CxoyKBpI.d.ts","names":[],"sources":["../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/primitive.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/union-to-intersection.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/keys-of-union.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-never.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/unknown-array.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/type.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/simplify.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/is-equal.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/internal/object.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/shared-union-fields.d.ts","../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/all-union-fields.d.ts"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10],"mappings":";;;;;;KAKY;;;;;;;;;;;;;;;;;;;;KCYA,oBAAoB;;;;AAI/B;;;CAGI,kBAAkB;;;;;YAKX,0BAA0B;;AAEnC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCQN,YAAY;;MAEjB,oBAAoB,6BAA6B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCYzD,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;KC7Bd;;;;;;KChBA,WAAW,mBAAmB,OAAO;;;;KAKrC,mBAAmB,WAAW,oBAAoB,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KC6CnF,SAAS,QAAO,iBAAiB,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KChCvC,QAAQ,GAAG,MACrB,YAAY,MACT,YAAY,KACZ,SAAS,GAAG;;KAKZ,SAAS,GAAG,OACd,QAAQ,UAAU,IAAI,IAAI,qBAC1B,QAAQ,UAAU,IAAI,IAAI;;;;;;;;;;;;KC2GjB,aAAa,OAAO,YAAY,YAAY,UACvD,wBAAwB,kBAAkB,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;KAsB7C,oBAAoB,SAAS,iCACvC,aAAa,SAAS,WAAU,KAAK,MAAM,MAAM,qBAAkB,KAAK,MAAM,MAAM,wBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCpGhG,kBAAkB,SAC7B,QAAQ,OAAO,mBAAmB,gCAAgC,uBAAuB,6BAA4B,kBAClH,QAAQ,OAAO,+BAA8B;;AAE5C,kBACC,QAAQ,wCAER,SAAS,KAAK,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCJ/B,eAAe,SAC1B,QAAQ,OAAO,mBAAmB,gCAAgC,uBAAuB,6BAA4B,kBAClH,QAAQ,OAAO,+BAA8B;;AAE5C,iBACA;;AAED,kBAAkB;;YAGP,KAAK,oBAAoB,oBAAoB,aAAa,iBAAiB,IAAI,YAAY;;GAIpG,KAAK,QAAQ,YAAY,kBAAkB,oBAAoB,yBAAyB,oBAAoB,aAAa,iBAAiB"}
|