@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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../formatIdValue-qTxJqj9o.js";
|
|
2
|
+
import { extractCertificateInfo } from "../document-BC52NCdW.js";
|
|
3
|
+
import { getPemFromP12, validateKeyPair } from "../certificate-Cg6spxUs.js";
|
|
2
4
|
|
|
3
5
|
export { extractCertificateInfo, getPemFromP12, validateKeyPair };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('
|
|
2
|
-
|
|
1
|
+
const require_document = require('../document-B11B5lqd.cjs');
|
|
2
|
+
require('../formatIdValue-i67o4kyD.cjs');
|
|
3
3
|
|
|
4
4
|
exports.calculateCertificateDigest = require_document.calculateCertificateDigest;
|
|
5
5
|
exports.calculateDocumentDigest = require_document.calculateDocumentDigest;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "../classification-codes-B15PbWxz.cjs";
|
|
2
|
+
import "../country-code-DPeNFMMi.cjs";
|
|
3
|
+
import "../currencies-S5g1gzBU.cjs";
|
|
4
|
+
import "../e-invoice-BuwtFnlI.cjs";
|
|
5
|
+
import "../0X-Cr3M7hci.cjs";
|
|
6
|
+
import "../1X-CWwmfCzo.cjs";
|
|
7
|
+
import "../2X-DNtkJ0tj.cjs";
|
|
8
|
+
import "../3X-BOxfatu3.cjs";
|
|
9
|
+
import "../4X-C7fzDWJ_.cjs";
|
|
10
|
+
import "../5X-CNAFsDm2.cjs";
|
|
11
|
+
import "../6X-uObUP4VG.cjs";
|
|
12
|
+
import "../7X-BifJnY24.cjs";
|
|
13
|
+
import "../8X-DioBXCJ0.cjs";
|
|
14
|
+
import "../9X-BjffnXuq.cjs";
|
|
15
|
+
import "../msic-codes-CIKdPqag.cjs";
|
|
16
|
+
import "../tax-types-fu5Q6dic.cjs";
|
|
17
|
+
import "../state-codes-u3ppueWo.cjs";
|
|
18
|
+
import "../1X-DYw2tURz.cjs";
|
|
19
|
+
import "../2X-CXtqiwRg.cjs";
|
|
20
|
+
import "../3X-Bk_fUIAk.cjs";
|
|
21
|
+
import "../4X-CK9rj5qd.cjs";
|
|
22
|
+
import "../5X-CpAvNxvd.cjs";
|
|
23
|
+
import "../6X-bXWr_7xY.cjs";
|
|
24
|
+
import "../7X-BJBOlWhV.cjs";
|
|
25
|
+
import "../8X-dshwiOxU.cjs";
|
|
26
|
+
import "../9X-9j2Djy4W.cjs";
|
|
27
|
+
import "../AX-CWCopjCC.cjs";
|
|
28
|
+
import "../BX-Cq7WdhD3.cjs";
|
|
29
|
+
import "../CX-DlcVZfxx.cjs";
|
|
30
|
+
import "../DX-DLdv-Nxj.cjs";
|
|
31
|
+
import "../EX-CIJv8-Lw.cjs";
|
|
32
|
+
import "../FX-DlDM_Zea.cjs";
|
|
33
|
+
import "../GX-BFGNX6Jy.cjs";
|
|
34
|
+
import "../HX-D7Y9qRSm.cjs";
|
|
35
|
+
import "../IX-DPTrbhgX.cjs";
|
|
36
|
+
import "../JX-D8JmtNpo.cjs";
|
|
37
|
+
import "../KX-B46KJZrH.cjs";
|
|
38
|
+
import "../LX-CfTKy8Sx.cjs";
|
|
39
|
+
import "../MX-BKJ4gNvV.cjs";
|
|
40
|
+
import "../NX-CSdLIFqU.cjs";
|
|
41
|
+
import "../OX-BwqOsulT.cjs";
|
|
42
|
+
import "../PX-BTx0TXsJ.cjs";
|
|
43
|
+
import "../QX-BUXR8RJL.cjs";
|
|
44
|
+
import "../RX-CZ8HiH37.cjs";
|
|
45
|
+
import "../SX-CLxsqiQk.cjs";
|
|
46
|
+
import "../TX-DKc8hLc4.cjs";
|
|
47
|
+
import "../UX-bc7xDnZI.cjs";
|
|
48
|
+
import "../VX-CIHTFyoC.cjs";
|
|
49
|
+
import "../WX-BHvlq7Jx.cjs";
|
|
50
|
+
import "../YX-CkxLeFb4.cjs";
|
|
51
|
+
import "../ZX-DVb_buNI.cjs";
|
|
52
|
+
import "../XX-DztQxYHJ.cjs";
|
|
53
|
+
import "../unit-types-BXdufGWm.cjs";
|
|
54
|
+
import "../documents-D_V38Q_U.cjs";
|
|
55
|
+
import "../payment-modes-7c1lWlIr.cjs";
|
|
56
|
+
import "../signatures-CyDSZr_e.cjs";
|
|
57
|
+
import "../notifications-DdlEkprb.cjs";
|
|
58
|
+
import "../taxpayer-DwGzY1IL.cjs";
|
|
59
|
+
import "../utils-Cdqbbzca.cjs";
|
|
60
|
+
import "../index-Yr1QAbIF.cjs";
|
|
61
|
+
import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-BQdoGqOl.cjs";
|
|
62
|
+
export { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing };
|
package/dist/utils/document.d.ts
CHANGED
|
@@ -1,211 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../country-code-
|
|
3
|
-
import "../currencies-
|
|
4
|
-
import "../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 "../msic-codes-
|
|
16
|
-
import
|
|
17
|
-
import "../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
|
|
54
|
-
import
|
|
55
|
-
import "../payment-modes-
|
|
56
|
-
import "../signatures-
|
|
57
|
-
import "../notifications-
|
|
58
|
-
import "../taxpayer-
|
|
59
|
-
import "../utils-
|
|
60
|
-
import "../index-
|
|
61
|
-
|
|
62
|
-
//#region src/utils/document.d.ts
|
|
63
|
-
/**
|
|
64
|
-
* MyInvois v1.1 Document Generation and Signing Utilities
|
|
65
|
-
* Strictly follows: https://sdk.myinvois.hasil.gov.my/documents/invoice-v1-1
|
|
66
|
-
* JSON Signature Guide: https://sdk.myinvois.hasil.gov.my/signature-creation-json/
|
|
67
|
-
*/
|
|
68
|
-
/**
|
|
69
|
-
* Determines if a line item uses fixed rate taxation
|
|
70
|
-
*/
|
|
71
|
-
declare const isFixedRateTax: (item: InvoiceLineItem) => boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Determines if a line item uses percentage taxation
|
|
74
|
-
*/
|
|
75
|
-
declare const isPercentageTax: (item: InvoiceLineItem) => boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Calculates expected tax amount for a line item based on its tax type
|
|
78
|
-
*/
|
|
79
|
-
declare const calculateExpectedTaxAmount: (item: InvoiceLineItem) => number;
|
|
80
|
-
/**
|
|
81
|
-
* Helper function to recursively sort object keys for JSON canonicalization
|
|
82
|
-
*/
|
|
83
|
-
declare function sortObjectKeys(obj: unknown): unknown;
|
|
84
|
-
/**
|
|
85
|
-
* Enhanced canonicalization following MyInvois specification exactly
|
|
86
|
-
* Key changes: ensure consistent ordering and formatting
|
|
87
|
-
*/
|
|
88
|
-
declare const canonicalizeJSON: (obj: unknown) => string;
|
|
89
|
-
/**
|
|
90
|
-
* Generates a clean invoice object following MyInvois v1.1 specification exactly
|
|
91
|
-
* This is the base invoice structure WITHOUT signature elements (for hash calculation)
|
|
92
|
-
*
|
|
93
|
-
* Key requirements from working documents:
|
|
94
|
-
* - All mandatory fields must be present
|
|
95
|
-
* - Many optional fields must be present even if empty
|
|
96
|
-
* - Specific field ordering and structure
|
|
97
|
-
* - Correct listID values (e.g., "3166-1" not "ISO3166-1")
|
|
98
|
-
*/
|
|
99
|
-
declare const generateCleanInvoiceObject: (invoice: AllDocumentsV1_1) => InvoiceSubmission;
|
|
100
|
-
/**
|
|
101
|
-
* Generates the complete UBL document structure with namespace declarations
|
|
102
|
-
*/
|
|
103
|
-
declare const generateCleanUBLDocument: (invoices: AllDocumentsV1_1[]) => UBLDocument;
|
|
104
|
-
/**
|
|
105
|
-
* Step 1: Transform the document for hashing or transmission
|
|
106
|
-
* Removes UBLExtensions and Signature, and minifies the JSON
|
|
107
|
-
* Returns the minified, cleaned JSON string
|
|
108
|
-
*
|
|
109
|
-
* FIXED: Use regex-based minification to match PowerShell script exactly
|
|
110
|
-
*/
|
|
111
|
-
declare const transformDocumentForHashing: (invoices: AllDocumentsV1_1[]) => string;
|
|
112
|
-
/**
|
|
113
|
-
* Step 2: Calculate Document Digest
|
|
114
|
-
* FIXED: Remove UBLExtensions and Signature before hashing (DS322)
|
|
115
|
-
* Based on working implementation pattern
|
|
116
|
-
*/
|
|
117
|
-
declare const calculateDocumentDigest: (invoices: AllDocumentsV1_1[]) => string;
|
|
118
|
-
/**
|
|
119
|
-
* Step 4: Calculate Certificate Digest
|
|
120
|
-
* Enhanced to handle certificate content properly
|
|
121
|
-
* FIXED: Match PowerShell script exactly - use raw certificate data like $cert.RawData
|
|
122
|
-
*/
|
|
123
|
-
declare const calculateCertificateDigest: (certificatePem: string) => string;
|
|
124
|
-
/**
|
|
125
|
-
* Enhanced certificate info extraction with better error handling
|
|
126
|
-
* FIXED: Normalize issuer name format to match MyInvois expectations (DS326)
|
|
127
|
-
*/
|
|
128
|
-
declare const extractCertificateInfo: (certificatePem: string) => {
|
|
129
|
-
issuerName: string;
|
|
130
|
-
serialNumber: string;
|
|
131
|
-
subjectName: string;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Step 5: Create SignedProperties with enhanced structure
|
|
135
|
-
* FIXED: Simplified structure to match MyInvois expectations (DS320)
|
|
136
|
-
* Following MyInvois JSON signature specification exactly
|
|
137
|
-
*/
|
|
138
|
-
declare const createSignedProperties: (certificateDigest: string, signingTime: string, issuerName: string, serialNumber: string) => SignedPropertiesObject;
|
|
139
|
-
/**
|
|
140
|
-
* Step 6: Calculate SignedProperties Digest
|
|
141
|
-
* Calculates the digest over the correct structure for validator compliance.
|
|
142
|
-
* FIXED: Calculate digest from SignedProperties only (without Target wrapper)
|
|
143
|
-
*/
|
|
144
|
-
declare const calculateSignedPropertiesDigest: (signedProperties: SignedPropertiesObject, useTargetWrapper?: boolean) => string;
|
|
145
|
-
/**
|
|
146
|
-
* Step 3: Create SignedInfo and calculate signature
|
|
147
|
-
* Enhanced with better structure and signature generation
|
|
148
|
-
*/
|
|
149
|
-
declare const createSignedInfoAndSign: (docDigest: string, propsDigest: string, privateKeyPem: string) => {
|
|
150
|
-
signedInfo: SignedInfoObject;
|
|
151
|
-
signatureValue: string;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Signs the minified document string using the provided private key PEM
|
|
155
|
-
* Returns the signature as a base64 string
|
|
156
|
-
* FIXED: Match PowerShell script exactly - first compute hash, then sign the hash
|
|
157
|
-
*/
|
|
158
|
-
declare const signDocumentString: (documentString: string, privateKeyPem: string) => string;
|
|
159
|
-
/**
|
|
160
|
-
* Complete document generation with signatures
|
|
161
|
-
* Follows the complete MyInvois JSON signature creation process (Steps 1-7)
|
|
162
|
-
*/
|
|
163
|
-
declare const generateCompleteDocument: (invoices: AllDocumentsV1_1[], signingCredentials: SigningCredentials) => CompleteInvoice;
|
|
164
|
-
/**
|
|
165
|
-
* Creates a line item with percentage-based taxation (e.g., SST, GST)
|
|
166
|
-
*/
|
|
167
|
-
declare const createPercentageTaxLineItem: (params: {
|
|
168
|
-
itemClassificationCode: ClassificationCode;
|
|
169
|
-
itemDescription: string;
|
|
170
|
-
unitPrice: number;
|
|
171
|
-
quantity?: number;
|
|
172
|
-
measurement?: string;
|
|
173
|
-
taxType: TaxTypeCode;
|
|
174
|
-
taxRate: number;
|
|
175
|
-
totalTaxableAmountPerLine?: number;
|
|
176
|
-
discountAmount?: number;
|
|
177
|
-
discountRate?: number;
|
|
178
|
-
}) => InvoiceLineItem;
|
|
179
|
-
/**
|
|
180
|
-
* Creates a line item with fixed rate taxation (e.g., Tourism Tax)
|
|
181
|
-
*/
|
|
182
|
-
declare const createFixedRateTaxLineItem: (params: {
|
|
183
|
-
itemClassificationCode: ClassificationCode;
|
|
184
|
-
itemDescription: string;
|
|
185
|
-
unitPrice: number;
|
|
186
|
-
quantity?: number;
|
|
187
|
-
measurement?: string;
|
|
188
|
-
taxType: TaxTypeCode;
|
|
189
|
-
taxPerUnitAmount: number;
|
|
190
|
-
baseUnitMeasure: number;
|
|
191
|
-
baseUnitMeasureCode: UnitTypeCode;
|
|
192
|
-
totalTaxableAmountPerLine?: number;
|
|
193
|
-
discountAmount?: number;
|
|
194
|
-
discountRate?: number;
|
|
195
|
-
}) => InvoiceLineItem;
|
|
196
|
-
/**
|
|
197
|
-
* Calculates invoice totals from line items
|
|
198
|
-
*/
|
|
199
|
-
declare const calculateInvoiceTotals: (lineItems: InvoiceLineItem[], payableRoundingAmount?: number) => {
|
|
200
|
-
legalMonetaryTotal: {
|
|
201
|
-
taxExclusiveAmount: number;
|
|
202
|
-
taxInclusiveAmount: number;
|
|
203
|
-
payableRoundingAmount: number;
|
|
204
|
-
payableAmount: number;
|
|
205
|
-
};
|
|
206
|
-
taxTotal: {
|
|
207
|
-
taxAmount: number;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
//#endregion
|
|
1
|
+
import "../classification-codes-BQMnAQFr.js";
|
|
2
|
+
import "../country-code-DAejE5RV.js";
|
|
3
|
+
import "../currencies-Cg9RkxRB.js";
|
|
4
|
+
import "../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 "../msic-codes-kysVPGdN.js";
|
|
16
|
+
import "../tax-types-QeZFKqew.js";
|
|
17
|
+
import "../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 "../unit-types-CZdxXbVN.js";
|
|
54
|
+
import "../documents-BpZn3hJq.js";
|
|
55
|
+
import "../payment-modes-BGP5McTY.js";
|
|
56
|
+
import "../signatures-Bk5aKcq6.js";
|
|
57
|
+
import "../notifications-B4BymhRJ.js";
|
|
58
|
+
import "../taxpayer-B1CSMqNS.js";
|
|
59
|
+
import "../utils-BYVq373g.js";
|
|
60
|
+
import "../index-Dn3JIREW.js";
|
|
61
|
+
import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-CnamySca.js";
|
|
211
62
|
export { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing };
|
package/dist/utils/document.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../formatIdValue-qTxJqj9o.js";
|
|
2
|
-
import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-
|
|
2
|
+
import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-BC52NCdW.js";
|
|
3
3
|
|
|
4
4
|
export { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "../classification-codes-B15PbWxz.cjs";
|
|
2
|
+
import "../country-code-DPeNFMMi.cjs";
|
|
3
|
+
import "../currencies-S5g1gzBU.cjs";
|
|
4
|
+
import "../e-invoice-BuwtFnlI.cjs";
|
|
5
|
+
import "../0X-Cr3M7hci.cjs";
|
|
6
|
+
import "../1X-CWwmfCzo.cjs";
|
|
7
|
+
import "../2X-DNtkJ0tj.cjs";
|
|
8
|
+
import "../3X-BOxfatu3.cjs";
|
|
9
|
+
import "../4X-C7fzDWJ_.cjs";
|
|
10
|
+
import "../5X-CNAFsDm2.cjs";
|
|
11
|
+
import "../6X-uObUP4VG.cjs";
|
|
12
|
+
import "../7X-BifJnY24.cjs";
|
|
13
|
+
import "../8X-DioBXCJ0.cjs";
|
|
14
|
+
import "../9X-BjffnXuq.cjs";
|
|
15
|
+
import "../msic-codes-CIKdPqag.cjs";
|
|
16
|
+
import "../tax-types-fu5Q6dic.cjs";
|
|
17
|
+
import "../state-codes-u3ppueWo.cjs";
|
|
18
|
+
import "../1X-DYw2tURz.cjs";
|
|
19
|
+
import "../2X-CXtqiwRg.cjs";
|
|
20
|
+
import "../3X-Bk_fUIAk.cjs";
|
|
21
|
+
import "../4X-CK9rj5qd.cjs";
|
|
22
|
+
import "../5X-CpAvNxvd.cjs";
|
|
23
|
+
import "../6X-bXWr_7xY.cjs";
|
|
24
|
+
import "../7X-BJBOlWhV.cjs";
|
|
25
|
+
import "../8X-dshwiOxU.cjs";
|
|
26
|
+
import "../9X-9j2Djy4W.cjs";
|
|
27
|
+
import "../AX-CWCopjCC.cjs";
|
|
28
|
+
import "../BX-Cq7WdhD3.cjs";
|
|
29
|
+
import "../CX-DlcVZfxx.cjs";
|
|
30
|
+
import "../DX-DLdv-Nxj.cjs";
|
|
31
|
+
import "../EX-CIJv8-Lw.cjs";
|
|
32
|
+
import "../FX-DlDM_Zea.cjs";
|
|
33
|
+
import "../GX-BFGNX6Jy.cjs";
|
|
34
|
+
import "../HX-D7Y9qRSm.cjs";
|
|
35
|
+
import "../IX-DPTrbhgX.cjs";
|
|
36
|
+
import "../JX-D8JmtNpo.cjs";
|
|
37
|
+
import "../KX-B46KJZrH.cjs";
|
|
38
|
+
import "../LX-CfTKy8Sx.cjs";
|
|
39
|
+
import "../MX-BKJ4gNvV.cjs";
|
|
40
|
+
import "../NX-CSdLIFqU.cjs";
|
|
41
|
+
import "../OX-BwqOsulT.cjs";
|
|
42
|
+
import "../PX-BTx0TXsJ.cjs";
|
|
43
|
+
import "../QX-BUXR8RJL.cjs";
|
|
44
|
+
import "../RX-CZ8HiH37.cjs";
|
|
45
|
+
import "../SX-CLxsqiQk.cjs";
|
|
46
|
+
import "../TX-DKc8hLc4.cjs";
|
|
47
|
+
import "../UX-bc7xDnZI.cjs";
|
|
48
|
+
import "../VX-CIHTFyoC.cjs";
|
|
49
|
+
import "../WX-BHvlq7Jx.cjs";
|
|
50
|
+
import "../YX-CkxLeFb4.cjs";
|
|
51
|
+
import "../ZX-DVb_buNI.cjs";
|
|
52
|
+
import "../XX-DztQxYHJ.cjs";
|
|
53
|
+
import "../unit-types-BXdufGWm.cjs";
|
|
54
|
+
import "../documents-D_V38Q_U.cjs";
|
|
55
|
+
import "../payment-modes-7c1lWlIr.cjs";
|
|
56
|
+
import "../signatures-CyDSZr_e.cjs";
|
|
57
|
+
import "../notifications-DdlEkprb.cjs";
|
|
58
|
+
import "../taxpayer-DwGzY1IL.cjs";
|
|
59
|
+
import "../utils-Cdqbbzca.cjs";
|
|
60
|
+
import "../index-Yr1QAbIF.cjs";
|
|
61
|
+
import { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory } from "../lineItems-CBSo7giH.cjs";
|
|
62
|
+
export { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "../classification-codes-BQMnAQFr.js";
|
|
2
|
+
import "../country-code-DAejE5RV.js";
|
|
3
|
+
import "../currencies-Cg9RkxRB.js";
|
|
4
|
+
import "../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 "../msic-codes-kysVPGdN.js";
|
|
16
|
+
import "../tax-types-QeZFKqew.js";
|
|
17
|
+
import "../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 "../unit-types-CZdxXbVN.js";
|
|
54
|
+
import "../documents-BpZn3hJq.js";
|
|
55
|
+
import "../payment-modes-BGP5McTY.js";
|
|
56
|
+
import "../signatures-Bk5aKcq6.js";
|
|
57
|
+
import "../notifications-B4BymhRJ.js";
|
|
58
|
+
import "../taxpayer-B1CSMqNS.js";
|
|
59
|
+
import "../utils-BYVq373g.js";
|
|
60
|
+
import "../index-Dn3JIREW.js";
|
|
61
|
+
import { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory } from "../lineItems-CrkEXi2m.js";
|
|
62
|
+
export { AggregateByTaxCategoryOptions, aggregateLineItemsByTaxCategory };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
require('
|
|
3
|
-
const
|
|
4
|
-
const crypto = require_chunk.__toESM(require("crypto"));
|
|
1
|
+
const require_document = require('../document-B11B5lqd.cjs');
|
|
2
|
+
require('../formatIdValue-i67o4kyD.cjs');
|
|
3
|
+
const crypto = require_document.__toESM(require("crypto"));
|
|
5
4
|
|
|
6
5
|
//#region src/utils/signature-diagnostics.ts
|
|
7
6
|
/**
|
|
@@ -327,4 +326,4 @@ function printDiagnostics(result) {
|
|
|
327
326
|
//#endregion
|
|
328
327
|
exports.diagnoseSignatureIssues = diagnoseSignatureIssues;
|
|
329
328
|
exports.printDiagnostics = printDiagnostics;
|
|
330
|
-
//# sourceMappingURL=
|
|
329
|
+
//# sourceMappingURL=signature-diagnostics.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-diagnostics.cjs","names":["certificatePem: string","issues: string[]","recommendations: string[]","dn: string","fields: Record<string, string>","invoices: InvoiceV1_1[]","str: string","result: DiagnosticResult"],"sources":["../../src/utils/signature-diagnostics.ts"],"sourcesContent":["import crypto from 'crypto'\nimport type { InvoiceV1_1 } from '../types'\nimport {\n extractCertificateInfo,\n calculateDocumentDigest,\n calculateSignedPropertiesDigest,\n createSignedProperties,\n calculateCertificateDigest,\n} from './document'\n\nexport interface CertificateAnalysisResult {\n organizationIdentifier?: string\n serialNumber?: string\n issuerName: string\n subjectName: string\n issues: string[]\n recommendations: string[]\n}\n\nexport interface SignatureAnalysisResult {\n documentDigest: string\n certificateDigest: string\n signedPropertiesDigest: string\n issues: string[]\n recommendations: string[]\n}\n\nexport interface DiagnosticResult {\n certificateAnalysis: CertificateAnalysisResult\n signatureAnalysis: SignatureAnalysisResult\n summary: {\n totalIssues: number\n certificateIssues: number\n signatureIssues: number\n }\n}\n\n/**\n * Analyzes certificate for MyInvois compatibility issues\n */\nfunction analyzeCertificateForDiagnostics(\n certificatePem: string,\n): CertificateAnalysisResult {\n const issues: string[] = []\n const recommendations: string[] = []\n\n try {\n const cert = new crypto.X509Certificate(certificatePem)\n const certInfo = extractCertificateInfo(certificatePem)\n\n // Parse subject fields for MyInvois analysis\n const parseSubjectFields = (dn: string) => {\n const fields: Record<string, string> = {}\n dn.split('\\n').forEach(line => {\n const trimmed = line.trim()\n if (trimmed.includes('=')) {\n const [key, ...valueParts] = trimmed.split('=')\n if (key) {\n fields[key.trim()] = valueParts.join('=').trim()\n }\n }\n })\n return fields\n }\n\n const subjectFields = parseSubjectFields(cert.subject)\n const organizationIdentifier =\n subjectFields['organizationIdentifier'] || subjectFields['2.5.4.97']\n const serialNumber = subjectFields['serialNumber']\n\n // DS311 - TIN Mismatch Analysis\n if (!organizationIdentifier) {\n issues.push(\n 'DS311: Certificate missing organizationIdentifier field (TIN)',\n )\n recommendations.push(\n 'CRITICAL: Generate new certificate with organizationIdentifier matching your MyInvois TIN',\n )\n recommendations.push(\n 'Portal Error: \"Signer of invoice doesn\\'t match the submitter of document. TIN doesn\\'t match with the OI.\"',\n )\n } else {\n // Additional TIN format validation\n if (organizationIdentifier.length < 10) {\n issues.push(\n 'DS311: OrganizationIdentifier (TIN) appears too short - may cause submission rejection',\n )\n recommendations.push(\n 'Verify TIN format matches exactly what is registered in MyInvois',\n )\n }\n }\n\n // DS312 - Registration Number Analysis\n if (!serialNumber) {\n issues.push(\n 'DS312: Certificate missing serialNumber field (business registration)',\n )\n recommendations.push(\n 'CRITICAL: Generate new certificate with serialNumber matching your business registration',\n )\n recommendations.push(\n 'Portal Error: \"Submitter registration/identity number doesn\\'t match with the certificate SERIALNUMBER.\"',\n )\n }\n\n // DS329 - Certificate Trust Analysis\n if (cert.issuer === cert.subject) {\n issues.push(\n 'DS329: Self-signed certificate detected - will fail chain of trust validation',\n )\n recommendations.push(\n 'BLOCKING: Obtain certificate from MyInvois-approved CA:',\n )\n recommendations.push('• MSC Trustgate Sdn Bhd')\n recommendations.push('• DigiCert Sdn Bhd')\n recommendations.push('• Cybersign Asia Sdn Bhd')\n recommendations.push(\n 'Portal Error: \"Certificate is not valid according to the chain of trust validation or has been issued by an untrusted certificate authority.\"',\n )\n } else {\n // Check if issuer looks like a known CA\n const issuerName = cert.issuer.toLowerCase()\n const approvedCAs = ['msc trustgate', 'digicert', 'cybersign']\n const isFromApprovedCA = approvedCAs.some(ca => issuerName.includes(ca))\n\n if (!isFromApprovedCA) {\n issues.push('DS329: Certificate may not be from MyInvois-approved CA')\n recommendations.push(\n 'Verify certificate was issued by an approved CA for MyInvois',\n )\n }\n }\n\n // DS326 - Issuer Name Format Analysis (Enhanced)\n const rawIssuer = cert.issuer\n const normalizedIssuer = certInfo.issuerName\n\n // Check for issues in the NORMALIZED issuer (these are actual problems)\n const normalizedIssuerIssues = [\n {\n check: normalizedIssuer.includes('\\n'),\n issue: 'Normalized issuer still contains newlines',\n },\n {\n check: normalizedIssuer.includes(' '),\n issue: 'Normalized issuer contains double spaces',\n },\n {\n check: /=\\s+/.test(normalizedIssuer),\n issue: 'Normalized issuer has spaces after equals',\n },\n {\n check: /\\s+=/.test(normalizedIssuer),\n issue: 'Normalized issuer has spaces before equals',\n },\n {\n check: normalizedIssuer.includes('\\r'),\n issue: 'Normalized issuer contains carriage returns',\n },\n ]\n\n // Only report actual issues in the normalized version that will cause portal errors\n const hasActualFormatIssues = normalizedIssuerIssues.some(\n ({ check, issue }) => {\n if (check) {\n issues.push(`DS326: ${issue} - will cause X509IssuerName mismatch`)\n return true\n }\n return false\n },\n )\n\n // Check if raw issuer has issues but normalized version is OK (informational)\n const hasRawIssuesButNormalizedOk =\n rawIssuer.includes('\\n') && !normalizedIssuer.includes('\\n')\n\n if (hasActualFormatIssues) {\n recommendations.push(\n 'CRITICAL: Fix issuer name normalization in signature generation',\n )\n recommendations.push(\n 'Portal Error: \"Certificate X509IssuerName doesn\\'t match the X509IssuerName value provided in the signed properties section.\"',\n )\n recommendations.push(\n 'The normalization function is not properly formatting the issuer name',\n )\n recommendations.push(\n 'Debug: Check document.ts extractCertificateInfo() normalization logic',\n )\n } else if (hasRawIssuesButNormalizedOk) {\n // This is informational - normalization is working correctly\n console.log(\n 'ℹ️ Note: Raw certificate issuer has newlines but normalization is handling them correctly',\n )\n }\n\n // Additional certificate validity checks\n const now = new Date()\n const validFrom = new Date(cert.validFrom)\n const validTo = new Date(cert.validTo)\n\n if (now < validFrom) {\n issues.push('DS329: Certificate not yet valid (future start date)')\n recommendations.push('Wait until certificate validity period begins')\n }\n\n if (now > validTo) {\n issues.push('DS329: Certificate has expired')\n recommendations.push(\n 'BLOCKING: Renew certificate - expired certificates are rejected',\n )\n }\n\n // Check certificate key usage (if available)\n try {\n if (cert.keyUsage && !cert.keyUsage.includes('digital signature')) {\n issues.push('DS333: Certificate lacks digitalSignature key usage')\n recommendations.push(\n 'Generate new certificate with digitalSignature key usage enabled',\n )\n }\n } catch {\n // Key usage might not be available in all certificates\n console.log('Note: Could not check key usage extensions')\n }\n\n return {\n organizationIdentifier,\n serialNumber,\n issuerName: certInfo.issuerName,\n subjectName: certInfo.subjectName,\n issues,\n recommendations,\n }\n } catch (error) {\n issues.push(`Certificate parsing failed: ${error}`)\n recommendations.push('Verify certificate format and validity')\n\n return {\n issuerName: '',\n subjectName: '',\n issues,\n recommendations,\n }\n }\n}\n\n/**\n * Analyzes signature generation for potential issues\n */\nfunction analyzeSignatureForDiagnostics(\n invoices: InvoiceV1_1[],\n certificatePem: string,\n): SignatureAnalysisResult {\n const issues: string[] = []\n const recommendations: string[] = []\n\n try {\n // Step 1: Document digest\n const documentDigest = calculateDocumentDigest(invoices)\n\n // Step 2: Certificate digest\n const certificateDigest = calculateCertificateDigest(certificatePem)\n\n // Step 3: Extract certificate info\n const certInfo = extractCertificateInfo(certificatePem)\n const signingTime = new Date().toISOString()\n\n // Step 4: Create signed properties\n const signedProperties = createSignedProperties(\n certificateDigest,\n signingTime,\n certInfo.issuerName,\n certInfo.serialNumber,\n )\n\n // Step 5: Signed properties digest\n const signedPropertiesDigest =\n calculateSignedPropertiesDigest(signedProperties)\n\n // DS333 - Document Signature Validation\n if (documentDigest.length === 0) {\n issues.push('DS333: Document digest generation failed')\n recommendations.push(\n 'CRITICAL: Verify document serialization excludes UBLExtensions/Signature',\n )\n recommendations.push(\n 'Portal Error: \"Document signature value is not a valid signature of the document digest using the public key of the certificate provided.\"',\n )\n }\n\n if (certificateDigest.length === 0) {\n issues.push('DS333: Certificate digest generation failed')\n recommendations.push('CRITICAL: Verify certificate format and encoding')\n recommendations.push(\n 'Certificate must be properly base64 encoded without headers/footers',\n )\n }\n\n if (signedPropertiesDigest.length === 0) {\n issues.push('DS333: Signed properties digest generation failed')\n recommendations.push(\n 'CRITICAL: Verify signed properties structure and canonicalization',\n )\n recommendations.push(\n 'Check XML canonicalization (C14N) is applied correctly',\n )\n }\n\n // Additional DS333 checks\n try {\n const cert = new crypto.X509Certificate(certificatePem)\n\n // Verify the certificate has the required algorithms for MyInvois\n const publicKey = cert.publicKey\n const keyDetails = publicKey.asymmetricKeyDetails\n\n if (keyDetails) {\n // Check if key size is adequate for RSA (minimum 2048 bits)\n if (\n publicKey.asymmetricKeyType === 'rsa' &&\n keyDetails.modulusLength &&\n keyDetails.modulusLength < 2048\n ) {\n issues.push(\n 'DS333: RSA key size too small (minimum 2048 bits required)',\n )\n recommendations.push(\n 'CRITICAL: Generate new certificate with RSA 2048+ bits',\n )\n }\n\n // Check supported key types\n const supportedKeyTypes = ['rsa', 'ec']\n if (!supportedKeyTypes.includes(publicKey.asymmetricKeyType || '')) {\n issues.push(\n `DS333: Unsupported key type: ${publicKey.asymmetricKeyType}`,\n )\n recommendations.push(\n 'CRITICAL: Use RSA or EC key types for MyInvois compatibility',\n )\n }\n }\n\n // Test certificate format validity\n const certBuffer = Buffer.from(\n certificatePem.replace(/-----[^-]+-----/g, '').replace(/\\s/g, ''),\n 'base64',\n )\n if (certBuffer.length === 0) {\n issues.push('DS333: Certificate encoding appears invalid')\n recommendations.push(\n 'CRITICAL: Verify certificate is properly PEM encoded',\n )\n }\n } catch (error) {\n issues.push(`DS333: Certificate validation failed - ${error}`)\n recommendations.push(\n 'CRITICAL: Verify certificate format and structure are valid',\n )\n }\n\n // Validate digest formats (should be base64)\n const isValidBase64 = (str: string) => {\n try {\n return Buffer.from(str, 'base64').toString('base64') === str\n } catch {\n return false\n }\n }\n\n if (documentDigest && !isValidBase64(documentDigest)) {\n issues.push('DS333: Document digest is not valid base64 format')\n recommendations.push('Ensure digest is properly base64 encoded')\n }\n\n if (certificateDigest && !isValidBase64(certificateDigest)) {\n issues.push('DS333: Certificate digest is not valid base64 format')\n recommendations.push(\n 'Ensure certificate digest is properly base64 encoded',\n )\n }\n\n if (signedPropertiesDigest && !isValidBase64(signedPropertiesDigest)) {\n issues.push('DS333: Signed properties digest is not valid base64 format')\n recommendations.push(\n 'Ensure signed properties digest is properly base64 encoded',\n )\n }\n\n return {\n documentDigest,\n certificateDigest,\n signedPropertiesDigest,\n issues,\n recommendations,\n }\n } catch (error) {\n issues.push(`Signature analysis failed: ${error}`)\n recommendations.push('Review signature generation implementation')\n\n return {\n documentDigest: '',\n certificateDigest: '',\n signedPropertiesDigest: '',\n issues,\n recommendations,\n }\n }\n}\n\n/**\n * Comprehensive signature diagnostics\n */\nexport function diagnoseSignatureIssues(\n invoices: InvoiceV1_1[],\n certificatePem: string,\n): DiagnosticResult {\n const certificateAnalysis = analyzeCertificateForDiagnostics(certificatePem)\n const signatureAnalysis = analyzeSignatureForDiagnostics(\n invoices,\n certificatePem,\n )\n\n const certificateIssues = certificateAnalysis.issues.length\n const signatureIssues = signatureAnalysis.issues.length\n\n return {\n certificateAnalysis,\n signatureAnalysis,\n summary: {\n totalIssues: certificateIssues + signatureIssues,\n certificateIssues,\n signatureIssues,\n },\n }\n}\n\n/**\n * Prints diagnostic results in a formatted way\n */\nexport function printDiagnostics(result: DiagnosticResult): void {\n console.log('\\n🔍 MyInvois Signature Diagnostics Report')\n console.log('='.repeat(60))\n\n // Certificate Analysis\n console.log('\\n📜 CERTIFICATE ANALYSIS')\n console.log('-'.repeat(30))\n\n console.log(` Issuer: ${result.certificateAnalysis.issuerName}`)\n console.log(` Subject: ${result.certificateAnalysis.subjectName}`)\n\n if (result.certificateAnalysis.organizationIdentifier) {\n console.log(\n ` Organization ID (TIN): ${result.certificateAnalysis.organizationIdentifier}`,\n )\n }\n\n if (result.certificateAnalysis.serialNumber) {\n console.log(` Serial Number: ${result.certificateAnalysis.serialNumber}`)\n }\n\n if (result.certificateAnalysis.issues.length > 0) {\n console.log('\\n 🚨 Certificate Issues:')\n result.certificateAnalysis.issues.forEach((issue, index) => {\n console.log(` ${index + 1}. ${issue}`)\n })\n }\n\n if (result.certificateAnalysis.recommendations.length > 0) {\n console.log('\\n 💡 Certificate Recommendations:')\n result.certificateAnalysis.recommendations.forEach((rec, index) => {\n console.log(` ${index + 1}. ${rec}`)\n })\n }\n\n // Signature Analysis\n console.log('\\n🔐 SIGNATURE ANALYSIS')\n console.log('-'.repeat(30))\n\n console.log(\n ` Document Digest: ${result.signatureAnalysis.documentDigest.substring(0, 32)}...`,\n )\n console.log(\n ` Certificate Digest: ${result.signatureAnalysis.certificateDigest.substring(0, 32)}...`,\n )\n console.log(\n ` Signed Properties Digest: ${result.signatureAnalysis.signedPropertiesDigest.substring(0, 32)}...`,\n )\n\n if (result.signatureAnalysis.issues.length > 0) {\n console.log('\\n 🚨 Signature Issues:')\n result.signatureAnalysis.issues.forEach((issue, index) => {\n console.log(` ${index + 1}. ${issue}`)\n })\n }\n\n if (result.signatureAnalysis.recommendations.length > 0) {\n console.log('\\n 💡 Signature Recommendations:')\n result.signatureAnalysis.recommendations.forEach((rec, index) => {\n console.log(` ${index + 1}. ${rec}`)\n })\n }\n\n // Summary\n console.log('\\n📊 SUMMARY')\n console.log('-'.repeat(30))\n console.log(` Total Issues Found: ${result.summary.totalIssues}`)\n console.log(` Certificate Issues: ${result.summary.certificateIssues}`)\n console.log(` Signature Issues: ${result.summary.signatureIssues}`)\n\n if (result.summary.totalIssues === 0) {\n console.log('\\n ✅ No issues detected in current analysis')\n console.log(' 🎉 Certificate and signature implementation appear valid')\n } else {\n console.log('\\n ⚠️ Issues detected - review recommendations above')\n\n // Check for specific portal errors\n const hasDS311 = result.certificateAnalysis.issues.some(issue =>\n issue.includes('DS311'),\n )\n const hasDS312 = result.certificateAnalysis.issues.some(issue =>\n issue.includes('DS312'),\n )\n const hasDS326 = result.certificateAnalysis.issues.some(issue =>\n issue.includes('DS326'),\n )\n const hasDS329 = result.certificateAnalysis.issues.some(issue =>\n issue.includes('DS329'),\n )\n const hasDS333 = result.signatureAnalysis.issues.some(issue =>\n issue.includes('DS333'),\n )\n\n console.log('\\n 🎯 MYINVOIS PORTAL ERROR ANALYSIS:')\n\n if (hasDS311) {\n console.log(\n ' ❌ DS311 - TIN mismatch between certificate and submitter',\n )\n }\n\n if (hasDS312) {\n console.log(\n ' ❌ DS312 - Registration number mismatch with certificate',\n )\n }\n\n if (hasDS326) {\n console.log(' ❌ DS326 - X509IssuerName format inconsistency')\n }\n\n if (hasDS329) {\n console.log(' ❌ DS329 - Certificate trust chain validation failure')\n }\n\n if (hasDS333) {\n console.log(' ❌ DS333 - Document signature validation failure')\n }\n\n if (result.summary.certificateIssues > 0) {\n console.log('\\n 🚨 PRIMARY ACTION REQUIRED:')\n console.log(' Certificate issues must be resolved first')\n console.log(\n ' Self-generated certificates cannot pass MyInvois validation',\n )\n }\n\n if (result.summary.signatureIssues > 0) {\n console.log('\\n ⚙️ SECONDARY ACTION:')\n console.log(' Review and optimize signature implementation')\n }\n\n console.log('\\n 📋 NEXT STEPS:')\n console.log(' 1. Address BLOCKING/CRITICAL issues first')\n console.log(' 2. Test with updated certificate/implementation')\n console.log(' 3. Re-run diagnostics to verify fixes')\n console.log(' 4. Submit test document to MyInvois portal')\n }\n\n console.log('\\n' + '='.repeat(60))\n}\n"],"mappings":";;;;;;;;AAwCA,SAAS,iCACPA,gBAC2B;CAC3B,MAAMC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