@ripwords/myinvois-client 0.3.7 → 0.4.1
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 +27 -0
- package/dist/{0X-qj3c_vAo.d.ts → 0X-bPhcc9Vv.d.ts} +2 -1
- package/dist/{1X-C72Wa4pk.d.ts → 1X-Bqi8dmY1.d.ts} +2 -1
- package/dist/{1X-B-lyAVC4.d.ts → 1X-DKHYQyRy.d.ts} +2 -1
- package/dist/{2X-CH89y3Af.d.ts → 2X-CemxuAeL.d.ts} +2 -1
- package/dist/{2X-BfCK614i.d.ts → 2X-DN6M21cV.d.ts} +2 -1
- package/dist/{3X-DryrwYRf.d.ts → 3X-DIYh_ue4.d.ts} +2 -1
- package/dist/{3X-Du10Ix_V.d.ts → 3X-DJRj5xLv.d.ts} +2 -1
- package/dist/{4X-x3cRFuSM.d.ts → 4X-BCvTomUF.d.ts} +2 -1
- package/dist/{4X-BPMLRoDv.d.ts → 4X-CZi5nwIr.d.ts} +2 -1
- package/dist/{5X-B52AKeTz.d.ts → 5X-Dji6Soz5.d.ts} +2 -1
- package/dist/{5X-Bv7M6KyG.d.ts → 5X-DyYBCAvY.d.ts} +2 -1
- package/dist/{6X-DBwpWPQ6.d.ts → 6X-CO_u4RIY.d.ts} +2 -1
- package/dist/{6X-ZeZ8OB57.d.ts → 6X-Csxu6lwi.d.ts} +2 -1
- package/dist/{7X-Dvw2Z2VN.d.ts → 7X-DivvfBsk.d.ts} +2 -1
- package/dist/{7X-C_XGDSpE.d.ts → 7X-vzJ01lNF.d.ts} +2 -1
- package/dist/{8X-Di_0wuRX.d.ts → 8X-C4Wf4jYK.d.ts} +2 -1
- package/dist/{8X-BkgoX8dg.d.ts → 8X-D_Pw1H3K.d.ts} +2 -1
- package/dist/{9X-8ZnvvViY.d.ts → 9X-1VwxN9g-.d.ts} +2 -1
- package/dist/{9X-Du0e44cq.d.ts → 9X-BwR9pibT.d.ts} +2 -1
- package/dist/{AX-BSPLpkVT.d.ts → AX-CDubGAZO.d.ts} +2 -1
- package/dist/{BX-u4yMaIkz.d.ts → BX-CBsKI8np.d.ts} +2 -1
- package/dist/{CX-BKZG0pVE.d.ts → CX-DhOdAFyg.d.ts} +2 -1
- package/dist/{DX-CwA9WJAf.d.ts → DX-CBiRJGqR.d.ts} +2 -1
- package/dist/{EX-BRNu1Ooi.d.ts → EX-CAn62WaX.d.ts} +2 -1
- package/dist/{FX-DBxjq6xY.d.ts → FX-CANpsLC4.d.ts} +2 -1
- package/dist/{GX-B3CvWNrP.d.ts → GX-BvSZZ8pE.d.ts} +2 -1
- package/dist/{HX-D7FABgTv.d.ts → HX-CxrnY-YC.d.ts} +2 -1
- package/dist/{IX-D3ZknsAB.d.ts → IX-wdAD6eW8.d.ts} +2 -1
- package/dist/{JX-BRaZM3Gc.d.ts → JX-B5v815to.d.ts} +2 -1
- package/dist/{KX-B1K0OWoi.d.ts → KX-BI8n7ACj.d.ts} +2 -1
- package/dist/{LX-CKRefinL.d.ts → LX-BVvEz6Ji.d.ts} +2 -1
- package/dist/{MX-DKmaeO9r.d.ts → MX-D_OsOP_v.d.ts} +2 -1
- package/dist/{NX-CJL2Gn1U.d.ts → NX-DIhAzAY3.d.ts} +2 -1
- package/dist/{OX-Do2ap5v_.d.ts → OX-BZrRnj5g.d.ts} +2 -1
- package/dist/{PX-_DOr_rm9.d.ts → PX-DGGrJNym.d.ts} +2 -1
- package/dist/{QX-HlXLkIki.d.ts → QX-DuTJFnHX.d.ts} +2 -1
- package/dist/{RX-DVPGOVES.d.ts → RX-DYQoV7am.d.ts} +2 -1
- package/dist/{SX-OGT3qwlS.d.ts → SX-Dl1RlNnc.d.ts} +2 -1
- package/dist/{TX-cPDINmZ5.d.ts → TX-SoIfFaZj.d.ts} +2 -1
- package/dist/{UX-Be3sqvPV.d.ts → UX-DqBfrSsY.d.ts} +2 -1
- package/dist/{VX-CoEuBNDK.d.ts → VX-Ahcpp3Si.d.ts} +2 -1
- package/dist/{WX-DMvw__jH.d.ts → WX-Di6vYD7A.d.ts} +2 -1
- package/dist/{XX-DOA-10JW.d.ts → XX-BE4flzh6.d.ts} +2 -1
- package/dist/{YX-F34sJ7Ik.d.ts → YX-BPO04gSZ.d.ts} +2 -1
- package/dist/{ZX-CDQOfsHh.d.ts → ZX-DHu4FRKS.d.ts} +2 -1
- package/dist/{index2.cjs → api/documentManagement.cjs} +1 -1
- package/dist/api/documentManagement.d.cts +90 -0
- package/dist/api/documentManagement.d.ts +62 -61
- package/dist/api/documentManagement.js +1 -1
- package/dist/{index3.cjs → api/documentSubmission.cjs} +3 -3
- package/dist/api/documentSubmission.d.cts +93 -0
- package/dist/api/documentSubmission.d.ts +62 -61
- package/dist/api/documentSubmission.js +2 -2
- package/dist/{index4.cjs → api/documentTypeManagement.cjs} +1 -1
- package/dist/api/documentTypeManagement.d.cts +71 -0
- package/dist/api/documentTypeManagement.d.ts +62 -61
- package/dist/api/notificationManagement.cjs +3 -0
- package/dist/api/notificationManagement.d.cts +69 -0
- package/dist/api/notificationManagement.d.ts +62 -61
- package/dist/api/platformLogin.cjs +3 -0
- package/dist/api/platformLogin.d.cts +69 -0
- package/dist/api/platformLogin.d.ts +62 -61
- package/dist/api/taxpayerValidation.cjs +6 -0
- package/dist/api/taxpayerValidation.d.cts +72 -0
- package/dist/api/taxpayerValidation.d.ts +62 -61
- package/dist/apiQueue-B6Q644Bz.js +2 -1
- package/dist/apiQueue-B6Q644Bz.js.map +1 -0
- package/dist/{apiQueue-DgKWaQDS.cjs → apiQueue-C45w-ymm.cjs} +1 -1
- package/dist/{apiQueue-DgKWaQDS.cjs.map → apiQueue-C45w-ymm.cjs.map} +1 -1
- package/dist/{certificate-COwqszxD.js → certificate-Cg6spxUs.js} +2 -21
- package/dist/certificate-Cg6spxUs.js.map +1 -0
- package/dist/{certificate-CWmfCPdt.cjs → certificate-Dw46fkYv.cjs} +5 -31
- package/dist/certificate-Dw46fkYv.cjs.map +1 -0
- package/dist/{classification-codes-C2X4xW5-.d.ts → classification-codes-BQMnAQFr.d.ts} +2 -1
- package/dist/{country-code-DsI8Mbzx.d.ts → country-code-DAejE5RV.d.ts} +2 -1
- package/dist/{currencies-DKuDflOO.d.ts → currencies-Cg9RkxRB.d.ts} +2 -1
- package/dist/{document-B6ab06s1.cjs → document-B11B5lqd.cjs} +75 -21
- package/dist/document-B11B5lqd.cjs.map +1 -0
- package/dist/{document-Bb5WkhRe.js → document-BC52NCdW.js} +46 -19
- package/dist/document-BC52NCdW.js.map +1 -0
- package/dist/document-BQdoGqOl.d.cts +157 -0
- package/dist/document-CnamySca.d.ts +157 -0
- package/dist/{documentManagement-lPm8Gziu.js → documentManagement-DZKm582-.js} +4 -2
- package/dist/documentManagement-DZKm582-.js.map +1 -0
- package/dist/{documentManagement-BviJDtf2.cjs → documentManagement-qJnd0l1z.cjs} +3 -2
- package/dist/documentManagement-qJnd0l1z.cjs.map +1 -0
- package/dist/{documentSubmission-C-v4_4-x.cjs → documentSubmission-BaPECvYU.cjs} +5 -5
- package/dist/{documentSubmission-C-v4_4-x.cjs.map → documentSubmission-BaPECvYU.cjs.map} +1 -1
- package/dist/{documentSubmission-igf605QK.js → documentSubmission-DSsX0ldK.js} +6 -5
- package/dist/documentSubmission-DSsX0ldK.js.map +1 -0
- package/dist/{documentTypeManagement-D_-LiQVg.cjs → documentTypeManagement-DXRLfTsW.cjs} +1 -1
- package/dist/{documentTypeManagement-D_-LiQVg.cjs.map → documentTypeManagement-DXRLfTsW.cjs.map} +1 -1
- package/dist/documentTypeManagement-cBtVCOY3.js +2 -1
- package/dist/documentTypeManagement-cBtVCOY3.js.map +1 -0
- package/dist/{documents-BYV12TVt.d.ts → documents-BpZn3hJq.d.ts} +10 -9
- package/dist/{e-invoice-C2TxhyrK.d.ts → e-invoice-BSCFsH-H.d.ts} +2 -1
- package/dist/formatIdValue-qTxJqj9o.js +2 -1
- package/dist/formatIdValue-qTxJqj9o.js.map +1 -0
- package/dist/{getBaseUrl-D0G4GZmp.cjs → getBaseUrl-D2iJdUGL.cjs} +1 -1
- package/dist/{getBaseUrl-D0G4GZmp.cjs.map → getBaseUrl-D2iJdUGL.cjs.map} +1 -1
- package/dist/getBaseUrl-D7nUmoYb.js +2 -1
- package/dist/getBaseUrl-D7nUmoYb.js.map +1 -0
- package/dist/{index-CygwSf0x.d.ts → index-Dn3JIREW.d.ts} +2 -1
- package/dist/index.cjs +14 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +616 -0
- package/dist/index.d.ts +63 -61
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -0
- package/dist/lineItems-Btjkf6VX.js +58 -0
- package/dist/lineItems-Btjkf6VX.js.map +1 -0
- package/dist/lineItems-C8iT0OL1.cjs +64 -0
- package/dist/lineItems-C8iT0OL1.cjs.map +1 -0
- package/dist/lineItems-CBSo7giH.d.cts +32 -0
- package/dist/lineItems-CrkEXi2m.d.ts +32 -0
- package/dist/msic-codes-kysVPGdN.d.ts +26 -0
- package/dist/{notificationManagement-DLBDn77E.cjs → notificationManagement-C_qrFwWL.cjs} +1 -1
- package/dist/{notificationManagement-DLBDn77E.cjs.map → notificationManagement-C_qrFwWL.cjs.map} +1 -1
- package/dist/notificationManagement-n4Z5e-My.js +2 -1
- package/dist/notificationManagement-n4Z5e-My.js.map +1 -0
- package/dist/{notifications-sFhgh3rJ.d.ts → notifications-B4BymhRJ.d.ts} +2 -1
- package/dist/{payment-modes-g3DzLmWb.d.ts → payment-modes-BGP5McTY.d.ts} +2 -1
- package/dist/platformLogin-CqI9OLYP.js +2 -1
- package/dist/platformLogin-CqI9OLYP.js.map +1 -0
- package/dist/{platformLogin-Ch6hFKoU.cjs → platformLogin-DC4s6Qpv.cjs} +1 -1
- package/dist/{platformLogin-Ch6hFKoU.cjs.map → platformLogin-DC4s6Qpv.cjs.map} +1 -1
- package/dist/{signatures-CerHUrj3.d.ts → signatures-Bk5aKcq6.d.ts} +2 -1
- package/dist/{state-codes-Ow4oehYT.d.ts → state-codes-CAkYQnTd.d.ts} +2 -1
- package/dist/{tax-types-ClyLgydM.d.ts → tax-types-QeZFKqew.d.ts} +2 -1
- package/dist/{taxpayer-BAoT73gg.d.ts → taxpayer-B1CSMqNS.d.ts} +4 -3
- package/dist/{taxpayerValidation-j8s6YGED.cjs → taxpayerValidation-DzCJROgP.cjs} +1 -1
- package/dist/{taxpayerValidation-j8s6YGED.cjs.map → taxpayerValidation-DzCJROgP.cjs.map} +1 -1
- package/dist/taxpayerValidation-Xd_EHDvk.js +2 -1
- package/dist/taxpayerValidation-Xd_EHDvk.js.map +1 -0
- package/dist/{index16.cjs → types/classification-codes.d.cjs} +1 -1
- package/dist/types/classification-codes.d.cjs.map +1 -0
- package/dist/types/classification-codes.d.cts +2 -0
- package/dist/types/classification-codes.d.ts +1 -1
- package/dist/{index17.cjs → types/country-code.d.cjs} +1 -1
- package/dist/types/country-code.d.cjs.map +1 -0
- package/dist/types/country-code.d.cts +2 -0
- package/dist/types/country-code.d.ts +1 -1
- package/dist/{index18.cjs → types/currencies.d.cjs} +1 -1
- package/dist/types/currencies.d.cjs.map +1 -0
- package/dist/types/currencies.d.cts +2 -0
- package/dist/types/currencies.d.ts +1 -1
- package/dist/types/documents.d.cts +55 -0
- package/dist/types/documents.d.ts +54 -54
- package/dist/{index20.cjs → types/e-invoice.d.cjs} +1 -1
- package/dist/types/e-invoice.d.cjs.map +1 -0
- package/dist/types/e-invoice.d.cts +2 -0
- package/dist/types/e-invoice.d.ts +1 -1
- package/dist/types/index.d.cts +61 -0
- package/dist/types/index.d.ts +60 -60
- package/dist/{index31.cjs → types/msic/0X.d.cjs} +1 -1
- package/dist/types/msic/0X.d.cjs.map +1 -0
- package/dist/types/msic/0X.d.cts +2 -0
- package/dist/types/msic/0X.d.ts +1 -1
- package/dist/{index32.cjs → types/msic/1X.d.cjs} +1 -1
- package/dist/types/msic/1X.d.cjs.map +1 -0
- package/dist/types/msic/1X.d.cts +2 -0
- package/dist/types/msic/1X.d.ts +1 -1
- package/dist/{index33.cjs → types/msic/2X.d.cjs} +1 -1
- package/dist/types/msic/2X.d.cjs.map +1 -0
- package/dist/types/msic/2X.d.cts +2 -0
- package/dist/types/msic/2X.d.ts +1 -1
- package/dist/{index34.cjs → types/msic/3X.d.cjs} +1 -1
- package/dist/types/msic/3X.d.cjs.map +1 -0
- package/dist/types/msic/3X.d.cts +2 -0
- package/dist/types/msic/3X.d.ts +1 -1
- package/dist/{index35.cjs → types/msic/4X.d.cjs} +1 -1
- package/dist/types/msic/4X.d.cjs.map +1 -0
- package/dist/types/msic/4X.d.cts +2 -0
- package/dist/types/msic/4X.d.ts +1 -1
- package/dist/{index36.cjs → types/msic/5X.d.cjs} +1 -1
- package/dist/types/msic/5X.d.cjs.map +1 -0
- package/dist/types/msic/5X.d.cts +2 -0
- package/dist/types/msic/5X.d.ts +1 -1
- package/dist/{index37.cjs → types/msic/6X.d.cjs} +1 -1
- package/dist/types/msic/6X.d.cjs.map +1 -0
- package/dist/types/msic/6X.d.cts +2 -0
- package/dist/types/msic/6X.d.ts +1 -1
- package/dist/{index38.cjs → types/msic/7X.d.cjs} +1 -1
- package/dist/types/msic/7X.d.cjs.map +1 -0
- package/dist/types/msic/7X.d.cts +2 -0
- package/dist/types/msic/7X.d.ts +1 -1
- package/dist/{index39.cjs → types/msic/8X.d.cjs} +1 -1
- package/dist/types/msic/8X.d.cjs.map +1 -0
- package/dist/types/msic/8X.d.cts +2 -0
- package/dist/types/msic/8X.d.ts +1 -1
- package/dist/{index40.cjs → types/msic/9X.d.cjs} +1 -1
- package/dist/types/msic/9X.d.cjs.map +1 -0
- package/dist/types/msic/9X.d.cts +2 -0
- package/dist/types/msic/9X.d.ts +1 -1
- package/dist/types/msic-codes.d.cts +12 -0
- package/dist/types/msic-codes.d.ts +11 -11
- package/dist/{index23.cjs → types/notifications.d.cjs} +1 -1
- package/dist/types/notifications.d.cjs.map +1 -0
- package/dist/types/notifications.d.cts +2 -0
- package/dist/types/notifications.d.ts +1 -1
- package/dist/{index24.cjs → types/payment-modes.d.cjs} +1 -1
- package/dist/types/payment-modes.d.cjs.map +1 -0
- package/dist/types/payment-modes.d.cts +2 -0
- package/dist/types/payment-modes.d.ts +1 -1
- package/dist/types/signatures.d.cts +2 -0
- package/dist/types/signatures.d.ts +1 -1
- package/dist/{index26.cjs → types/state-codes.d.cjs} +1 -1
- package/dist/types/state-codes.d.cjs.map +1 -0
- package/dist/types/state-codes.d.cts +2 -0
- package/dist/types/state-codes.d.ts +1 -1
- package/dist/{index27.cjs → types/tax-types.d.cjs} +1 -1
- package/dist/types/tax-types.d.cjs.map +1 -0
- package/dist/types/tax-types.d.cts +2 -0
- package/dist/types/tax-types.d.ts +1 -1
- package/dist/types/taxpayer.d.cts +56 -0
- package/dist/types/taxpayer.d.ts +55 -55
- package/dist/{index41.cjs → types/unit/1X.d.cjs} +1 -1
- package/dist/types/unit/1X.d.cjs.map +1 -0
- package/dist/types/unit/1X.d.cts +2 -0
- package/dist/types/unit/1X.d.ts +1 -1
- package/dist/{index42.cjs → types/unit/2X.d.cjs} +1 -1
- package/dist/types/unit/2X.d.cjs.map +1 -0
- package/dist/types/unit/2X.d.cts +2 -0
- package/dist/types/unit/2X.d.ts +1 -1
- package/dist/{index43.cjs → types/unit/3X.d.cjs} +1 -1
- package/dist/types/unit/3X.d.cjs.map +1 -0
- package/dist/types/unit/3X.d.cts +2 -0
- package/dist/types/unit/3X.d.ts +1 -1
- package/dist/{index44.cjs → types/unit/4X.d.cjs} +1 -1
- package/dist/types/unit/4X.d.cjs.map +1 -0
- package/dist/types/unit/4X.d.cts +2 -0
- package/dist/types/unit/4X.d.ts +1 -1
- package/dist/{index45.cjs → types/unit/5X.d.cjs} +1 -1
- package/dist/types/unit/5X.d.cjs.map +1 -0
- package/dist/types/unit/5X.d.cts +2 -0
- package/dist/types/unit/5X.d.ts +1 -1
- package/dist/{index46.cjs → types/unit/6X.d.cjs} +1 -1
- package/dist/types/unit/6X.d.cjs.map +1 -0
- package/dist/types/unit/6X.d.cts +2 -0
- package/dist/types/unit/6X.d.ts +1 -1
- package/dist/{index47.cjs → types/unit/7X.d.cjs} +1 -1
- package/dist/types/unit/7X.d.cjs.map +1 -0
- package/dist/types/unit/7X.d.cts +2 -0
- package/dist/types/unit/7X.d.ts +1 -1
- package/dist/{index48.cjs → types/unit/8X.d.cjs} +1 -1
- package/dist/types/unit/8X.d.cjs.map +1 -0
- package/dist/types/unit/8X.d.cts +2 -0
- package/dist/types/unit/8X.d.ts +1 -1
- package/dist/{index49.cjs → types/unit/9X.d.cjs} +1 -1
- package/dist/types/unit/9X.d.cjs.map +1 -0
- package/dist/types/unit/9X.d.cts +2 -0
- package/dist/types/unit/9X.d.ts +1 -1
- package/dist/{index50.cjs → types/unit/AX.d.cjs} +1 -1
- package/dist/types/unit/AX.d.cjs.map +1 -0
- package/dist/types/unit/AX.d.cts +2 -0
- package/dist/types/unit/AX.d.ts +1 -1
- package/dist/{index51.cjs → types/unit/BX.d.cjs} +1 -1
- package/dist/types/unit/BX.d.cjs.map +1 -0
- package/dist/types/unit/BX.d.cts +2 -0
- package/dist/types/unit/BX.d.ts +1 -1
- package/dist/{index52.cjs → types/unit/CX.d.cjs} +1 -1
- package/dist/types/unit/CX.d.cjs.map +1 -0
- package/dist/types/unit/CX.d.cts +2 -0
- package/dist/types/unit/CX.d.ts +1 -1
- package/dist/{index53.cjs → types/unit/DX.d.cjs} +1 -1
- package/dist/types/unit/DX.d.cjs.map +1 -0
- package/dist/types/unit/DX.d.cts +2 -0
- package/dist/types/unit/DX.d.ts +1 -1
- package/dist/{index54.cjs → types/unit/EX.d.cjs} +1 -1
- package/dist/types/unit/EX.d.cjs.map +1 -0
- package/dist/types/unit/EX.d.cts +2 -0
- package/dist/types/unit/EX.d.ts +1 -1
- package/dist/{index55.cjs → types/unit/FX.d.cjs} +1 -1
- package/dist/types/unit/FX.d.cjs.map +1 -0
- package/dist/types/unit/FX.d.cts +2 -0
- package/dist/types/unit/FX.d.ts +1 -1
- package/dist/{index56.cjs → types/unit/GX.d.cjs} +1 -1
- package/dist/types/unit/GX.d.cjs.map +1 -0
- package/dist/types/unit/GX.d.cts +2 -0
- package/dist/types/unit/GX.d.ts +1 -1
- package/dist/{index57.cjs → types/unit/HX.d.cjs} +1 -1
- package/dist/types/unit/HX.d.cjs.map +1 -0
- package/dist/types/unit/HX.d.cts +2 -0
- package/dist/types/unit/HX.d.ts +1 -1
- package/dist/{index58.cjs → types/unit/IX.d.cjs} +1 -1
- package/dist/types/unit/IX.d.cjs.map +1 -0
- package/dist/types/unit/IX.d.cts +2 -0
- package/dist/types/unit/IX.d.ts +1 -1
- package/dist/{index59.cjs → types/unit/JX.d.cjs} +1 -1
- package/dist/types/unit/JX.d.cjs.map +1 -0
- package/dist/types/unit/JX.d.cts +2 -0
- package/dist/types/unit/JX.d.ts +1 -1
- package/dist/{index60.cjs → types/unit/KX.d.cjs} +1 -1
- package/dist/types/unit/KX.d.cjs.map +1 -0
- package/dist/types/unit/KX.d.cts +2 -0
- package/dist/types/unit/KX.d.ts +1 -1
- package/dist/{index61.cjs → types/unit/LX.d.cjs} +1 -1
- package/dist/types/unit/LX.d.cjs.map +1 -0
- package/dist/types/unit/LX.d.cts +2 -0
- package/dist/types/unit/LX.d.ts +1 -1
- package/dist/{index62.cjs → types/unit/MX.d.cjs} +1 -1
- package/dist/types/unit/MX.d.cjs.map +1 -0
- package/dist/types/unit/MX.d.cts +2 -0
- package/dist/types/unit/MX.d.ts +1 -1
- package/dist/{index63.cjs → types/unit/NX.d.cjs} +1 -1
- package/dist/types/unit/NX.d.cjs.map +1 -0
- package/dist/types/unit/NX.d.cts +2 -0
- package/dist/types/unit/NX.d.ts +1 -1
- package/dist/{index64.cjs → types/unit/OX.d.cjs} +1 -1
- package/dist/types/unit/OX.d.cjs.map +1 -0
- package/dist/types/unit/OX.d.cts +2 -0
- package/dist/types/unit/OX.d.ts +1 -1
- package/dist/{index65.cjs → types/unit/PX.d.cjs} +1 -1
- package/dist/types/unit/PX.d.cjs.map +1 -0
- package/dist/types/unit/PX.d.cts +2 -0
- package/dist/types/unit/PX.d.ts +1 -1
- package/dist/{index66.cjs → types/unit/QX.d.cjs} +1 -1
- package/dist/types/unit/QX.d.cjs.map +1 -0
- package/dist/types/unit/QX.d.cts +2 -0
- package/dist/types/unit/QX.d.ts +1 -1
- package/dist/{index67.cjs → types/unit/RX.d.cjs} +1 -1
- package/dist/types/unit/RX.d.cjs.map +1 -0
- package/dist/types/unit/RX.d.cts +2 -0
- package/dist/types/unit/RX.d.ts +1 -1
- package/dist/{index68.cjs → types/unit/SX.d.cjs} +1 -1
- package/dist/types/unit/SX.d.cjs.map +1 -0
- package/dist/types/unit/SX.d.cts +2 -0
- package/dist/types/unit/SX.d.ts +1 -1
- package/dist/{index69.cjs → types/unit/TX.d.cjs} +1 -1
- package/dist/types/unit/TX.d.cjs.map +1 -0
- package/dist/types/unit/TX.d.cts +2 -0
- package/dist/types/unit/TX.d.ts +1 -1
- package/dist/{index70.cjs → types/unit/UX.d.cjs} +1 -1
- package/dist/types/unit/UX.d.cjs.map +1 -0
- package/dist/types/unit/UX.d.cts +2 -0
- package/dist/types/unit/UX.d.ts +1 -1
- package/dist/{index71.cjs → types/unit/VX.d.cjs} +1 -1
- package/dist/types/unit/VX.d.cjs.map +1 -0
- package/dist/types/unit/VX.d.cts +2 -0
- package/dist/types/unit/VX.d.ts +1 -1
- package/dist/{index72.cjs → types/unit/WX.d.cjs} +1 -1
- package/dist/types/unit/WX.d.cjs.map +1 -0
- package/dist/types/unit/WX.d.cts +2 -0
- package/dist/types/unit/WX.d.ts +1 -1
- package/dist/{index73.cjs → types/unit/XX.d.cjs} +1 -1
- package/dist/types/unit/XX.d.cjs.map +1 -0
- package/dist/types/unit/XX.d.cts +2 -0
- package/dist/types/unit/XX.d.ts +1 -1
- package/dist/{index74.cjs → types/unit/YX.d.cjs} +1 -1
- package/dist/types/unit/YX.d.cjs.map +1 -0
- package/dist/types/unit/YX.d.cts +2 -0
- package/dist/types/unit/YX.d.ts +1 -1
- package/dist/{index75.cjs → types/unit/ZX.d.cjs} +1 -1
- package/dist/types/unit/ZX.d.cjs.map +1 -0
- package/dist/types/unit/ZX.d.cts +2 -0
- package/dist/types/unit/ZX.d.ts +1 -1
- package/dist/types/unit-types.d.cts +37 -0
- package/dist/types/unit-types.d.ts +36 -36
- package/dist/types/utils.d.cts +2 -0
- package/dist/types/utils.d.ts +1 -1
- package/dist/unit-types-CZdxXbVN.d.ts +56 -0
- package/dist/{index8.cjs → utils/apiQueue.cjs} +1 -1
- package/dist/utils/apiQueue.d.cts +46 -0
- package/dist/utils/apiQueue.d.ts +2 -1
- package/dist/{index9.cjs → utils/base64.cjs} +1 -1
- package/dist/utils/base64.cjs.map +1 -0
- package/dist/utils/base64.d.cts +6 -0
- package/dist/utils/base64.d.ts +2 -1
- package/dist/utils/base64.js +2 -1
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/certificate.cjs +7 -0
- package/dist/utils/certificate.d.cts +78 -0
- package/dist/utils/certificate.d.ts +64 -12
- package/dist/utils/certificate.js +3 -1
- package/dist/{index11.cjs → utils/document.cjs} +2 -2
- package/dist/utils/document.d.cts +62 -0
- package/dist/utils/document.d.ts +61 -210
- package/dist/utils/document.js +1 -1
- package/dist/utils/formatIdValue.cjs +3 -0
- package/dist/utils/formatIdValue.d.cts +5 -0
- package/dist/utils/formatIdValue.d.ts +2 -1
- package/dist/utils/getBaseUrl.cjs +3 -0
- package/dist/utils/getBaseUrl.d.cts +5 -0
- package/dist/utils/getBaseUrl.d.ts +2 -1
- package/dist/utils/lineItems.cjs +3 -0
- package/dist/utils/lineItems.d.cts +62 -0
- package/dist/utils/lineItems.d.ts +62 -0
- package/dist/utils/lineItems.js +3 -0
- package/dist/{index14.cjs → utils/signature-diagnostics.cjs} +4 -5
- package/dist/utils/signature-diagnostics.cjs.map +1 -0
- package/dist/utils/signature-diagnostics.d.cts +97 -0
- package/dist/utils/signature-diagnostics.d.ts +62 -61
- package/dist/utils/signature-diagnostics.js +3 -2
- package/dist/utils/signature-diagnostics.js.map +1 -0
- package/dist/{index15.cjs → utils/validation.cjs} +1 -1
- package/dist/utils/validation.cjs.map +1 -0
- package/dist/utils/validation.d.cts +109 -0
- package/dist/utils/validation.d.ts +62 -61
- package/dist/utils/validation.js +2 -1
- package/dist/utils/validation.js.map +1 -0
- package/dist/{utils-C4FoVKLq.d.ts → utils-BYVq373g.d.ts} +2 -1
- package/package.json +17 -7
- package/dist/certificate-CWmfCPdt.cjs.map +0 -1
- package/dist/chunk-CUT6urMc.cjs +0 -30
- package/dist/document-B6ab06s1.cjs.map +0 -1
- package/dist/documentManagement-BviJDtf2.cjs.map +0 -1
- package/dist/index10.cjs +0 -5
- package/dist/index12.cjs +0 -3
- package/dist/index13.cjs +0 -3
- package/dist/index14.cjs.map +0 -1
- package/dist/index15.cjs.map +0 -1
- package/dist/index16.cjs.map +0 -1
- package/dist/index17.cjs.map +0 -1
- package/dist/index18.cjs.map +0 -1
- package/dist/index20.cjs.map +0 -1
- package/dist/index23.cjs.map +0 -1
- package/dist/index24.cjs.map +0 -1
- package/dist/index26.cjs.map +0 -1
- package/dist/index27.cjs.map +0 -1
- package/dist/index31.cjs.map +0 -1
- package/dist/index32.cjs.map +0 -1
- package/dist/index33.cjs.map +0 -1
- package/dist/index34.cjs.map +0 -1
- package/dist/index35.cjs.map +0 -1
- package/dist/index36.cjs.map +0 -1
- package/dist/index37.cjs.map +0 -1
- package/dist/index38.cjs.map +0 -1
- package/dist/index39.cjs.map +0 -1
- package/dist/index40.cjs.map +0 -1
- package/dist/index41.cjs.map +0 -1
- package/dist/index42.cjs.map +0 -1
- package/dist/index43.cjs.map +0 -1
- package/dist/index44.cjs.map +0 -1
- package/dist/index45.cjs.map +0 -1
- package/dist/index46.cjs.map +0 -1
- package/dist/index47.cjs.map +0 -1
- package/dist/index48.cjs.map +0 -1
- package/dist/index49.cjs.map +0 -1
- package/dist/index5.cjs +0 -3
- package/dist/index50.cjs.map +0 -1
- package/dist/index51.cjs.map +0 -1
- package/dist/index52.cjs.map +0 -1
- package/dist/index53.cjs.map +0 -1
- package/dist/index54.cjs.map +0 -1
- package/dist/index55.cjs.map +0 -1
- package/dist/index56.cjs.map +0 -1
- package/dist/index57.cjs.map +0 -1
- package/dist/index58.cjs.map +0 -1
- package/dist/index59.cjs.map +0 -1
- package/dist/index6.cjs +0 -3
- package/dist/index60.cjs.map +0 -1
- package/dist/index61.cjs.map +0 -1
- package/dist/index61.cts.map +0 -1
- package/dist/index62.cjs.map +0 -1
- package/dist/index62.cts.map +0 -1
- package/dist/index63.cjs.map +0 -1
- package/dist/index63.cts.map +0 -1
- package/dist/index64.cjs.map +0 -1
- package/dist/index64.cts.map +0 -1
- package/dist/index65.cjs.map +0 -1
- package/dist/index65.cts.map +0 -1
- package/dist/index66.cjs.map +0 -1
- package/dist/index66.cts.map +0 -1
- package/dist/index67.cjs.map +0 -1
- package/dist/index67.cts.map +0 -1
- package/dist/index68.cjs.map +0 -1
- package/dist/index68.cts.map +0 -1
- package/dist/index69.cjs.map +0 -1
- package/dist/index69.cts.map +0 -1
- package/dist/index7.cjs +0 -6
- package/dist/index70.cjs.map +0 -1
- package/dist/index70.cts.map +0 -1
- package/dist/index71.cjs.map +0 -1
- package/dist/index71.cts.map +0 -1
- package/dist/index72.cjs.map +0 -1
- package/dist/index72.cts.map +0 -1
- package/dist/index73.cjs.map +0 -1
- package/dist/index73.cts.map +0 -1
- package/dist/index74.cjs.map +0 -1
- package/dist/index74.cts.map +0 -1
- package/dist/index75.cjs.map +0 -1
- package/dist/index75.cts.map +0 -1
- package/dist/index9.cjs.map +0 -1
- package/dist/msic-codes-CjrrJmzb.d.ts +0 -25
- package/dist/unit-types-VgYXIwTT.d.ts +0 -55
- /package/dist/{index19.cjs → types/documents.d.cjs} +0 -0
- /package/dist/{index21.cjs → types/index.d.cjs} +0 -0
- /package/dist/{index22.cjs → types/msic-codes.d.cjs} +0 -0
- /package/dist/{index25.cjs → types/signatures.d.cjs} +0 -0
- /package/dist/{index28.cjs → types/taxpayer.d.cjs} +0 -0
- /package/dist/{index29.cjs → types/unit-types.d.cjs} +0 -0
- /package/dist/{index30.cjs → types/utils.d.cjs} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { Classification, ClassificationCode, ClassificationCodeEnum } from "./classification-codes-
|
|
2
|
-
import { Country, CountryCode, CountryCodeEnum, CountryNameEnum } from "./country-code-
|
|
3
|
-
import { Currency, CurrencyCode, CurrencyCodeEnum } from "./currencies-
|
|
4
|
-
import { EInvoiceType, EInvoiceTypeCode, EInvoiceTypeCodeEnum } from "./e-invoice-
|
|
5
|
-
import "./0X-
|
|
6
|
-
import "./1X-
|
|
7
|
-
import "./2X-
|
|
8
|
-
import "./3X-
|
|
9
|
-
import "./4X-
|
|
10
|
-
import "./5X-
|
|
11
|
-
import "./6X-
|
|
12
|
-
import "./7X-
|
|
13
|
-
import "./8X-
|
|
14
|
-
import "./9X-
|
|
15
|
-
import { MSICCode } from "./msic-codes-
|
|
16
|
-
import { TaxType, TaxTypeCode, TaxTypeCodeEnum } from "./tax-types-
|
|
17
|
-
import { State, StateCode, StateCodeEnum } from "./state-codes-
|
|
18
|
-
import "./1X-
|
|
19
|
-
import "./2X-
|
|
20
|
-
import "./3X-
|
|
21
|
-
import "./4X-
|
|
22
|
-
import "./5X-
|
|
23
|
-
import "./6X-
|
|
24
|
-
import "./7X-
|
|
25
|
-
import "./8X-
|
|
26
|
-
import "./9X-
|
|
27
|
-
import "./AX-
|
|
28
|
-
import "./BX-
|
|
29
|
-
import "./CX-
|
|
30
|
-
import "./DX-
|
|
31
|
-
import "./EX-
|
|
32
|
-
import "./FX-
|
|
33
|
-
import "./GX-
|
|
34
|
-
import "./HX-
|
|
35
|
-
import "./IX-
|
|
36
|
-
import "./JX-
|
|
37
|
-
import "./KX-
|
|
38
|
-
import "./LX-
|
|
39
|
-
import "./MX-
|
|
40
|
-
import "./NX-
|
|
41
|
-
import "./OX-
|
|
42
|
-
import "./PX-
|
|
43
|
-
import "./QX-
|
|
44
|
-
import "./RX-
|
|
45
|
-
import "./SX-
|
|
46
|
-
import "./TX-
|
|
47
|
-
import "./UX-
|
|
48
|
-
import "./VX-
|
|
49
|
-
import "./WX-
|
|
50
|
-
import "./YX-
|
|
51
|
-
import "./ZX-
|
|
52
|
-
import "./XX-
|
|
53
|
-
import { UnitType, UnitTypeCode } from "./unit-types-
|
|
54
|
-
import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "./documents-
|
|
55
|
-
import { PaymentMode, PaymentModeCode, PaymentModeCodeEnum } from "./payment-modes-
|
|
56
|
-
import { CanonicalizationMethod, Cert, CertDigest, DigestMethod, IssuerDigitalSignature, IssuerSerial, KeyInfo, QualifyingProperties, Reference, SignatureMethod, SignedInfo, SignedProperties, SignedSignatureProperties, SigningCertificate, Transform, X509Data } from "./signatures-
|
|
57
|
-
import { Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum } from "./notifications-
|
|
58
|
-
import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "./taxpayer-
|
|
59
|
-
import { Fetch } from "./utils-
|
|
60
|
-
import { ClientCredentials, TokenResponse } from "./index-
|
|
1
|
+
import { Classification, ClassificationCode, ClassificationCodeEnum } from "./classification-codes-BQMnAQFr.js";
|
|
2
|
+
import { Country, CountryCode, CountryCodeEnum, CountryNameEnum } from "./country-code-DAejE5RV.js";
|
|
3
|
+
import { Currency, CurrencyCode, CurrencyCodeEnum } from "./currencies-Cg9RkxRB.js";
|
|
4
|
+
import { EInvoiceType, EInvoiceTypeCode, EInvoiceTypeCodeEnum } from "./e-invoice-BSCFsH-H.js";
|
|
5
|
+
import "./0X-bPhcc9Vv.js";
|
|
6
|
+
import "./1X-DKHYQyRy.js";
|
|
7
|
+
import "./2X-DN6M21cV.js";
|
|
8
|
+
import "./3X-DJRj5xLv.js";
|
|
9
|
+
import "./4X-BCvTomUF.js";
|
|
10
|
+
import "./5X-Dji6Soz5.js";
|
|
11
|
+
import "./6X-CO_u4RIY.js";
|
|
12
|
+
import "./7X-vzJ01lNF.js";
|
|
13
|
+
import "./8X-C4Wf4jYK.js";
|
|
14
|
+
import "./9X-1VwxN9g-.js";
|
|
15
|
+
import { MSICCode } from "./msic-codes-kysVPGdN.js";
|
|
16
|
+
import { TaxType, TaxTypeCode, TaxTypeCodeEnum } from "./tax-types-QeZFKqew.js";
|
|
17
|
+
import { State, StateCode, StateCodeEnum } from "./state-codes-CAkYQnTd.js";
|
|
18
|
+
import "./1X-Bqi8dmY1.js";
|
|
19
|
+
import "./2X-CemxuAeL.js";
|
|
20
|
+
import "./3X-DIYh_ue4.js";
|
|
21
|
+
import "./4X-CZi5nwIr.js";
|
|
22
|
+
import "./5X-DyYBCAvY.js";
|
|
23
|
+
import "./6X-Csxu6lwi.js";
|
|
24
|
+
import "./7X-DivvfBsk.js";
|
|
25
|
+
import "./8X-D_Pw1H3K.js";
|
|
26
|
+
import "./9X-BwR9pibT.js";
|
|
27
|
+
import "./AX-CDubGAZO.js";
|
|
28
|
+
import "./BX-CBsKI8np.js";
|
|
29
|
+
import "./CX-DhOdAFyg.js";
|
|
30
|
+
import "./DX-CBiRJGqR.js";
|
|
31
|
+
import "./EX-CAn62WaX.js";
|
|
32
|
+
import "./FX-CANpsLC4.js";
|
|
33
|
+
import "./GX-BvSZZ8pE.js";
|
|
34
|
+
import "./HX-CxrnY-YC.js";
|
|
35
|
+
import "./IX-wdAD6eW8.js";
|
|
36
|
+
import "./JX-B5v815to.js";
|
|
37
|
+
import "./KX-BI8n7ACj.js";
|
|
38
|
+
import "./LX-BVvEz6Ji.js";
|
|
39
|
+
import "./MX-D_OsOP_v.js";
|
|
40
|
+
import "./NX-DIhAzAY3.js";
|
|
41
|
+
import "./OX-BZrRnj5g.js";
|
|
42
|
+
import "./PX-DGGrJNym.js";
|
|
43
|
+
import "./QX-DuTJFnHX.js";
|
|
44
|
+
import "./RX-DYQoV7am.js";
|
|
45
|
+
import "./SX-Dl1RlNnc.js";
|
|
46
|
+
import "./TX-SoIfFaZj.js";
|
|
47
|
+
import "./UX-DqBfrSsY.js";
|
|
48
|
+
import "./VX-Ahcpp3Si.js";
|
|
49
|
+
import "./WX-Di6vYD7A.js";
|
|
50
|
+
import "./YX-BPO04gSZ.js";
|
|
51
|
+
import "./ZX-DHu4FRKS.js";
|
|
52
|
+
import "./XX-BE4flzh6.js";
|
|
53
|
+
import { UnitType, UnitTypeCode } from "./unit-types-CZdxXbVN.js";
|
|
54
|
+
import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "./documents-BpZn3hJq.js";
|
|
55
|
+
import { PaymentMode, PaymentModeCode, PaymentModeCodeEnum } from "./payment-modes-BGP5McTY.js";
|
|
56
|
+
import { CanonicalizationMethod, Cert, CertDigest, DigestMethod, IssuerDigitalSignature, IssuerSerial, KeyInfo, QualifyingProperties, Reference, SignatureMethod, SignedInfo, SignedProperties, SignedSignatureProperties, SigningCertificate, Transform, X509Data } from "./signatures-Bk5aKcq6.js";
|
|
57
|
+
import { Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum } from "./notifications-B4BymhRJ.js";
|
|
58
|
+
import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "./taxpayer-B1CSMqNS.js";
|
|
59
|
+
import { Fetch } from "./utils-BYVq373g.js";
|
|
60
|
+
import { ClientCredentials, TokenResponse } from "./index-Dn3JIREW.js";
|
|
61
|
+
import { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory } from "./lineItems-CrkEXi2m.js";
|
|
61
62
|
|
|
62
63
|
//#region src/index.d.ts
|
|
63
64
|
declare class MyInvoisClient {
|
|
@@ -611,4 +612,5 @@ declare class MyInvoisClient {
|
|
|
611
612
|
static fromP12(clientId: string, clientSecret: string, environment: "sandbox" | "production", p12Input: Buffer | string, passphrase: string, onBehalfOf?: string, debug?: boolean): MyInvoisClient;
|
|
612
613
|
}
|
|
613
614
|
//#endregion
|
|
614
|
-
export { Address, AllDocumentsV1_1, Buyer, CanonicalizationMethod, Cert, CertDigest, Classification, ClassificationCode, ClassificationCodeEnum, ClientCredentials, CompleteInvoice, Country, CountryCode, CountryCodeEnum, CountryNameEnum, CreditNoteV1_1, Currency, CurrencyCode, CurrencyCodeEnum, DebitNoteV1_1, DigestMethod, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, EInvoiceType, EInvoiceTypeCode, EInvoiceTypeCodeEnum, Fetch, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, IssuerDigitalSignature, IssuerSerial, KeyInfo, LegalMonetaryTotal, MSICCode, MyInvoisClient, Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum, PaymentMode, PaymentModeCode, PaymentModeCodeEnum, QualifyingProperties, Reference, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignatureMethod, SignedInfo, SignedInfoObject, SignedInvoiceSubmission, SignedProperties, SignedPropertiesData, SignedPropertiesObject, SignedSignatureProperties, SigningCertificate, SigningCredentials, StandardError, State, StateCode, StateCodeEnum, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, TaxType, TaxTypeCode, TaxTypeCodeEnum, TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse, TokenResponse, Transform, UBLDocument, UnitType, UnitTypeCode, WorkflowParameter, X509Data };
|
|
615
|
+
export { Address, AggregateByTaxCategoryOptions, AllDocumentsV1_1, Buyer, CanonicalizationMethod, Cert, CertDigest, Classification, ClassificationCode, ClassificationCodeEnum, ClientCredentials, CompleteInvoice, Country, CountryCode, CountryCodeEnum, CountryNameEnum, CreditNoteV1_1, Currency, CurrencyCode, CurrencyCodeEnum, DebitNoteV1_1, DigestMethod, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, EInvoiceType, EInvoiceTypeCode, EInvoiceTypeCodeEnum, Fetch, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, IssuerDigitalSignature, IssuerSerial, KeyInfo, LegalMonetaryTotal, MSICCode, MyInvoisClient, Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum, PaymentMode, PaymentModeCode, PaymentModeCodeEnum, QualifyingProperties, Reference, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignatureMethod, SignedInfo, SignedInfoObject, SignedInvoiceSubmission, SignedProperties, SignedPropertiesData, SignedPropertiesObject, SignedSignatureProperties, SigningCertificate, SigningCredentials, StandardError, State, StateCode, StateCodeEnum, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, TaxType, TaxTypeCode, TaxTypeCodeEnum, TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse, TokenResponse, Transform, UBLDocument, UnitType, UnitTypeCode, WorkflowParameter, X509Data, aggregateLineItemsByTaxCategory };
|
|
616
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { getDocument, getDocumentDetails, searchDocuments } from "./documentManagement-
|
|
1
|
+
import { getDocument, getDocumentDetails, searchDocuments } from "./documentManagement-DZKm582-.js";
|
|
2
2
|
import "./formatIdValue-qTxJqj9o.js";
|
|
3
|
-
import "./document-
|
|
4
|
-
import { getSubmissionStatus, performDocumentAction, submitDocument } from "./documentSubmission-
|
|
3
|
+
import { extractCertificateInfo } from "./document-BC52NCdW.js";
|
|
4
|
+
import { getSubmissionStatus, performDocumentAction, submitDocument } from "./documentSubmission-DSsX0ldK.js";
|
|
5
5
|
import { getDocumentType, getDocumentTypeVersion, getDocumentTypes } from "./documentTypeManagement-cBtVCOY3.js";
|
|
6
6
|
import { getNotifications } from "./notificationManagement-n4Z5e-My.js";
|
|
7
7
|
import { platformLogin } from "./platformLogin-CqI9OLYP.js";
|
|
8
8
|
import { taxpayerQRCode, tinSearch, verifyTin } from "./taxpayerValidation-Xd_EHDvk.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getPemFromP12, validateKeyPair } from "./certificate-Cg6spxUs.js";
|
|
10
10
|
import { getBaseUrl } from "./getBaseUrl-D7nUmoYb.js";
|
|
11
11
|
import { categorizeRequest, queueRequest } from "./apiQueue-B6Q644Bz.js";
|
|
12
|
+
import { aggregateLineItemsByTaxCategory } from "./lineItems-Btjkf6VX.js";
|
|
12
13
|
|
|
13
14
|
//#region src/index.ts
|
|
14
15
|
var MyInvoisClient = class MyInvoisClient {
|
|
@@ -356,7 +357,7 @@ var MyInvoisClient = class MyInvoisClient {
|
|
|
356
357
|
* - Debug mode provides detailed logging of polling attempts and responses
|
|
357
358
|
* - Use reasonable poll intervals to avoid overwhelming the API
|
|
358
359
|
*/
|
|
359
|
-
async getSubmissionStatus(submissionUid, pollInterval = 1e3, maxRetries = 10, pageNo =
|
|
360
|
+
async getSubmissionStatus(submissionUid, pollInterval = 1e3, maxRetries = 10, pageNo = 1, pageSize = 10) {
|
|
360
361
|
return getSubmissionStatus({
|
|
361
362
|
fetch: this.fetch.bind(this),
|
|
362
363
|
debug: this.debug
|
|
@@ -624,4 +625,5 @@ var MyInvoisClient = class MyInvoisClient {
|
|
|
624
625
|
};
|
|
625
626
|
|
|
626
627
|
//#endregion
|
|
627
|
-
export { MyInvoisClient };
|
|
628
|
+
export { MyInvoisClient, aggregateLineItemsByTaxCategory };
|
|
629
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["clientId: string","clientSecret: string","environment: 'sandbox' | 'production'","certificatePem: string","privateKeyPem: string","onBehalfOf?: string","debug?: boolean","onBehalfOf: string","path: string","options: Parameters<typeof fetch>[1]","tin: string","idType: RegistrationType","idValue: string","params: TinSearchParams","qrCodeText: string","documentUid: string","status: 'rejected' | 'cancelled'","reason: string","documents: AllDocumentsV1_1[]","submissionUid: string","pollInterval: number","maxRetries: number","pageNo: number","pageSize: number","id: number","longId?: string","versionId: number","p12Input: Buffer | string","passphrase: string"],"sources":["../src/index.ts"],"sourcesContent":["import {\n DocumentStatus,\n DocumentSummary,\n DocumentTypeResponse,\n DocumentTypesResponse,\n DocumentTypeVersionResponse,\n DocumentValidationResult,\n DocumentValidationStepResult,\n EInvoiceTypeCode,\n NotificationResponse,\n NotificationSearchParams,\n RegistrationType,\n SigningCredentials,\n StandardError,\n SubmissionResponse,\n SubmissionStatus,\n TaxpayerQRCodeResponse,\n TinSearchParams,\n TinSearchResponse,\n AllDocumentsV1_1,\n} from './types'\n\nimport * as DocumentManagementAPI from './api/documentManagement'\nimport * as DocumentSubmissionAPI from './api/documentSubmission'\nimport * as DocumentTypeManagementAPI from './api/documentTypeManagement'\nimport * as NotificationManagementAPI from './api/notificationManagement'\nimport { platformLogin } from './api/platformLogin'\nimport * as TaxpayerValidationAPI from './api/taxpayerValidation'\nimport {\n extractCertificateInfo,\n validateKeyPair,\n getPemFromP12,\n} from './utils/certificate'\nimport { getBaseUrl } from './utils/getBaseUrl'\nimport { queueRequest, categorizeRequest } from './utils/apiQueue'\n\nexport type * from './types/index.d.ts'\nexport {\n aggregateLineItemsByTaxCategory,\n type AggregateByTaxCategoryOptions,\n} from './utils/lineItems'\nexport class MyInvoisClient {\n private readonly baseUrl: string\n private readonly clientId: string\n private readonly clientSecret: string\n private readonly environment: 'sandbox' | 'production'\n private onBehalfOf?: string\n private readonly signingCredentials: SigningCredentials\n private readonly debug: boolean\n private token = ''\n private tokenExpiration: Date | undefined = undefined\n private requestCount = 0\n\n constructor(\n clientId: string,\n clientSecret: string,\n environment: 'sandbox' | 'production',\n certificatePem: string,\n privateKeyPem: string,\n onBehalfOf?: string,\n debug?: boolean,\n ) {\n // Check if basic signing credentials are available\n if (!privateKeyPem || !certificatePem) {\n throw new Error(\n 'Missing required environment variables: PRIVATE_KEY and CERTIFICATE',\n )\n }\n\n // Validate that the key pair matches\n if (!validateKeyPair(certificatePem, privateKeyPem)) {\n throw new Error('Certificate and private key do not match')\n }\n\n this.clientId = clientId\n this.clientSecret = clientSecret\n this.baseUrl = getBaseUrl(environment)\n this.environment = environment\n this.onBehalfOf = onBehalfOf\n this.debug = (debug ?? process.env.MYINVOIS_DEBUG === 'true') ? true : false\n\n // Extract certificate information\n const { issuerName, serialNumber } = extractCertificateInfo(certificatePem)\n\n this.signingCredentials = {\n privateKeyPem,\n certificatePem,\n issuerName,\n serialNumber,\n }\n }\n\n async updateOnBehalfOf(onBehalfOf: string): Promise<void> {\n this.onBehalfOf = onBehalfOf\n await this.refreshToken()\n return\n }\n\n private async refreshToken() {\n const tokenResponse = await platformLogin({\n clientId: this.clientId,\n clientSecret: this.clientSecret,\n baseUrl: this.baseUrl,\n onBehalfOf: this.onBehalfOf,\n debug: this.debug,\n })\n\n this.token = tokenResponse.token\n this.tokenExpiration = tokenResponse.tokenExpiration\n }\n\n private async getToken() {\n if (\n !this.tokenExpiration ||\n this.tokenExpiration < new Date() ||\n isNaN(this.tokenExpiration.getTime())\n ) {\n if (this.debug) {\n console.log('Token expired')\n console.log('Refreshing token')\n }\n await this.refreshToken()\n }\n\n return this.token\n }\n\n private async fetch(path: string, options: Parameters<typeof fetch>[1] = {}) {\n this.requestCount++\n if (this.debug) console.log(`[fetch] Request count: ${this.requestCount}`)\n\n const token = await this.getToken()\n\n // Dynamically categorise the request and enqueue it so we never exceed the\n // vendor-specified rate-limits. If the path isn't recognised it will fall\n // back to the `default` category which has a very high allowance.\n\n const category = categorizeRequest(\n path,\n options?.method as string | undefined,\n )\n\n return queueRequest(\n this.clientId,\n category,\n () =>\n fetch(`${this.baseUrl}${path}`, {\n ...options,\n headers: { ...options.headers, Authorization: `Bearer ${token}` },\n }),\n this.debug,\n )\n }\n\n /**\n * Validates a TIN against a NRIC/ARMY/PASSPORT/BRN (Business Registration Number)\n *\n * This method verifies if a given Tax Identification Number (TIN) is valid by checking it against\n * the provided identification type and value through the MyInvois platform's validation service.\n *\n * @param tin - The TIN to validate\n * @param idType - The type of ID to validate against ('NRIC', 'ARMY', 'PASSPORT', or 'BRN')\n * @param idValue - The value of the ID to validate against\n * @returns Promise resolving to true if the TIN is valid, false otherwise\n *\n * @example\n * ```typescript\n * // Validate TIN against NRIC\n * const isValid = await client.verifyTin('C12345678901234', 'NRIC', '123456789012');\n * if (isValid) {\n * console.log('TIN is valid');\n * }\n *\n * // Validate TIN against Business Registration Number\n * const isValidBusiness = await client.verifyTin('C98765432109876', 'BRN', '123456-K');\n * ```\n *\n * @remarks\n * - Returns false if validation fails due to network errors or invalid credentials\n * - Debug mode provides error logging for troubleshooting validation failures\n * - This is a non-blocking validation that won't throw exceptions on failure\n */\n async verifyTin(\n tin: string,\n idType: RegistrationType,\n idValue: string,\n ): Promise<boolean> {\n return TaxpayerValidationAPI.verifyTin(\n { fetch: this.fetch.bind(this), debug: this.debug },\n tin,\n idType,\n idValue,\n )\n }\n\n /**\n * Searches for a Tax Identification Number (TIN) using taxpayer information.\n *\n * This method allows searching for a TIN using either a taxpayer name or a combination\n * of identification type and value. The search is flexible and supports multiple\n * identification types including NRIC, ARMY, PASSPORT, and BRN.\n *\n * @param params - Search parameters object\n * @param params.taxpayerName - Optional name of the taxpayer to search for\n * @param params.idType - Optional type of ID to search with (NRIC, ARMY, PASSPORT, BRN)\n * @param params.idValue - Optional value of the ID to search with\n * @returns Promise resolving to TIN search response or standard error\n *\n * @example\n * ```typescript\n * // Search by taxpayer name\n * const result = await client.searchTin({ taxpayerName: 'John Doe' });\n * if ('tin' in result) {\n * console.log('Found TIN:', result.tin);\n * }\n *\n * // Search by ID type and value\n * const result = await client.searchTin({\n * idType: 'NRIC',\n * idValue: '123456789012'\n * });\n * ```\n *\n * @remarks\n * - Either taxpayerName or both idType and idValue must be provided\n * - Returns StandardError object if search criteria are invalid or inconclusive\n * - Debug mode provides detailed error logging for troubleshooting\n * - Search results are not guaranteed to be unique\n */\n async searchTin(params: TinSearchParams): Promise<TinSearchResponse> {\n return TaxpayerValidationAPI.tinSearch(\n { fetch: this.fetch.bind(this), debug: this.debug },\n params,\n )\n }\n\n /**\n * Retrieves taxpayer information from a QR code.\n *\n * This method decodes a QR code containing taxpayer information and returns\n * detailed taxpayer data including TIN, name, contact details, and business information.\n *\n * @param qrCodeText - The QR code text to decode\n * @returns Promise resolving to taxpayer QR code response or standard error\n *\n * @example\n * ```typescript\n * // Get taxpayer info from QR code\n * const taxpayerInfo = await client.getTaxpayerQRCode('QR_CODE_TEXT');\n * if ('tin' in taxpayerInfo) {\n * console.log('Taxpayer TIN:', taxpayerInfo.tin);\n * console.log('Business Name:', taxpayerInfo.name);\n * console.log('Address:', taxpayerInfo.addressLine1);\n * }\n * ```\n *\n * @remarks\n * - QR code must be in the correct format specified by MyInvois\n * - Returns StandardError if QR code is invalid or cannot be decoded\n * - Debug mode provides detailed error logging\n */\n async getTaxpayerQRCode(qrCodeText: string): Promise<TaxpayerQRCodeResponse> {\n return TaxpayerValidationAPI.taxpayerQRCode(\n { fetch: this.fetch.bind(this), debug: this.debug },\n qrCodeText,\n )\n }\n\n /**\n * Performs an action on a document such as rejection or cancellation.\n *\n * This method allows updating the status of a document to either rejected or cancelled,\n * along with providing a reason for the action. Useful for managing document workflow\n * and maintaining audit trails.\n *\n * @param documentUid - The unique identifier of the document\n * @param status - The new status to set ('rejected' or 'cancelled')\n * @param reason - The reason for the status change (max 300 characters)\n * @returns Promise resolving to document action response containing UUID, status, and any errors\n *\n * @example\n * ```typescript\n * // Reject a document with reason\n * const result = await client.performDocumentAction(\n * 'doc-123',\n * 'rejected',\n * 'Invalid tax calculation'\n * );\n *\n * // Cancel a document\n * const result = await client.performDocumentAction(\n * 'doc-456',\n * 'cancelled',\n * 'Duplicate submission'\n * );\n * ```\n *\n * @remarks\n * - Only valid for documents in appropriate states\n * - Reason is required, max 300 characters\n * - Action is irreversible once completed\n * - Returns error if document cannot be found or action is invalid\n */\n private async performDocumentAction(\n documentUid: string,\n status: 'rejected' | 'cancelled',\n reason: string,\n ): Promise<{\n uuid: string\n status: string\n error: StandardError\n }> {\n return DocumentSubmissionAPI.performDocumentAction(\n { fetch: this.fetch.bind(this) },\n documentUid,\n status,\n reason,\n )\n }\n\n /**\n * Cancels a document that was previously submitted.\n *\n * This is a convenience method that wraps performDocumentAction with 'cancelled' status.\n * Documents can only be cancelled within 72 hours of validation.\n *\n * @param documentUid - The unique identifier of the document to cancel\n * @param reason - The reason for cancellation (max 300 characters)\n * @returns Promise resolving to document action response containing UUID, status, and any errors\n *\n * @example\n * ```typescript\n * const result = await client.cancelDocument(\n * 'doc-456',\n * 'Duplicate submission'\n * );\n * if (!result.error) {\n * console.log('Document cancelled:', result.uuid);\n * }\n * ```\n *\n * @remarks\n * - Must be called within 72 hours of document validation\n * - Reason is required, max 300 characters\n * - Action is irreversible once completed\n * - Rate limited to 12 requests per minute\n */\n async cancelDocument(\n documentUid: string,\n reason: string,\n ): Promise<{ uuid: string; status: string; error?: StandardError }> {\n return this.performDocumentAction(documentUid, 'cancelled', reason)\n }\n\n /**\n * Rejects a document received from another party.\n *\n * This is a convenience method that wraps performDocumentAction with 'rejected' status.\n * Only documents received from other taxpayers can be rejected.\n *\n * @param documentUid - The unique identifier of the document to reject\n * @param reason - The reason for rejection (max 300 characters)\n * @returns Promise resolving to document action response containing UUID, status, and any errors\n *\n * @example\n * ```typescript\n * const result = await client.rejectDocument(\n * 'doc-123',\n * 'Invalid tax calculation'\n * );\n * if (!result.error) {\n * console.log('Document rejected:', result.uuid);\n * }\n * ```\n *\n * @remarks\n * - Only applicable to received documents\n * - Reason is required, max 300 characters\n * - Action is irreversible once completed\n * - Rate limited to 12 requests per minute\n */\n async rejectDocument(\n documentUid: string,\n reason: string,\n ): Promise<{ uuid: string; status: string; error?: StandardError }> {\n return this.performDocumentAction(documentUid, 'rejected', reason)\n }\n\n /**\n * Submits one or more e-invoice documents to the MyInvois platform for processing.\n *\n * This method digitally signs each document using the provided certificate and private key,\n * generates document hashes, encodes them for submission, and sends them to the platform.\n * The method includes comprehensive validation warnings for document size and count limits.\n *\n * @param documents - Array of InvoiceV1_1 documents to be submitted\n * @returns Promise resolving to submission response containing the submission data and HTTP status\n * @throws {Error} If PRIVATE_KEY or CERTIFICATE environment variables are missing\n * @throws {Error} If document signing, encoding, or API submission fails\n *\n * @example\n * ```typescript\n * // Submit a single invoice\n * const result = await client.submitDocument([invoiceData]);\n * console.log(result.data.submissionUid); // Track submission with this UID\n *\n * // Submit multiple invoices\n * const result = await client.submitDocument([invoice1, invoice2, invoice3]);\n * if (result.status === 202) {\n * console.log('Documents submitted successfully');\n * }\n * ```\n *\n * @remarks\n * - Requires PRIVATE_KEY and CERTIFICATE environment variables for document signing\n * - Each document is digitally signed with XML-DSIG before submission\n * - Documents are base64-encoded for transmission\n * - API limits: Max 100 documents per submission, 5MB total payload, 300KB per document\n * - Debug mode provides detailed logging of payload sizes and validation warnings\n * - Returns HTTP 202 for successful submissions that require processing\n */\n async submitDocument(documents: AllDocumentsV1_1[]): Promise<{\n data: SubmissionResponse\n status: number\n }> {\n return DocumentSubmissionAPI.submitDocument(\n {\n fetch: this.fetch.bind(this),\n debug: this.debug,\n signingCredentials: this.signingCredentials,\n },\n documents,\n )\n }\n\n /**\n * Polls the MyInvois platform to get the current status of a document submission.\n *\n * This method continuously checks the submission status until it receives a final result\n * (Valid or Invalid) or reaches the maximum retry limit. It's designed to handle the\n * asynchronous nature of document processing on the MyInvois platform.\n *\n * @param submissionUid - The unique identifier of the submission to check\n * @param pollInterval - Time in milliseconds between status checks (default: 1000ms)\n * @param maxRetries - Maximum number of retry attempts (default: 10)\n * @returns Promise resolving to submission status object with document summary and any errors\n *\n * @example\n * ```typescript\n * // Check submission status with default polling\n * const result = await client.getSubmissionStatus('submission-uid-123');\n * if (result.status === 'Valid') {\n * console.log('All documents processed successfully');\n * console.log('Document summaries:', result.documentSummary);\n * }\n *\n * // Custom polling interval and retry count\n * const result = await client.getSubmissionStatus(\n * 'submission-uid-123',\n * 2000, // Poll every 2 seconds\n * 20 // Try up to 20 times\n * );\n * ```\n *\n * @remarks\n * - Automatically retries on network errors until maxRetries is reached\n * - Returns 'Invalid' status with timeout error if submission processing takes too long\n * - Debug mode provides detailed logging of polling attempts and responses\n * - Use reasonable poll intervals to avoid overwhelming the API\n */\n async getSubmissionStatus(\n submissionUid: string,\n pollInterval: number = 1000,\n maxRetries: number = 10,\n pageNo: number = 1,\n pageSize: number = 10,\n ): Promise<{\n status: SubmissionStatus\n documentSummary?: DocumentSummary[]\n error?: {\n code: string\n message: string | null\n target: string\n details: {\n code: string\n message: string\n target: string\n }[]\n }\n }> {\n return DocumentSubmissionAPI.getSubmissionStatus(\n { fetch: this.fetch.bind(this), debug: this.debug },\n submissionUid,\n pollInterval,\n maxRetries,\n pageNo,\n pageSize,\n )\n }\n\n /**\n * Retrieves a document by its unique identifier with the raw document content.\n *\n * @param documentUid - The unique identifier of the document to retrieve\n * @returns Promise resolving to document summary with raw document content as a string\n * @throws {Error} If the document is not found or request fails\n *\n * @example\n * ```typescript\n * const document = await client.getDocument('doc-uuid-123');\n * console.log(document.document); // Raw XML/JSON content\n * console.log(document.uuid); // Document UUID\n * ```\n */\n async getDocument(\n documentUid: string,\n ): Promise<DocumentSummary & { document: string }> {\n return DocumentManagementAPI.getDocument(\n { fetch: this.fetch.bind(this) },\n documentUid,\n )\n }\n\n /**\n * Retrieves detailed information about a document including validation results.\n *\n * @param documentUid - The unique identifier of the document to get details for\n * @returns Promise resolving to document summary with detailed validation results\n * @throws {Error} If the document is not found or request fails\n *\n * @example\n * ```typescript\n * const details = await client.getDocumentDetails('doc-uuid-123');\n * console.log(details.validationResults.status); // 'Valid' | 'Invalid' | 'Processing'\n * console.log(details.validationResults.validationSteps); // Array of validation step results\n * ```\n */\n async getDocumentDetails(documentUid: string): Promise<\n DocumentSummary & {\n validationResults: {\n status: DocumentValidationResult\n validationSteps: DocumentValidationStepResult[]\n }\n }\n > {\n return DocumentManagementAPI.getDocumentDetails(\n { fetch: this.fetch.bind(this) },\n documentUid,\n )\n }\n\n /**\n * Searches for documents based on various filter criteria.\n *\n * @param params - Search parameters object\n * @param params.uuid - Optional specific document UUID to search for\n * @param params.submissionDateFrom - Required start date for submission date range (ISO date string)\n * @param params.submissionDateTo - Optional end date for submission date range (ISO date string)\n * @param params.pageSize - Optional number of results per page (default handled by API)\n * @param params.pageNo - Optional page number for pagination (0-based)\n * @param params.issueDateFrom - Optional start date for issue date range (ISO date string)\n * @param params.issueDateTo - Optional end date for issue date range (ISO date string)\n * @param params.invoiceDirection - Optional filter by invoice direction ('Sent' or 'Received')\n * @param params.status - Optional filter by document status\n * @param params.documentType - Optional filter by e-invoice type code\n * @param params.searchQuery - Optional text search across uuid, buyerTIN, supplierTIN, buyerName, supplierName, internalID, total\n * @returns Promise resolving to array of document summaries matching the search criteria\n * @throws {Error} If the search request fails\n *\n * @example\n * ```typescript\n * // Search for documents submitted in the last 30 days\n * const documents = await client.searchDocuments({\n * submissionDateFrom: '2024-01-01',\n * submissionDateTo: '2024-01-31',\n * status: 'Valid',\n * pageSize: 10\n * });\n *\n * // Search by supplier name\n * const supplierDocs = await client.searchDocuments({\n * submissionDateFrom: '2024-01-01',\n * searchQuery: 'ACME Corp',\n * invoiceDirection: 'Received'\n * });\n * ```\n */\n async searchDocuments({\n uuid,\n submissionDateFrom,\n submissionDateTo,\n pageSize,\n pageNo,\n issueDateFrom,\n issueDateTo,\n invoiceDirection,\n status,\n documentType,\n searchQuery,\n }: {\n uuid?: string\n submissionDateFrom: string\n submissionDateTo?: string\n pageSize?: number\n pageNo?: number\n issueDateFrom?: string\n issueDateTo?: string\n invoiceDirection?: 'Sent' | 'Received'\n status?: DocumentStatus\n documentType?: EInvoiceTypeCode\n searchQuery?: string // Search by uuid, buyerTIN, supplierTIN, buyerName, supplierName, internalID, total\n }): Promise<DocumentSummary[]> {\n return DocumentManagementAPI.searchDocuments(\n { fetch: this.fetch.bind(this) },\n {\n uuid,\n submissionDateFrom,\n submissionDateTo,\n pageSize,\n pageNo,\n issueDateFrom,\n issueDateTo,\n invoiceDirection,\n status,\n documentType,\n searchQuery,\n },\n )\n }\n\n /**\n * Retrieves notifications from the MyInvois platform based on specified search criteria.\n *\n * This method allows you to search for system notifications, alerts, and messages\n * sent by the MyInvois platform regarding document processing, system updates,\n * or account-related information.\n *\n * @param params - Search parameters object for filtering notifications\n * @param params.dateFrom - Optional start date for notification date range (ISO date string)\n * @param params.dateTo - Optional end date for notification date range (ISO date string)\n * @param params.type - Optional notification type filter\n * @param params.language - Optional language preference for notifications\n * @param params.status - Optional notification status filter\n * @param params.pageNo - Optional page number for pagination (0-based)\n * @param params.pageSize - Optional number of results per page\n * @returns Promise resolving to notification response object or standard error\n *\n * @example\n * ```typescript\n * // Get all notifications from the last 7 days\n * const notifications = await client.getNotifications({\n * dateFrom: '2024-01-01',\n * dateTo: '2024-01-07',\n * pageSize: 20\n * });\n *\n * // Get unread notifications only\n * const unreadNotifications = await client.getNotifications({\n * status: 0, // Assuming 0 = unread\n * language: 'en'\n * });\n *\n * // Paginated notification retrieval\n * const firstPage = await client.getNotifications({\n * dateFrom: '2024-01-01',\n * pageNo: 0,\n * pageSize: 10\n * });\n * ```\n *\n * @remarks\n * - All parameters are optional, allowing flexible filtering\n * - Returns paginated results when pageNo and pageSize are specified\n * - Date parameters should be in ISO format (YYYY-MM-DD)\n * - May return StandardError object if the request fails\n */\n async getNotifications({\n dateFrom,\n dateTo,\n type,\n language,\n status,\n pageNo,\n pageSize,\n }: NotificationSearchParams): Promise<NotificationResponse> {\n return NotificationManagementAPI.getNotifications(\n { fetch: this.fetch.bind(this) },\n {\n dateFrom,\n dateTo,\n type,\n language,\n status,\n pageNo,\n pageSize,\n },\n )\n }\n\n async getDocumentTypes(): Promise<DocumentTypesResponse> {\n return DocumentTypeManagementAPI.getDocumentTypes({\n fetch: this.fetch.bind(this),\n })\n }\n\n /**\n * Retrieves detailed information about a specific document type from the MyInvois platform.\n *\n * This method fetches metadata and configuration details for a specific document type,\n * including supported versions, validation rules, and structural requirements.\n * Useful for understanding document format requirements before submission.\n *\n * @param id - The unique identifier of the document type to retrieve\n * @returns Promise resolving to document type response object or standard error\n *\n * @example\n * ```typescript\n * // Get details for e-invoice document type\n * const invoiceType = await client.getDocumentType(1);\n * if ('id' in invoiceType) {\n * console.log('Document type name:', invoiceType.name);\n * console.log('Available versions:', invoiceType.versionNumber);\n * console.log('Description:', invoiceType.description);\n * }\n *\n * // Handle potential errors\n * const documentType = await client.getDocumentType(999);\n * if ('error' in documentType) {\n * console.error('Failed to retrieve document type:', documentType.error.message);\n * }\n * ```\n *\n * @remarks\n * - Returns StandardError object if the document type ID doesn't exist\n * - Document type information includes validation schemas and business rules\n * - Use this method to discover supported document formats and versions\n * - Essential for understanding submission requirements for different document types\n */\n async getDocumentType(id: number): Promise<DocumentTypeResponse> {\n return DocumentTypeManagementAPI.getDocumentType(\n { fetch: this.fetch.bind(this) },\n id,\n )\n }\n\n /**\n * Generates a shareable QR code URL for a specific document.\n *\n * This method retrieves the document details using its unique identifier,\n * then constructs a URL that can be used to access or share the document\n * via the MyInvois platform. The URL format differs between sandbox and\n * production environments.\n *\n * @param documentUid - The unique identifier of the document\n * @returns Promise resolving to a string containing the QR code URL\n *\n * @example\n * ```typescript\n * const qrCodeUrl = await client.getDocumentQrCode('abc123');\n * console.log('Shareable QR code URL:', qrCodeUrl);\n * // Output (sandbox): https://preprod.myinvois.hasil.gov.my/abc123/share/longId\n * // Output (production): https://myinvois.hasil.gov.my/abc123/share/longId\n * ```\n *\n * @remarks\n * - The returned URL can be embedded in a QR code for document sharing.\n * - The method fetches the document to obtain its longId, which is required for the URL.\n * - Ensure the documentUid is valid and accessible by the current client.\n */\n async getDocumentQrCode(\n documentUid: string,\n longId?: string,\n ): Promise<string | null> {\n const doc = await DocumentManagementAPI.getDocument(\n { fetch: this.fetch.bind(this) },\n documentUid,\n )\n\n const qrCodeBaseLink = `https://${this.environment === 'sandbox' ? 'preprod.' : ''}myinvois.hasil.gov.my/`\n if (!doc.longId && !longId) {\n return null\n }\n return qrCodeBaseLink + documentUid + '/share/' + (longId ?? doc.longId)\n }\n\n /**\n * Retrieves detailed information about a specific version of a document type.\n *\n * This method fetches version-specific metadata, schema definitions, and validation rules\n * for a particular document type version. Essential for understanding the exact format\n * and requirements for document submission in a specific version.\n *\n * @param id - The unique identifier of the document type\n * @param versionId - The unique identifier of the specific version to retrieve\n * @returns Promise resolving to document type version response object or standard error\n *\n * @example\n * ```typescript\n * // Get specific version details for e-invoice\n * const invoiceV1_1 = await client.getDocumentTypeVersion(1, 1);\n * if ('id' in invoiceV1_1) {\n * console.log('Version number:', invoiceV1_1.versionNumber);\n * console.log('Schema:', invoiceV1_1.jsonSchema);\n * console.log('Status:', invoiceV1_1.status);\n * }\n *\n * // Compare different versions\n * const [v1_0, v1_1] = await Promise.all([\n * client.getDocumentTypeVersion(1, 0),\n * client.getDocumentTypeVersion(1, 1)\n * ]);\n *\n * // Handle version not found\n * const result = await client.getDocumentTypeVersion(1, 999);\n * if ('error' in result) {\n * console.error('Version not found:', result.error.message);\n * }\n * ```\n *\n * @remarks\n * - Returns StandardError object if document type ID or version ID doesn't exist\n * - Version information includes JSON schema for validation\n * - Different versions may have different validation rules and field requirements\n * - Use this to ensure your documents conform to the specific version requirements\n * - Version status indicates if the version is active, deprecated, or under development\n */\n async getDocumentTypeVersion(\n id: number,\n versionId: number,\n ): Promise<DocumentTypeVersionResponse> {\n return DocumentTypeManagementAPI.getDocumentTypeVersion(\n { fetch: this.fetch.bind(this) },\n id,\n versionId,\n )\n }\n\n // Static helper: create a client directly from a PKCS#12 (.p12) bundle\n static fromP12(\n clientId: string,\n clientSecret: string,\n environment: 'sandbox' | 'production',\n p12Input: Buffer | string,\n passphrase: string,\n onBehalfOf?: string,\n debug?: boolean,\n ): MyInvoisClient {\n const { certificatePem, privateKeyPem } = getPemFromP12(\n p12Input,\n passphrase,\n )\n\n return new MyInvoisClient(\n clientId,\n clientSecret,\n environment,\n certificatePem,\n privateKeyPem,\n onBehalfOf,\n debug,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,IAAa,iBAAb,MAAa,eAAe;CAC1B,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CACjB,AAAQ;CACR,AAAiB;CACjB,AAAiB;CACjB,AAAQ,QAAQ;CAChB,AAAQ;CACR,AAAQ,eAAe;CAEvB,YACEA,UACAC,cACAC,aACAC,gBACAC,eACAC,YACAC,OACA;AAEA,OAAK,kBAAkB,eACrB,OAAM,IAAI,MACR;AAKJ,OAAK,gBAAgB,gBAAgB,cAAc,CACjD,OAAM,IAAI,MAAM;AAGlB,OAAK,WAAW;AAChB,OAAK,eAAe;AACpB,OAAK,UAAU,WAAW,YAAY;AACtC,OAAK,cAAc;AACnB,OAAK,aAAa;AAClB,OAAK,QAAS,SAAS,QAAQ,IAAI,mBAAmB,SAAU,OAAO;EAGvE,MAAM,EAAE,YAAY,cAAc,GAAG,uBAAuB,eAAe;AAE3E,OAAK,qBAAqB;GACxB;GACA;GACA;GACA;EACD;CACF;CAED,MAAM,iBAAiBC,YAAmC;AACxD,OAAK,aAAa;AAClB,QAAM,KAAK,cAAc;AACzB;CACD;CAED,MAAc,eAAe;EAC3B,MAAM,gBAAgB,MAAM,cAAc;GACxC,UAAU,KAAK;GACf,cAAc,KAAK;GACnB,SAAS,KAAK;GACd,YAAY,KAAK;GACjB,OAAO,KAAK;EACb,EAAC;AAEF,OAAK,QAAQ,cAAc;AAC3B,OAAK,kBAAkB,cAAc;CACtC;CAED,MAAc,WAAW;AACvB,OACG,KAAK,mBACN,KAAK,kCAAkB,IAAI,UAC3B,MAAM,KAAK,gBAAgB,SAAS,CAAC,EACrC;AACA,OAAI,KAAK,OAAO;AACd,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,IAAI,mBAAmB;GAChC;AACD,SAAM,KAAK,cAAc;EAC1B;AAED,SAAO,KAAK;CACb;CAED,MAAc,MAAMC,MAAcC,UAAuC,CAAE,GAAE;AAC3E,OAAK;AACL,MAAI,KAAK,MAAO,SAAQ,KAAK,yBAAyB,KAAK,aAAa,EAAE;EAE1E,MAAM,QAAQ,MAAM,KAAK,UAAU;EAMnC,MAAM,WAAW,kBACf,MACA,SAAS,OACV;AAED,SAAO,aACL,KAAK,UACL,UACA,MACE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG;GAC9B,GAAG;GACH,SAAS;IAAE,GAAG,QAAQ;IAAS,gBAAgB,SAAS,MAAM;GAAG;EAClE,EAAC,EACJ,KAAK,MACN;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BD,MAAM,UACJC,KACAC,QACAC,SACkB;AAClB,SAAO,UACL;GAAE,OAAO,KAAK,MAAM,KAAK,KAAK;GAAE,OAAO,KAAK;EAAO,GACnD,KACA,QACA,QACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCD,MAAM,UAAUC,QAAqD;AACnE,SAAO,UACL;GAAE,OAAO,KAAK,MAAM,KAAK,KAAK;GAAE,OAAO,KAAK;EAAO,GACnD,OACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BD,MAAM,kBAAkBC,YAAqD;AAC3E,SAAO,eACL;GAAE,OAAO,KAAK,MAAM,KAAK,KAAK;GAAE,OAAO,KAAK;EAAO,GACnD,WACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCD,MAAc,sBACZC,aACAC,QACAC,QAKC;AACD,SAAO,sBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,aACA,QACA,OACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BD,MAAM,eACJF,aACAE,QACkE;AAClE,SAAO,KAAK,sBAAsB,aAAa,aAAa,OAAO;CACpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BD,MAAM,eACJF,aACAE,QACkE;AAClE,SAAO,KAAK,sBAAsB,aAAa,YAAY,OAAO;CACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCD,MAAM,eAAeC,WAGlB;AACD,SAAO,eACL;GACE,OAAO,KAAK,MAAM,KAAK,KAAK;GAC5B,OAAO,KAAK;GACZ,oBAAoB,KAAK;EAC1B,GACD,UACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCD,MAAM,oBACJC,eACAC,eAAuB,KACvBC,aAAqB,IACrBC,SAAiB,GACjBC,WAAmB,IAclB;AACD,SAAO,oBACL;GAAE,OAAO,KAAK,MAAM,KAAK,KAAK;GAAE,OAAO,KAAK;EAAO,GACnD,eACA,cACA,YACA,QACA,SACD;CACF;;;;;;;;;;;;;;;CAgBD,MAAM,YACJR,aACiD;AACjD,SAAO,YACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,YACD;CACF;;;;;;;;;;;;;;;CAgBD,MAAM,mBAAmBA,aAOvB;AACA,SAAO,mBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,YACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCD,MAAM,gBAAgB,EACpB,MACA,oBACA,kBACA,UACA,QACA,eACA,aACA,kBACA,QACA,cACA,aAaD,EAA8B;AAC7B,SAAO,gBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EACF;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDD,MAAM,iBAAiB,EACrB,UACA,QACA,MACA,UACA,QACA,QACA,UACyB,EAAiC;AAC1D,SAAO,iBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC;GACE;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EACF;CACF;CAED,MAAM,mBAAmD;AACvD,SAAO,iBAA2C,EAChD,OAAO,KAAK,MAAM,KAAK,KAAK,CAC7B,EAAC;CACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCD,MAAM,gBAAgBS,IAA2C;AAC/D,SAAO,gBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,GACD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;CA0BD,MAAM,kBACJT,aACAU,QACwB;EACxB,MAAM,MAAM,MAAM,YAChB,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,YACD;EAED,MAAM,kBAAkB,UAAU,KAAK,gBAAgB,YAAY,aAAa,GAAG;AACnF,OAAK,IAAI,WAAW,OAClB,QAAO;AAET,SAAO,iBAAiB,cAAc,aAAa,UAAU,IAAI;CAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CD,MAAM,uBACJD,IACAE,WACsC;AACtC,SAAO,uBACL,EAAE,OAAO,KAAK,MAAM,KAAK,KAAK,CAAE,GAChC,IACA,UACD;CACF;CAGD,OAAO,QACL1B,UACAC,cACAC,aACAyB,UACAC,YACAvB,YACAC,OACgB;EAChB,MAAM,EAAE,gBAAgB,eAAe,GAAG,cACxC,UACA,WACD;AAED,SAAO,IAAI,eACT,UACA,cACA,aACA,gBACA,eACA,YACA;CAEH;AACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/utils/lineItems.ts
|
|
2
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
3
|
+
const defaultKeyFor = (item) => `${item.taxType}|${item.taxRate ?? ""}|${item.baseUnitMeasureCode ?? ""}`;
|
|
4
|
+
/**
|
|
5
|
+
* Aggregates line items by tax category, producing one line item per distinct
|
|
6
|
+
* category (tax type + rate). Monetary fields are summed; `unitPrice` is derived
|
|
7
|
+
* as taxable / quantity when a quantity is present.
|
|
8
|
+
*
|
|
9
|
+
* This is the generic, MyInvois-spec part of building consolidated documents.
|
|
10
|
+
* Data access, pricing math and consolidated descriptions remain the caller's
|
|
11
|
+
* responsibility (pass `describe` to set per-group descriptions).
|
|
12
|
+
*
|
|
13
|
+
* Groups are returned in first-seen order.
|
|
14
|
+
*/
|
|
15
|
+
const aggregateLineItemsByTaxCategory = (items, options = {}) => {
|
|
16
|
+
const keyFor = options.keyFor ?? defaultKeyFor;
|
|
17
|
+
const order = [];
|
|
18
|
+
const groups = /* @__PURE__ */ new Map();
|
|
19
|
+
for (const item of items) {
|
|
20
|
+
const key = keyFor(item);
|
|
21
|
+
if (!groups.has(key)) {
|
|
22
|
+
groups.set(key, []);
|
|
23
|
+
order.push(key);
|
|
24
|
+
}
|
|
25
|
+
groups.get(key).push(item);
|
|
26
|
+
}
|
|
27
|
+
return order.map((key) => {
|
|
28
|
+
const group = groups.get(key);
|
|
29
|
+
const first = group[0];
|
|
30
|
+
const taxable = group.reduce((sum, i) => sum + (i.totalTaxableAmountPerLine ?? 0), 0);
|
|
31
|
+
const tax = group.reduce((sum, i) => sum + (i.taxAmount ?? 0), 0);
|
|
32
|
+
const total = group.reduce((sum, i) => sum + (i.totalAmountPerLine ?? 0), 0);
|
|
33
|
+
const hasQuantity = group.some((i) => i.quantity !== void 0);
|
|
34
|
+
const quantity = hasQuantity ? group.reduce((sum, i) => sum + (i.quantity ?? 0), 0) : void 0;
|
|
35
|
+
const hasBaseUnitMeasure = group.some((i) => i.baseUnitMeasure !== void 0);
|
|
36
|
+
const baseUnitMeasure = hasBaseUnitMeasure ? group.reduce((sum, i) => sum + (i.baseUnitMeasure ?? 0), 0) : void 0;
|
|
37
|
+
const roundedTaxable = round2(taxable);
|
|
38
|
+
const unitPrice = quantity && quantity > 0 ? round2(roundedTaxable / quantity) : first.unitPrice;
|
|
39
|
+
return {
|
|
40
|
+
itemClassificationCode: first.itemClassificationCode,
|
|
41
|
+
itemDescription: options.describe?.(group, key) ?? first.itemDescription,
|
|
42
|
+
unitPrice,
|
|
43
|
+
taxType: first.taxType,
|
|
44
|
+
...first.taxRate !== void 0 ? { taxRate: first.taxRate } : {},
|
|
45
|
+
...first.taxPerUnitAmount !== void 0 ? { taxPerUnitAmount: first.taxPerUnitAmount } : {},
|
|
46
|
+
...baseUnitMeasure !== void 0 ? { baseUnitMeasure } : {},
|
|
47
|
+
...first.baseUnitMeasureCode !== void 0 ? { baseUnitMeasureCode: first.baseUnitMeasureCode } : {},
|
|
48
|
+
...quantity !== void 0 ? { quantity } : {},
|
|
49
|
+
taxAmount: round2(tax),
|
|
50
|
+
totalTaxableAmountPerLine: roundedTaxable,
|
|
51
|
+
totalAmountPerLine: round2(total)
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { aggregateLineItemsByTaxCategory };
|
|
58
|
+
//# sourceMappingURL=lineItems-Btjkf6VX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineItems-Btjkf6VX.js","names":["n: number","item: InvoiceLineItem","items: InvoiceLineItem[]","options: AggregateByTaxCategoryOptions","order: string[]"],"sources":["../src/utils/lineItems.ts"],"sourcesContent":["import type { InvoiceLineItem } from '../types'\n\nexport interface AggregateByTaxCategoryOptions {\n /**\n * Builds the grouping key for a line item. Lines sharing a key are merged\n * into a single aggregated line. Defaults to grouping by tax type + tax rate\n * + base unit measure code (so e.g. 6% SST and 8% SST stay separate).\n */\n keyFor?: (item: InvoiceLineItem) => string\n /**\n * Optional description for an aggregated line. Receives the group of source\n * line items and their key. Defaults to the first item's description.\n * Use this to inject consolidated-invoice descriptions (e.g. receipt ranges).\n */\n describe?: (group: InvoiceLineItem[], key: string) => string\n}\n\nconst round2 = (n: number): number => Math.round(n * 100) / 100\n\nconst defaultKeyFor = (item: InvoiceLineItem): string =>\n `${item.taxType}|${item.taxRate ?? ''}|${item.baseUnitMeasureCode ?? ''}`\n\n/**\n * Aggregates line items by tax category, producing one line item per distinct\n * category (tax type + rate). Monetary fields are summed; `unitPrice` is derived\n * as taxable / quantity when a quantity is present.\n *\n * This is the generic, MyInvois-spec part of building consolidated documents.\n * Data access, pricing math and consolidated descriptions remain the caller's\n * responsibility (pass `describe` to set per-group descriptions).\n *\n * Groups are returned in first-seen order.\n */\nexport const aggregateLineItemsByTaxCategory = (\n items: InvoiceLineItem[],\n options: AggregateByTaxCategoryOptions = {},\n): InvoiceLineItem[] => {\n const keyFor = options.keyFor ?? defaultKeyFor\n\n const order: string[] = []\n const groups = new Map<string, InvoiceLineItem[]>()\n\n for (const item of items) {\n const key = keyFor(item)\n if (!groups.has(key)) {\n groups.set(key, [])\n order.push(key)\n }\n groups.get(key)!.push(item)\n }\n\n return order.map(key => {\n const group = groups.get(key)!\n const first = group[0]!\n\n const taxable = group.reduce(\n (sum, i) => sum + (i.totalTaxableAmountPerLine ?? 0),\n 0,\n )\n const tax = group.reduce((sum, i) => sum + (i.taxAmount ?? 0), 0)\n const total = group.reduce((sum, i) => sum + (i.totalAmountPerLine ?? 0), 0)\n const hasQuantity = group.some(i => i.quantity !== undefined)\n const quantity = hasQuantity\n ? group.reduce((sum, i) => sum + (i.quantity ?? 0), 0)\n : undefined\n const hasBaseUnitMeasure = group.some(i => i.baseUnitMeasure !== undefined)\n const baseUnitMeasure = hasBaseUnitMeasure\n ? group.reduce((sum, i) => sum + (i.baseUnitMeasure ?? 0), 0)\n : undefined\n\n const roundedTaxable = round2(taxable)\n const unitPrice =\n quantity && quantity > 0 ? round2(roundedTaxable / quantity) : first.unitPrice\n\n return {\n itemClassificationCode: first.itemClassificationCode,\n itemDescription: options.describe?.(group, key) ?? first.itemDescription,\n unitPrice,\n taxType: first.taxType,\n ...(first.taxRate !== undefined ? { taxRate: first.taxRate } : {}),\n ...(first.taxPerUnitAmount !== undefined\n ? { taxPerUnitAmount: first.taxPerUnitAmount }\n : {}),\n ...(baseUnitMeasure !== undefined ? { baseUnitMeasure } : {}),\n ...(first.baseUnitMeasureCode !== undefined\n ? { baseUnitMeasureCode: first.baseUnitMeasureCode }\n : {}),\n ...(quantity !== undefined ? { quantity } : {}),\n taxAmount: round2(tax),\n totalTaxableAmountPerLine: roundedTaxable,\n totalAmountPerLine: round2(total),\n }\n })\n}\n"],"mappings":";AAiBA,MAAM,SAAS,CAACA,MAAsB,KAAK,MAAM,IAAI,IAAI,GAAG;AAE5D,MAAM,gBAAgB,CAACC,UACpB,EAAE,KAAK,QAAQ,GAAG,KAAK,WAAW,GAAG,GAAG,KAAK,uBAAuB,GAAG;;;;;;;;;;;;AAa1E,MAAa,kCAAkC,CAC7CC,OACAC,UAAyC,CAAE,MACrB;CACtB,MAAM,SAAS,QAAQ,UAAU;CAEjC,MAAMC,QAAkB,CAAE;CAC1B,MAAM,yBAAS,IAAI;AAEnB,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,MAAM,OAAO,KAAK;AACxB,OAAK,OAAO,IAAI,IAAI,EAAE;AACpB,UAAO,IAAI,KAAK,CAAE,EAAC;AACnB,SAAM,KAAK,IAAI;EAChB;AACD,SAAO,IAAI,IAAI,CAAE,KAAK,KAAK;CAC5B;AAED,QAAO,MAAM,IAAI,SAAO;EACtB,MAAM,QAAQ,OAAO,IAAI,IAAI;EAC7B,MAAM,QAAQ,MAAM;EAEpB,MAAM,UAAU,MAAM,OACpB,CAAC,KAAK,MAAM,OAAO,EAAE,6BAA6B,IAClD,EACD;EACD,MAAM,MAAM,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,aAAa,IAAI,EAAE;EACjE,MAAM,QAAQ,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,sBAAsB,IAAI,EAAE;EAC5E,MAAM,cAAc,MAAM,KAAK,OAAK,EAAE,oBAAuB;EAC7D,MAAM,WAAW,cACb,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,YAAY,IAAI,EAAE;EAExD,MAAM,qBAAqB,MAAM,KAAK,OAAK,EAAE,2BAA8B;EAC3E,MAAM,kBAAkB,qBACpB,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,mBAAmB,IAAI,EAAE;EAG/D,MAAM,iBAAiB,OAAO,QAAQ;EACtC,MAAM,YACJ,YAAY,WAAW,IAAI,OAAO,iBAAiB,SAAS,GAAG,MAAM;AAEvE,SAAO;GACL,wBAAwB,MAAM;GAC9B,iBAAiB,QAAQ,WAAW,OAAO,IAAI,IAAI,MAAM;GACzD;GACA,SAAS,MAAM;GACf,GAAI,MAAM,qBAAwB,EAAE,SAAS,MAAM,QAAS,IAAG,CAAE;GACjE,GAAI,MAAM,8BACN,EAAE,kBAAkB,MAAM,iBAAkB,IAC5C,CAAE;GACN,GAAI,6BAAgC,EAAE,gBAAiB,IAAG,CAAE;GAC5D,GAAI,MAAM,iCACN,EAAE,qBAAqB,MAAM,oBAAqB,IAClD,CAAE;GACN,GAAI,sBAAyB,EAAE,SAAU,IAAG,CAAE;GAC9C,WAAW,OAAO,IAAI;GACtB,2BAA2B;GAC3B,oBAAoB,OAAO,MAAM;EAClC;CACF,EAAC;AACH"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/lineItems.ts
|
|
3
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
4
|
+
const defaultKeyFor = (item) => `${item.taxType}|${item.taxRate ?? ""}|${item.baseUnitMeasureCode ?? ""}`;
|
|
5
|
+
/**
|
|
6
|
+
* Aggregates line items by tax category, producing one line item per distinct
|
|
7
|
+
* category (tax type + rate). Monetary fields are summed; `unitPrice` is derived
|
|
8
|
+
* as taxable / quantity when a quantity is present.
|
|
9
|
+
*
|
|
10
|
+
* This is the generic, MyInvois-spec part of building consolidated documents.
|
|
11
|
+
* Data access, pricing math and consolidated descriptions remain the caller's
|
|
12
|
+
* responsibility (pass `describe` to set per-group descriptions).
|
|
13
|
+
*
|
|
14
|
+
* Groups are returned in first-seen order.
|
|
15
|
+
*/
|
|
16
|
+
const aggregateLineItemsByTaxCategory = (items, options = {}) => {
|
|
17
|
+
const keyFor = options.keyFor ?? defaultKeyFor;
|
|
18
|
+
const order = [];
|
|
19
|
+
const groups = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const item of items) {
|
|
21
|
+
const key = keyFor(item);
|
|
22
|
+
if (!groups.has(key)) {
|
|
23
|
+
groups.set(key, []);
|
|
24
|
+
order.push(key);
|
|
25
|
+
}
|
|
26
|
+
groups.get(key).push(item);
|
|
27
|
+
}
|
|
28
|
+
return order.map((key) => {
|
|
29
|
+
const group = groups.get(key);
|
|
30
|
+
const first = group[0];
|
|
31
|
+
const taxable = group.reduce((sum, i) => sum + (i.totalTaxableAmountPerLine ?? 0), 0);
|
|
32
|
+
const tax = group.reduce((sum, i) => sum + (i.taxAmount ?? 0), 0);
|
|
33
|
+
const total = group.reduce((sum, i) => sum + (i.totalAmountPerLine ?? 0), 0);
|
|
34
|
+
const hasQuantity = group.some((i) => i.quantity !== void 0);
|
|
35
|
+
const quantity = hasQuantity ? group.reduce((sum, i) => sum + (i.quantity ?? 0), 0) : void 0;
|
|
36
|
+
const hasBaseUnitMeasure = group.some((i) => i.baseUnitMeasure !== void 0);
|
|
37
|
+
const baseUnitMeasure = hasBaseUnitMeasure ? group.reduce((sum, i) => sum + (i.baseUnitMeasure ?? 0), 0) : void 0;
|
|
38
|
+
const roundedTaxable = round2(taxable);
|
|
39
|
+
const unitPrice = quantity && quantity > 0 ? round2(roundedTaxable / quantity) : first.unitPrice;
|
|
40
|
+
return {
|
|
41
|
+
itemClassificationCode: first.itemClassificationCode,
|
|
42
|
+
itemDescription: options.describe?.(group, key) ?? first.itemDescription,
|
|
43
|
+
unitPrice,
|
|
44
|
+
taxType: first.taxType,
|
|
45
|
+
...first.taxRate !== void 0 ? { taxRate: first.taxRate } : {},
|
|
46
|
+
...first.taxPerUnitAmount !== void 0 ? { taxPerUnitAmount: first.taxPerUnitAmount } : {},
|
|
47
|
+
...baseUnitMeasure !== void 0 ? { baseUnitMeasure } : {},
|
|
48
|
+
...first.baseUnitMeasureCode !== void 0 ? { baseUnitMeasureCode: first.baseUnitMeasureCode } : {},
|
|
49
|
+
...quantity !== void 0 ? { quantity } : {},
|
|
50
|
+
taxAmount: round2(tax),
|
|
51
|
+
totalTaxableAmountPerLine: roundedTaxable,
|
|
52
|
+
totalAmountPerLine: round2(total)
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
Object.defineProperty(exports, 'aggregateLineItemsByTaxCategory', {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return aggregateLineItemsByTaxCategory;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=lineItems-C8iT0OL1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineItems-C8iT0OL1.cjs","names":["n: number","item: InvoiceLineItem","items: InvoiceLineItem[]","options: AggregateByTaxCategoryOptions","order: string[]"],"sources":["../src/utils/lineItems.ts"],"sourcesContent":["import type { InvoiceLineItem } from '../types'\n\nexport interface AggregateByTaxCategoryOptions {\n /**\n * Builds the grouping key for a line item. Lines sharing a key are merged\n * into a single aggregated line. Defaults to grouping by tax type + tax rate\n * + base unit measure code (so e.g. 6% SST and 8% SST stay separate).\n */\n keyFor?: (item: InvoiceLineItem) => string\n /**\n * Optional description for an aggregated line. Receives the group of source\n * line items and their key. Defaults to the first item's description.\n * Use this to inject consolidated-invoice descriptions (e.g. receipt ranges).\n */\n describe?: (group: InvoiceLineItem[], key: string) => string\n}\n\nconst round2 = (n: number): number => Math.round(n * 100) / 100\n\nconst defaultKeyFor = (item: InvoiceLineItem): string =>\n `${item.taxType}|${item.taxRate ?? ''}|${item.baseUnitMeasureCode ?? ''}`\n\n/**\n * Aggregates line items by tax category, producing one line item per distinct\n * category (tax type + rate). Monetary fields are summed; `unitPrice` is derived\n * as taxable / quantity when a quantity is present.\n *\n * This is the generic, MyInvois-spec part of building consolidated documents.\n * Data access, pricing math and consolidated descriptions remain the caller's\n * responsibility (pass `describe` to set per-group descriptions).\n *\n * Groups are returned in first-seen order.\n */\nexport const aggregateLineItemsByTaxCategory = (\n items: InvoiceLineItem[],\n options: AggregateByTaxCategoryOptions = {},\n): InvoiceLineItem[] => {\n const keyFor = options.keyFor ?? defaultKeyFor\n\n const order: string[] = []\n const groups = new Map<string, InvoiceLineItem[]>()\n\n for (const item of items) {\n const key = keyFor(item)\n if (!groups.has(key)) {\n groups.set(key, [])\n order.push(key)\n }\n groups.get(key)!.push(item)\n }\n\n return order.map(key => {\n const group = groups.get(key)!\n const first = group[0]!\n\n const taxable = group.reduce(\n (sum, i) => sum + (i.totalTaxableAmountPerLine ?? 0),\n 0,\n )\n const tax = group.reduce((sum, i) => sum + (i.taxAmount ?? 0), 0)\n const total = group.reduce((sum, i) => sum + (i.totalAmountPerLine ?? 0), 0)\n const hasQuantity = group.some(i => i.quantity !== undefined)\n const quantity = hasQuantity\n ? group.reduce((sum, i) => sum + (i.quantity ?? 0), 0)\n : undefined\n const hasBaseUnitMeasure = group.some(i => i.baseUnitMeasure !== undefined)\n const baseUnitMeasure = hasBaseUnitMeasure\n ? group.reduce((sum, i) => sum + (i.baseUnitMeasure ?? 0), 0)\n : undefined\n\n const roundedTaxable = round2(taxable)\n const unitPrice =\n quantity && quantity > 0 ? round2(roundedTaxable / quantity) : first.unitPrice\n\n return {\n itemClassificationCode: first.itemClassificationCode,\n itemDescription: options.describe?.(group, key) ?? first.itemDescription,\n unitPrice,\n taxType: first.taxType,\n ...(first.taxRate !== undefined ? { taxRate: first.taxRate } : {}),\n ...(first.taxPerUnitAmount !== undefined\n ? { taxPerUnitAmount: first.taxPerUnitAmount }\n : {}),\n ...(baseUnitMeasure !== undefined ? { baseUnitMeasure } : {}),\n ...(first.baseUnitMeasureCode !== undefined\n ? { baseUnitMeasureCode: first.baseUnitMeasureCode }\n : {}),\n ...(quantity !== undefined ? { quantity } : {}),\n taxAmount: round2(tax),\n totalTaxableAmountPerLine: roundedTaxable,\n totalAmountPerLine: round2(total),\n }\n })\n}\n"],"mappings":";;AAiBA,MAAM,SAAS,CAACA,MAAsB,KAAK,MAAM,IAAI,IAAI,GAAG;AAE5D,MAAM,gBAAgB,CAACC,UACpB,EAAE,KAAK,QAAQ,GAAG,KAAK,WAAW,GAAG,GAAG,KAAK,uBAAuB,GAAG;;;;;;;;;;;;AAa1E,MAAa,kCAAkC,CAC7CC,OACAC,UAAyC,CAAE,MACrB;CACtB,MAAM,SAAS,QAAQ,UAAU;CAEjC,MAAMC,QAAkB,CAAE;CAC1B,MAAM,yBAAS,IAAI;AAEnB,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,MAAM,OAAO,KAAK;AACxB,OAAK,OAAO,IAAI,IAAI,EAAE;AACpB,UAAO,IAAI,KAAK,CAAE,EAAC;AACnB,SAAM,KAAK,IAAI;EAChB;AACD,SAAO,IAAI,IAAI,CAAE,KAAK,KAAK;CAC5B;AAED,QAAO,MAAM,IAAI,SAAO;EACtB,MAAM,QAAQ,OAAO,IAAI,IAAI;EAC7B,MAAM,QAAQ,MAAM;EAEpB,MAAM,UAAU,MAAM,OACpB,CAAC,KAAK,MAAM,OAAO,EAAE,6BAA6B,IAClD,EACD;EACD,MAAM,MAAM,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,aAAa,IAAI,EAAE;EACjE,MAAM,QAAQ,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,sBAAsB,IAAI,EAAE;EAC5E,MAAM,cAAc,MAAM,KAAK,OAAK,EAAE,oBAAuB;EAC7D,MAAM,WAAW,cACb,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,YAAY,IAAI,EAAE;EAExD,MAAM,qBAAqB,MAAM,KAAK,OAAK,EAAE,2BAA8B;EAC3E,MAAM,kBAAkB,qBACpB,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,EAAE,mBAAmB,IAAI,EAAE;EAG/D,MAAM,iBAAiB,OAAO,QAAQ;EACtC,MAAM,YACJ,YAAY,WAAW,IAAI,OAAO,iBAAiB,SAAS,GAAG,MAAM;AAEvE,SAAO;GACL,wBAAwB,MAAM;GAC9B,iBAAiB,QAAQ,WAAW,OAAO,IAAI,IAAI,MAAM;GACzD;GACA,SAAS,MAAM;GACf,GAAI,MAAM,qBAAwB,EAAE,SAAS,MAAM,QAAS,IAAG,CAAE;GACjE,GAAI,MAAM,8BACN,EAAE,kBAAkB,MAAM,iBAAkB,IAC5C,CAAE;GACN,GAAI,6BAAgC,EAAE,gBAAiB,IAAG,CAAE;GAC5D,GAAI,MAAM,iCACN,EAAE,qBAAqB,MAAM,oBAAqB,IAClD,CAAE;GACN,GAAI,sBAAyB,EAAE,SAAU,IAAG,CAAE;GAC9C,WAAW,OAAO,IAAI;GACtB,2BAA2B;GAC3B,oBAAoB,OAAO,MAAM;EAClC;CACF,EAAC;AACH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { InvoiceLineItem } from "./documents-D_V38Q_U.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/lineItems.d.ts
|
|
4
|
+
interface AggregateByTaxCategoryOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Builds the grouping key for a line item. Lines sharing a key are merged
|
|
7
|
+
* into a single aggregated line. Defaults to grouping by tax type + tax rate
|
|
8
|
+
* + base unit measure code (so e.g. 6% SST and 8% SST stay separate).
|
|
9
|
+
*/
|
|
10
|
+
keyFor?: (item: InvoiceLineItem) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional description for an aggregated line. Receives the group of source
|
|
13
|
+
* line items and their key. Defaults to the first item's description.
|
|
14
|
+
* Use this to inject consolidated-invoice descriptions (e.g. receipt ranges).
|
|
15
|
+
*/
|
|
16
|
+
describe?: (group: InvoiceLineItem[], key: string) => string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Aggregates line items by tax category, producing one line item per distinct
|
|
20
|
+
* category (tax type + rate). Monetary fields are summed; `unitPrice` is derived
|
|
21
|
+
* as taxable / quantity when a quantity is present.
|
|
22
|
+
*
|
|
23
|
+
* This is the generic, MyInvois-spec part of building consolidated documents.
|
|
24
|
+
* Data access, pricing math and consolidated descriptions remain the caller's
|
|
25
|
+
* responsibility (pass `describe` to set per-group descriptions).
|
|
26
|
+
*
|
|
27
|
+
* Groups are returned in first-seen order.
|
|
28
|
+
*/
|
|
29
|
+
declare const aggregateLineItemsByTaxCategory: (items: InvoiceLineItem[], options?: AggregateByTaxCategoryOptions) => InvoiceLineItem[];
|
|
30
|
+
//#endregion
|
|
31
|
+
export { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory };
|
|
32
|
+
//# sourceMappingURL=lineItems-CBSo7giH.d.cts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { InvoiceLineItem } from "./documents-BpZn3hJq.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/lineItems.d.ts
|
|
4
|
+
interface AggregateByTaxCategoryOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Builds the grouping key for a line item. Lines sharing a key are merged
|
|
7
|
+
* into a single aggregated line. Defaults to grouping by tax type + tax rate
|
|
8
|
+
* + base unit measure code (so e.g. 6% SST and 8% SST stay separate).
|
|
9
|
+
*/
|
|
10
|
+
keyFor?: (item: InvoiceLineItem) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional description for an aggregated line. Receives the group of source
|
|
13
|
+
* line items and their key. Defaults to the first item's description.
|
|
14
|
+
* Use this to inject consolidated-invoice descriptions (e.g. receipt ranges).
|
|
15
|
+
*/
|
|
16
|
+
describe?: (group: InvoiceLineItem[], key: string) => string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Aggregates line items by tax category, producing one line item per distinct
|
|
20
|
+
* category (tax type + rate). Monetary fields are summed; `unitPrice` is derived
|
|
21
|
+
* as taxable / quantity when a quantity is present.
|
|
22
|
+
*
|
|
23
|
+
* This is the generic, MyInvois-spec part of building consolidated documents.
|
|
24
|
+
* Data access, pricing math and consolidated descriptions remain the caller's
|
|
25
|
+
* responsibility (pass `describe` to set per-group descriptions).
|
|
26
|
+
*
|
|
27
|
+
* Groups are returned in first-seen order.
|
|
28
|
+
*/
|
|
29
|
+
declare const aggregateLineItemsByTaxCategory: (items: InvoiceLineItem[], options?: AggregateByTaxCategoryOptions) => InvoiceLineItem[];
|
|
30
|
+
//#endregion
|
|
31
|
+
export { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory };
|
|
32
|
+
//# sourceMappingURL=lineItems-CrkEXi2m.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MSIC_0X_CODE } from "./0X-bPhcc9Vv.js";
|
|
2
|
+
import { MSIC_1X_CODE } from "./1X-DKHYQyRy.js";
|
|
3
|
+
import { MSIC_2X_CODE } from "./2X-DN6M21cV.js";
|
|
4
|
+
import { MSIC_3X_CODE } from "./3X-DJRj5xLv.js";
|
|
5
|
+
import { MSIC_4X_CODE } from "./4X-BCvTomUF.js";
|
|
6
|
+
import { MSIC_5X_CODE } from "./5X-Dji6Soz5.js";
|
|
7
|
+
import { MSIC_6X_CODE } from "./6X-CO_u4RIY.js";
|
|
8
|
+
import { MSIC_7X_CODE } from "./7X-vzJ01lNF.js";
|
|
9
|
+
import { MSIC_8X_CODE } from "./8X-C4Wf4jYK.js";
|
|
10
|
+
import { MSIC_9X_CODE } from "./9X-1VwxN9g-.js";
|
|
11
|
+
|
|
12
|
+
//#region src/types/msic-codes.d.ts
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the allowed 5-digit Malaysia Standard Industrial Classification (MSIC) codes.
|
|
16
|
+
* Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/msic-codes/
|
|
17
|
+
* Interface representing an MSIC code entry.
|
|
18
|
+
* Contains the 5-digit code and its description.
|
|
19
|
+
*/
|
|
20
|
+
interface MSICCode {
|
|
21
|
+
code: MSIC_0X_CODE | MSIC_1X_CODE | MSIC_2X_CODE | MSIC_3X_CODE | MSIC_4X_CODE | MSIC_5X_CODE | MSIC_6X_CODE | MSIC_7X_CODE | MSIC_8X_CODE | MSIC_9X_CODE;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { MSICCode };
|
|
26
|
+
//# sourceMappingURL=msic-codes-kysVPGdN.d.ts.map
|
package/dist/{notificationManagement-DLBDn77E.cjs.map → notificationManagement-C_qrFwWL.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationManagement-
|
|
1
|
+
{"version":3,"file":"notificationManagement-C_qrFwWL.cjs","names":["context: NotificationContext","params: NotificationSearchParams"],"sources":["../src/api/notificationManagement.ts"],"sourcesContent":["import type {\n Fetch,\n NotificationResponse,\n NotificationSearchParams,\n} from '../types'\n\ninterface NotificationContext {\n fetch: Fetch\n}\n\nexport async function getNotifications(\n context: NotificationContext,\n params: NotificationSearchParams,\n): Promise<NotificationResponse> {\n const { fetch } = context\n const { dateFrom, dateTo, type, language, status, pageNo, pageSize } = params\n\n const queryParams = new URLSearchParams()\n if (dateFrom) queryParams.set('dateFrom', dateFrom)\n if (dateTo) queryParams.set('dateTo', dateTo)\n if (type) queryParams.set('type', type.toString())\n if (language) queryParams.set('language', language)\n if (status) queryParams.set('status', status.toString())\n if (pageNo) queryParams.set('pageNo', pageNo.toString())\n if (pageSize) queryParams.set('pageSize', pageSize.toString())\n\n const response = await fetch(\n `/api/v1.0/notifications/taxpayer?${queryParams.toString()}`,\n )\n\n const data = (await response.json()) as NotificationResponse\n\n return data\n}\n"],"mappings":";;AAUA,eAAsB,iBACpBA,SACAC,QAC+B;CAC/B,MAAM,EAAE,OAAO,GAAG;CAClB,MAAM,EAAE,UAAU,QAAQ,MAAM,UAAU,QAAQ,QAAQ,UAAU,GAAG;CAEvE,MAAM,cAAc,IAAI;AACxB,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS;AACnD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO;AAC7C,KAAI,KAAM,aAAY,IAAI,QAAQ,KAAK,UAAU,CAAC;AAClD,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS;AACnD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO,UAAU,CAAC;AACxD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO,UAAU,CAAC;AACxD,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS,UAAU,CAAC;CAE9D,MAAM,WAAW,MAAM,OACpB,mCAAmC,YAAY,UAAU,CAAC,EAC5D;CAED,MAAM,OAAQ,MAAM,SAAS,MAAM;AAEnC,QAAO;AACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationManagement-n4Z5e-My.js","names":["context: NotificationContext","params: NotificationSearchParams"],"sources":["../src/api/notificationManagement.ts"],"sourcesContent":["import type {\n Fetch,\n NotificationResponse,\n NotificationSearchParams,\n} from '../types'\n\ninterface NotificationContext {\n fetch: Fetch\n}\n\nexport async function getNotifications(\n context: NotificationContext,\n params: NotificationSearchParams,\n): Promise<NotificationResponse> {\n const { fetch } = context\n const { dateFrom, dateTo, type, language, status, pageNo, pageSize } = params\n\n const queryParams = new URLSearchParams()\n if (dateFrom) queryParams.set('dateFrom', dateFrom)\n if (dateTo) queryParams.set('dateTo', dateTo)\n if (type) queryParams.set('type', type.toString())\n if (language) queryParams.set('language', language)\n if (status) queryParams.set('status', status.toString())\n if (pageNo) queryParams.set('pageNo', pageNo.toString())\n if (pageSize) queryParams.set('pageSize', pageSize.toString())\n\n const response = await fetch(\n `/api/v1.0/notifications/taxpayer?${queryParams.toString()}`,\n )\n\n const data = (await response.json()) as NotificationResponse\n\n return data\n}\n"],"mappings":";AAUA,eAAsB,iBACpBA,SACAC,QAC+B;CAC/B,MAAM,EAAE,OAAO,GAAG;CAClB,MAAM,EAAE,UAAU,QAAQ,MAAM,UAAU,QAAQ,QAAQ,UAAU,GAAG;CAEvE,MAAM,cAAc,IAAI;AACxB,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS;AACnD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO;AAC7C,KAAI,KAAM,aAAY,IAAI,QAAQ,KAAK,UAAU,CAAC;AAClD,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS;AACnD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO,UAAU,CAAC;AACxD,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO,UAAU,CAAC;AACxD,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS,UAAU,CAAC;CAE9D,MAAM,WAAW,MAAM,OACpB,mCAAmC,YAAY,UAAU,CAAC,EAC5D;CAED,MAAM,OAAQ,MAAM,SAAS,MAAM;AAEnC,QAAO;AACR"}
|
|
@@ -59,4 +59,5 @@ type NotificationSearchParams = {
|
|
|
59
59
|
pageSize?: number;
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
62
|
-
export { Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum };
|
|
62
|
+
export { Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum };
|
|
63
|
+
//# sourceMappingURL=notifications-B4BymhRJ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformLogin-CqI9OLYP.js","names":["client: ClientCredentials","errorBody: unknown","tokenResponse: TokenResponse"],"sources":["../src/api/platformLogin.ts"],"sourcesContent":["import type { ClientCredentials, TokenResponse } from '../types'\n\nexport const platformLogin = async (\n client: ClientCredentials,\n): Promise<{\n token: string\n tokenExpiration: Date\n}> => {\n const { clientId, clientSecret, baseUrl, onBehalfOf, debug } = client\n try {\n const response = await fetch(`${baseUrl}/connect/token`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n ...(onBehalfOf ? { onbehalfof: onBehalfOf } : {}),\n },\n body: new URLSearchParams({\n grant_type: 'client_credentials',\n client_id: clientId,\n client_secret: clientSecret,\n scope: 'InvoicingAPI',\n }),\n })\n\n // If authentication fails, surface the error details immediately\n if (!response.ok) {\n let errorBody: unknown\n try {\n errorBody = await response.json()\n } catch {\n /* ignored */\n }\n\n const errorMessage =\n typeof errorBody === 'object' &&\n errorBody !== null &&\n 'error_description' in errorBody\n ? (errorBody as { error_description: string }).error_description\n : `Platform login failed with status ${response.status}`\n\n throw new Error(errorMessage)\n }\n\n const tokenResponse: TokenResponse = await response.json()\n\n if (!tokenResponse.access_token) {\n throw new Error('Platform login response did not include an access_token')\n }\n\n return {\n token: tokenResponse.access_token,\n tokenExpiration: new Date(Date.now() + tokenResponse.expires_in * 1000),\n }\n } catch (error) {\n if (debug) console.error(error)\n throw error\n }\n}\n"],"mappings":";AAEA,MAAa,gBAAgB,OAC3BA,WAII;CACJ,MAAM,EAAE,UAAU,cAAc,SAAS,YAAY,OAAO,GAAG;AAC/D,KAAI;EACF,MAAM,WAAW,MAAM,OAAO,EAAE,QAAQ,iBAAiB;GACvD,QAAQ;GACR,SAAS;IACP,gBAAgB;IAChB,GAAI,aAAa,EAAE,YAAY,WAAY,IAAG,CAAE;GACjD;GACD,MAAM,IAAI,gBAAgB;IACxB,YAAY;IACZ,WAAW;IACX,eAAe;IACf,OAAO;GACR;EACF,EAAC;AAGF,OAAK,SAAS,IAAI;GAChB,IAAIC;AACJ,OAAI;AACF,gBAAY,MAAM,SAAS,MAAM;GAClC,QAAO,CAEP;GAED,MAAM,sBACG,cAAc,YACrB,cAAc,QACd,uBAAuB,YAClB,UAA4C,qBAC5C,oCAAoC,SAAS,OAAO;AAE3D,SAAM,IAAI,MAAM;EACjB;EAED,MAAMC,gBAA+B,MAAM,SAAS,MAAM;AAE1D,OAAK,cAAc,aACjB,OAAM,IAAI,MAAM;AAGlB,SAAO;GACL,OAAO,cAAc;GACrB,iBAAiB,IAAI,KAAK,KAAK,KAAK,GAAG,cAAc,aAAa;EACnE;CACF,SAAQ,OAAO;AACd,MAAI,MAAO,SAAQ,MAAM,MAAM;AAC/B,QAAM;CACP;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformLogin-
|
|
1
|
+
{"version":3,"file":"platformLogin-DC4s6Qpv.cjs","names":["client: ClientCredentials","errorBody: unknown","tokenResponse: TokenResponse"],"sources":["../src/api/platformLogin.ts"],"sourcesContent":["import type { ClientCredentials, TokenResponse } from '../types'\n\nexport const platformLogin = async (\n client: ClientCredentials,\n): Promise<{\n token: string\n tokenExpiration: Date\n}> => {\n const { clientId, clientSecret, baseUrl, onBehalfOf, debug } = client\n try {\n const response = await fetch(`${baseUrl}/connect/token`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n ...(onBehalfOf ? { onbehalfof: onBehalfOf } : {}),\n },\n body: new URLSearchParams({\n grant_type: 'client_credentials',\n client_id: clientId,\n client_secret: clientSecret,\n scope: 'InvoicingAPI',\n }),\n })\n\n // If authentication fails, surface the error details immediately\n if (!response.ok) {\n let errorBody: unknown\n try {\n errorBody = await response.json()\n } catch {\n /* ignored */\n }\n\n const errorMessage =\n typeof errorBody === 'object' &&\n errorBody !== null &&\n 'error_description' in errorBody\n ? (errorBody as { error_description: string }).error_description\n : `Platform login failed with status ${response.status}`\n\n throw new Error(errorMessage)\n }\n\n const tokenResponse: TokenResponse = await response.json()\n\n if (!tokenResponse.access_token) {\n throw new Error('Platform login response did not include an access_token')\n }\n\n return {\n token: tokenResponse.access_token,\n tokenExpiration: new Date(Date.now() + tokenResponse.expires_in * 1000),\n }\n } catch (error) {\n if (debug) console.error(error)\n throw error\n }\n}\n"],"mappings":";;AAEA,MAAa,gBAAgB,OAC3BA,WAII;CACJ,MAAM,EAAE,UAAU,cAAc,SAAS,YAAY,OAAO,GAAG;AAC/D,KAAI;EACF,MAAM,WAAW,MAAM,OAAO,EAAE,QAAQ,iBAAiB;GACvD,QAAQ;GACR,SAAS;IACP,gBAAgB;IAChB,GAAI,aAAa,EAAE,YAAY,WAAY,IAAG,CAAE;GACjD;GACD,MAAM,IAAI,gBAAgB;IACxB,YAAY;IACZ,WAAW;IACX,eAAe;IACf,OAAO;GACR;EACF,EAAC;AAGF,OAAK,SAAS,IAAI;GAChB,IAAIC;AACJ,OAAI;AACF,gBAAY,MAAM,SAAS,MAAM;GAClC,QAAO,CAEP;GAED,MAAM,sBACG,cAAc,YACrB,cAAc,QACd,uBAAuB,YAClB,UAA4C,qBAC5C,oCAAoC,SAAS,OAAO;AAE3D,SAAM,IAAI,MAAM;EACjB;EAED,MAAMC,gBAA+B,MAAM,SAAS,MAAM;AAE1D,OAAK,cAAc,aACjB,OAAM,IAAI,MAAM;AAGlB,SAAO;GACL,OAAO,cAAc;GACrB,iBAAiB,IAAI,KAAK,KAAK,KAAK,GAAG,cAAc,aAAa;EACnE;CACF,SAAQ,OAAO;AACd,MAAI,MAAO,SAAQ,MAAM,MAAM;AAC/B,QAAM;CACP;AACF"}
|
|
@@ -169,4 +169,5 @@ interface IssuerDigitalSignature {
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
|
-
export { CanonicalizationMethod, Cert, CertDigest, DigestMethod, IssuerDigitalSignature, IssuerSerial, KeyInfo, QualifyingProperties, Reference, SignatureMethod, SignedInfo, SignedProperties, SignedSignatureProperties, SigningCertificate, Transform, X509Data };
|
|
172
|
+
export { CanonicalizationMethod, Cert, CertDigest, DigestMethod, IssuerDigitalSignature, IssuerSerial, KeyInfo, QualifyingProperties, Reference, SignatureMethod, SignedInfo, SignedProperties, SignedSignatureProperties, SigningCertificate, Transform, X509Data };
|
|
173
|
+
//# sourceMappingURL=signatures-Bk5aKcq6.d.ts.map
|