@ripwords/myinvois-client 0.1.7 → 0.2.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.
Files changed (322) hide show
  1. package/dist/api/documentManagement.d.ts +89 -0
  2. package/dist/api/documentManagement.js +3 -0
  3. package/dist/api/documentSubmission.d.ts +92 -0
  4. package/dist/api/documentSubmission.js +4 -0
  5. package/dist/api/documentTypeManagement.d.ts +70 -0
  6. package/dist/api/documentTypeManagement.js +3 -0
  7. package/dist/api/notificationManagement.d.ts +68 -0
  8. package/dist/api/notificationManagement.js +3 -0
  9. package/dist/api/platformLogin.d.ts +68 -0
  10. package/dist/api/platformLogin.js +3 -0
  11. package/dist/api/taxpayerValidation.d.ts +79 -0
  12. package/dist/api/taxpayerValidation.js +3 -0
  13. package/dist/{certificate-DFK-788s.cjs → certificate-CxsfE91s.cjs} +1 -1
  14. package/dist/{certificate-DFK-788s.cjs.map → certificate-CxsfE91s.cjs.map} +1 -1
  15. package/dist/{document-CARHiGdp.cjs → document-vDphtJTv.cjs} +1 -1
  16. package/dist/{document-CARHiGdp.cjs.map → document-vDphtJTv.cjs.map} +1 -1
  17. package/dist/documentManagement-CIQPkmyb.js +35 -0
  18. package/dist/documentManagement-DQ7JEcBq.cjs +54 -0
  19. package/dist/documentManagement-DQ7JEcBq.cjs.map +1 -0
  20. package/dist/documentSubmission-BdJxIB_I.js +119 -0
  21. package/dist/documentSubmission-D5TC0MPC.cjs +137 -0
  22. package/dist/documentSubmission-D5TC0MPC.cjs.map +1 -0
  23. package/dist/documentTypeManagement-DXRLfTsW.cjs +41 -0
  24. package/dist/documentTypeManagement-DXRLfTsW.cjs.map +1 -0
  25. package/dist/documentTypeManagement-tojgXfm9.js +22 -0
  26. package/dist/{documents-i5EV868Y.d.ts → documents-BgXt86Qp.d.ts} +44 -7
  27. package/dist/{documents-CQy_uB6C.d.cts → documents-BqM9qOnB.d.cts} +39 -2
  28. package/dist/{getBaseUrl-CO7Jp27d.cjs → getBaseUrl-D2iJdUGL.cjs} +1 -1
  29. package/dist/{getBaseUrl-CO7Jp27d.cjs.map → getBaseUrl-D2iJdUGL.cjs.map} +1 -1
  30. package/dist/{index-D2_HVwCz.d.cts → index-Yr1QAbIF.d.cts} +1 -1
  31. package/dist/index.cjs +234 -131
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +250 -60
  34. package/dist/index.js +234 -131
  35. package/dist/index10.cjs +25 -0
  36. package/dist/index10.cjs.map +1 -0
  37. package/dist/index11.cjs +0 -34
  38. package/dist/index12.cjs +25 -15
  39. package/dist/index12.cjs.map +1 -1
  40. package/dist/index13.cjs +24 -0
  41. package/dist/index13.cjs.map +1 -0
  42. package/dist/index14.cjs +0 -13
  43. package/dist/index15.cjs +0 -4
  44. package/dist/index16.cjs +0 -13
  45. package/dist/index17.cjs +4 -2
  46. package/dist/index18.cjs +5 -339
  47. package/dist/index19.cjs +4 -328
  48. package/dist/index20.cjs +2 -139
  49. package/dist/index21.cjs +1 -1
  50. package/dist/index22.cjs +4 -207
  51. package/dist/index23.cjs +9 -105
  52. package/dist/index23.cjs.map +1 -1
  53. package/dist/index24.cjs +3 -136
  54. package/dist/index25.cjs +12 -63
  55. package/dist/index26.cjs +2 -266
  56. package/dist/index27.cjs +325 -75
  57. package/dist/index27.cjs.map +1 -1
  58. package/dist/index28.cjs +136 -103
  59. package/dist/index28.cjs.map +1 -1
  60. package/dist/index29.cjs +203 -68
  61. package/dist/index29.cjs.map +1 -1
  62. package/dist/index30.cjs +104 -107
  63. package/dist/index30.cjs.map +1 -1
  64. package/dist/index31.cjs +132 -95
  65. package/dist/index31.cjs.map +1 -1
  66. package/dist/index32.cjs +59 -13
  67. package/dist/index32.cjs.map +1 -1
  68. package/dist/index33.cjs +262 -33
  69. package/dist/index33.cjs.map +1 -1
  70. package/dist/index34.cjs +74 -14
  71. package/dist/index34.cjs.map +1 -1
  72. package/dist/index35.cjs +102 -24
  73. package/dist/index35.cjs.map +1 -1
  74. package/dist/index36.cjs +68 -15
  75. package/dist/index36.cjs.map +1 -1
  76. package/dist/index37.cjs +107 -9
  77. package/dist/index37.cjs.map +1 -1
  78. package/dist/index38.cjs +95 -9
  79. package/dist/index38.cjs.map +1 -1
  80. package/dist/index39.cjs +11 -10
  81. package/dist/index39.cjs.map +1 -1
  82. package/dist/index40.cjs +31 -6
  83. package/dist/index40.cjs.map +1 -1
  84. package/dist/index41.cjs +12 -101
  85. package/dist/index41.cjs.map +1 -1
  86. package/dist/index42.cjs +22 -106
  87. package/dist/index42.cjs.map +1 -1
  88. package/dist/index43.cjs +13 -119
  89. package/dist/index43.cjs.map +1 -1
  90. package/dist/index44.cjs +7 -106
  91. package/dist/index44.cjs.map +1 -1
  92. package/dist/index45.cjs +7 -98
  93. package/dist/index45.cjs.map +1 -1
  94. package/dist/index46.cjs +10 -118
  95. package/dist/index46.cjs.map +1 -1
  96. package/dist/index47.cjs +6 -127
  97. package/dist/index47.cjs.map +1 -1
  98. package/dist/index48.cjs +101 -117
  99. package/dist/index48.cjs.map +1 -1
  100. package/dist/index49.cjs +106 -14
  101. package/dist/index49.cjs.map +1 -1
  102. package/dist/index50.cjs +119 -95
  103. package/dist/index50.cjs.map +1 -1
  104. package/dist/index51.cjs +106 -142
  105. package/dist/index51.cjs.map +1 -1
  106. package/dist/index52.cjs +98 -114
  107. package/dist/index52.cjs.map +1 -1
  108. package/dist/index53.cjs +118 -144
  109. package/dist/index53.cjs.map +1 -1
  110. package/dist/index54.cjs +127 -113
  111. package/dist/index54.cjs.map +1 -1
  112. package/dist/index55.cjs +117 -17
  113. package/dist/index55.cjs.map +1 -1
  114. package/dist/index56.cjs +14 -112
  115. package/dist/index56.cjs.map +1 -1
  116. package/dist/index57.cjs +95 -47
  117. package/dist/index57.cjs.map +1 -1
  118. package/dist/index58.cjs +142 -14
  119. package/dist/index58.cjs.map +1 -1
  120. package/dist/index59.cjs +114 -28
  121. package/dist/index59.cjs.map +1 -1
  122. package/dist/index60.cjs +144 -22
  123. package/dist/index60.cjs.map +1 -1
  124. package/dist/index61.cjs +113 -9
  125. package/dist/index61.cjs.map +1 -1
  126. package/dist/index61.cts.map +1 -1
  127. package/dist/index62.cjs +17 -8
  128. package/dist/index62.cjs.map +1 -1
  129. package/dist/index62.cts.map +1 -1
  130. package/dist/index63.cjs +112 -17
  131. package/dist/index63.cjs.map +1 -1
  132. package/dist/index63.cts.map +1 -1
  133. package/dist/index64.cjs +47 -412
  134. package/dist/index64.cjs.map +1 -1
  135. package/dist/index64.cts.map +1 -1
  136. package/dist/index65.cjs +14 -8
  137. package/dist/index65.cjs.map +1 -1
  138. package/dist/index65.cts.map +1 -1
  139. package/dist/index66.cjs +28 -9
  140. package/dist/index66.cjs.map +1 -1
  141. package/dist/index66.cts.map +1 -1
  142. package/dist/index67.cjs +29 -0
  143. package/dist/index67.cjs.map +1 -0
  144. package/dist/index67.cts.map +1 -0
  145. package/dist/index68.cjs +16 -0
  146. package/dist/index68.cjs.map +1 -0
  147. package/dist/{index60.cts.map → index68.cts.map} +1 -1
  148. package/dist/index69.cjs +15 -0
  149. package/dist/index69.cjs.map +1 -0
  150. package/dist/index69.cts.map +1 -0
  151. package/dist/index70.cjs +24 -0
  152. package/dist/index70.cjs.map +1 -0
  153. package/dist/index70.cts.map +1 -0
  154. package/dist/index71.cjs +419 -0
  155. package/dist/index71.cjs.map +1 -0
  156. package/dist/index71.cts.map +1 -0
  157. package/dist/index72.cjs +15 -0
  158. package/dist/index72.cjs.map +1 -0
  159. package/dist/index72.cts.map +1 -0
  160. package/dist/index73.cjs +16 -0
  161. package/dist/index73.cjs.map +1 -0
  162. package/dist/index73.cts.map +1 -0
  163. package/dist/index9.cjs +24 -20
  164. package/dist/index9.cjs.map +1 -1
  165. package/dist/{msic-codes-C8PJVOaA.d.ts → msic-codes-CiPeemFK.d.ts} +10 -10
  166. package/dist/notificationManagement-CHDRVy8J.js +19 -0
  167. package/dist/notificationManagement-C_qrFwWL.cjs +26 -0
  168. package/dist/notificationManagement-C_qrFwWL.cjs.map +1 -0
  169. package/dist/notifications-B4l_qRj7.d.ts +62 -0
  170. package/dist/notifications-DdlEkprb.d.cts +63 -0
  171. package/dist/{platformLogin-PGzMhw1X.cjs → platformLogin-CPiPiVUh.cjs} +2 -2
  172. package/dist/platformLogin-CPiPiVUh.cjs.map +1 -0
  173. package/dist/{platformLogin-f0bNAoZI.js → platformLogin-Ck1Fge2n.js} +1 -1
  174. package/dist/taxpayer-D67d2zAC.d.ts +26 -0
  175. package/dist/taxpayer-sGkviG8J.d.cts +27 -0
  176. package/dist/taxpayerValidation-DI4B6kWx.js +54 -0
  177. package/dist/taxpayerValidation-DdeXCvPT.cjs +73 -0
  178. package/dist/taxpayerValidation-DdeXCvPT.cjs.map +1 -0
  179. package/dist/types/classification-codes.d.ts +1 -1
  180. package/dist/types/country-code.d.ts +1 -1
  181. package/dist/types/currencies.d.ts +1 -1
  182. package/dist/types/documents.d.ts +18 -18
  183. package/dist/types/e-invoice.d.ts +1 -1
  184. package/dist/types/index.d.ts +61 -58
  185. package/dist/types/msic/0X.d.ts +1 -1
  186. package/dist/types/msic/1X.d.ts +1 -1
  187. package/dist/types/msic/2X.d.ts +1 -1
  188. package/dist/types/msic/3X.d.ts +1 -1
  189. package/dist/types/msic/4X.d.ts +1 -1
  190. package/dist/types/msic/5X.d.ts +1 -1
  191. package/dist/types/msic/6X.d.ts +1 -1
  192. package/dist/types/msic/7X.d.ts +1 -1
  193. package/dist/types/msic/8X.d.ts +1 -1
  194. package/dist/types/msic/9X.d.ts +1 -1
  195. package/dist/types/msic-codes.d.ts +11 -11
  196. package/dist/types/notifications.d.ts +2 -0
  197. package/dist/types/payment-modes.d.ts +1 -1
  198. package/dist/types/signatures.d.ts +1 -1
  199. package/dist/types/state-codes.d.ts +1 -1
  200. package/dist/types/tax-types.d.ts +1 -1
  201. package/dist/types/taxpayer.d.ts +19 -0
  202. package/dist/types/unit/1X.d.ts +1 -1
  203. package/dist/types/unit/2X.d.ts +1 -1
  204. package/dist/types/unit/3X.d.ts +1 -1
  205. package/dist/types/unit/4X.d.ts +1 -1
  206. package/dist/types/unit/5X.d.ts +1 -1
  207. package/dist/types/unit/6X.d.ts +1 -1
  208. package/dist/types/unit/7X.d.ts +1 -1
  209. package/dist/types/unit/8X.d.ts +1 -1
  210. package/dist/types/unit/9X.d.ts +1 -1
  211. package/dist/types/unit/AX.d.ts +1 -1
  212. package/dist/types/unit/BX.d.ts +1 -1
  213. package/dist/types/unit/CX.d.ts +1 -1
  214. package/dist/types/unit/DX.d.ts +1 -1
  215. package/dist/types/unit/EX.d.ts +1 -1
  216. package/dist/types/unit/FX.d.ts +1 -1
  217. package/dist/types/unit/GX.d.ts +1 -1
  218. package/dist/types/unit/HX.d.ts +1 -1
  219. package/dist/types/unit/IX.d.ts +1 -1
  220. package/dist/types/unit/JX.d.ts +1 -1
  221. package/dist/types/unit/KX.d.ts +1 -1
  222. package/dist/types/unit/LX.d.ts +1 -1
  223. package/dist/types/unit/MX.d.ts +1 -1
  224. package/dist/types/unit/NX.d.ts +1 -1
  225. package/dist/types/unit/OX.d.ts +1 -1
  226. package/dist/types/unit/PX.d.ts +1 -1
  227. package/dist/types/unit/QX.d.ts +1 -1
  228. package/dist/types/unit/RX.d.ts +1 -1
  229. package/dist/types/unit/SX.d.ts +1 -1
  230. package/dist/types/unit/TX.d.ts +1 -1
  231. package/dist/types/unit/UX.d.ts +1 -1
  232. package/dist/types/unit/VX.d.ts +1 -1
  233. package/dist/types/unit/WX.d.ts +1 -1
  234. package/dist/types/unit/XX.d.ts +1 -1
  235. package/dist/types/unit/YX.d.ts +1 -1
  236. package/dist/types/unit/ZX.d.ts +1 -1
  237. package/dist/types/unit-types.d.ts +36 -36
  238. package/dist/types/utils.d.ts +2 -0
  239. package/dist/unit-types-VgYXIwTT.d.ts +55 -0
  240. package/dist/utils/certificate.js +1 -1
  241. package/dist/utils/document.d.ts +60 -57
  242. package/dist/utils/document.js +1 -1
  243. package/dist/utils/getBaseUrl.js +1 -1
  244. package/dist/utils/signature-diagnostics.d.ts +60 -57
  245. package/dist/utils/signature-diagnostics.js +1 -1
  246. package/dist/utils-B3mo51Zp.d.ts +4 -0
  247. package/dist/utils-Cdqbbzca.d.cts +5 -0
  248. package/package.json +1 -1
  249. package/dist/api/platform/platformLogin.d.ts +0 -65
  250. package/dist/api/platform/platformLogin.js +0 -3
  251. package/dist/index11.cjs.map +0 -1
  252. package/dist/index14.cjs.map +0 -1
  253. package/dist/index18.cjs.map +0 -1
  254. package/dist/index19.cjs.map +0 -1
  255. package/dist/index20.cjs.map +0 -1
  256. package/dist/index22.cjs.map +0 -1
  257. package/dist/index24.cjs.map +0 -1
  258. package/dist/index25.cjs.map +0 -1
  259. package/dist/index26.cjs.map +0 -1
  260. package/dist/index58.cts.map +0 -1
  261. package/dist/index59.cts.map +0 -1
  262. package/dist/platformLogin-PGzMhw1X.cjs.map +0 -1
  263. package/dist/unit-types-B41YFOLT.d.ts +0 -55
  264. package/dist/utils/helpers.d.ts +0 -271
  265. package/dist/utils/helpers.js +0 -330
  266. /package/dist/{0X-CTIq3y3a.d.ts → 0X-DZnB0al0.d.ts} +0 -0
  267. /package/dist/{1X-BywXCqtn.d.ts → 1X-C72Wa4pk.d.ts} +0 -0
  268. /package/dist/{1X-Bu4oiv8D.d.ts → 1X-Dg5J6Bfg.d.ts} +0 -0
  269. /package/dist/{2X-3fSEGIuE.d.ts → 2X-CH89y3Af.d.ts} +0 -0
  270. /package/dist/{2X-DnG3FY1f.d.ts → 2X-D_qwTeDT.d.ts} +0 -0
  271. /package/dist/{3X-CLdmoel1.d.ts → 3X-BJHYxgxa.d.ts} +0 -0
  272. /package/dist/{3X-Ynjfgoll.d.ts → 3X-DryrwYRf.d.ts} +0 -0
  273. /package/dist/{4X-B5ePdMky.d.ts → 4X-BPMLRoDv.d.ts} +0 -0
  274. /package/dist/{4X-BTG6o1Gn.d.ts → 4X-BbZgoRHO.d.ts} +0 -0
  275. /package/dist/{5X-dhP6fyou.d.ts → 5X-Bv7M6KyG.d.ts} +0 -0
  276. /package/dist/{5X-CjSz1zxJ.d.ts → 5X-oQRBnO0f.d.ts} +0 -0
  277. /package/dist/{6X-B9KP_vEn.d.ts → 6X-B9I2XJa4.d.ts} +0 -0
  278. /package/dist/{6X-BHaY0TCf.d.ts → 6X-ZeZ8OB57.d.ts} +0 -0
  279. /package/dist/{7X-DtkQutx2.d.ts → 7X-Ckv9bbzG.d.ts} +0 -0
  280. /package/dist/{7X-C4eX_tAk.d.ts → 7X-Dvw2Z2VN.d.ts} +0 -0
  281. /package/dist/{8X-D6HTLShY.d.ts → 8X-BkgoX8dg.d.ts} +0 -0
  282. /package/dist/{8X-5n9seY3z.d.ts → 8X-C37BJTl6.d.ts} +0 -0
  283. /package/dist/{9X-CHZKsIdD.d.ts → 9X-Du0e44cq.d.ts} +0 -0
  284. /package/dist/{9X-Cpb6V4JC.d.ts → 9X-_XRgT2-_.d.ts} +0 -0
  285. /package/dist/{AX-C0w_r3PA.d.ts → AX-BSPLpkVT.d.ts} +0 -0
  286. /package/dist/{BX-RadlZ-6m.d.ts → BX-u4yMaIkz.d.ts} +0 -0
  287. /package/dist/{CX-CT1Zzb9D.d.ts → CX-BKZG0pVE.d.ts} +0 -0
  288. /package/dist/{DX-CtUeTKMM.d.ts → DX-CwA9WJAf.d.ts} +0 -0
  289. /package/dist/{EX-084Yu7Wt.d.ts → EX-BRNu1Ooi.d.ts} +0 -0
  290. /package/dist/{FX-BrbQM0CW.d.ts → FX-DBxjq6xY.d.ts} +0 -0
  291. /package/dist/{GX-gKj8iAAh.d.ts → GX-B3CvWNrP.d.ts} +0 -0
  292. /package/dist/{HX-9D-ZXTy5.d.ts → HX-D7FABgTv.d.ts} +0 -0
  293. /package/dist/{IX-DR4Fc92A.d.ts → IX-D3ZknsAB.d.ts} +0 -0
  294. /package/dist/{JX-DIKa9ma-.d.ts → JX-BRaZM3Gc.d.ts} +0 -0
  295. /package/dist/{KX-DpsJ_unT.d.ts → KX-B1K0OWoi.d.ts} +0 -0
  296. /package/dist/{LX-DeXPPWUX.d.ts → LX-CKRefinL.d.ts} +0 -0
  297. /package/dist/{MX-CKMjg_zK.d.ts → MX-DKmaeO9r.d.ts} +0 -0
  298. /package/dist/{NX-oYdb4NDo.d.ts → NX-CJL2Gn1U.d.ts} +0 -0
  299. /package/dist/{OX-Bid9es3D.d.ts → OX-Do2ap5v_.d.ts} +0 -0
  300. /package/dist/{PX-D7jy9CFk.d.ts → PX-_DOr_rm9.d.ts} +0 -0
  301. /package/dist/{QX-BFWOR4g3.d.ts → QX-HlXLkIki.d.ts} +0 -0
  302. /package/dist/{RX-XHgCyMV1.d.ts → RX-DVPGOVES.d.ts} +0 -0
  303. /package/dist/{SX-Cl8RN8oH.d.ts → SX-OGT3qwlS.d.ts} +0 -0
  304. /package/dist/{TX-ZymoIbtr.d.ts → TX-cPDINmZ5.d.ts} +0 -0
  305. /package/dist/{UX-D-Ndd1ov.d.ts → UX-Be3sqvPV.d.ts} +0 -0
  306. /package/dist/{VX-B-1b34r7.d.ts → VX-CoEuBNDK.d.ts} +0 -0
  307. /package/dist/{WX-0GuMjPNZ.d.ts → WX-DMvw__jH.d.ts} +0 -0
  308. /package/dist/{XX-CF2NANsy.d.ts → XX-DOA-10JW.d.ts} +0 -0
  309. /package/dist/{YX-B51BbNSg.d.ts → YX-F34sJ7Ik.d.ts} +0 -0
  310. /package/dist/{ZX-BMJS1iAv.d.ts → ZX-CDQOfsHh.d.ts} +0 -0
  311. /package/dist/{certificate-aooIRf9A.js → certificate-BDECQL9C.js} +0 -0
  312. /package/dist/{classification-codes-BKxV-rO9.d.ts → classification-codes-B1D5xbq5.d.ts} +0 -0
  313. /package/dist/{country-code-CQuaiQm2.d.ts → country-code-D42kAyNH.d.ts} +0 -0
  314. /package/dist/{currencies-BYJK-m6v.d.ts → currencies-CDveO_yz.d.ts} +0 -0
  315. /package/dist/{document-D6VKMAtx.js → document-BSuYbfXR.js} +0 -0
  316. /package/dist/{e-invoice-CmbLQkHw.d.ts → e-invoice-BxNC6V_j.d.ts} +0 -0
  317. /package/dist/{getBaseUrl-R3IdgCu3.js → getBaseUrl-BYkBwhQP.js} +0 -0
  318. /package/dist/{index-0-EvC6Nv.d.ts → index-FTgB2nM6.d.ts} +0 -0
  319. /package/dist/{payment-modes-BOTSRC_X.d.ts → payment-modes-NpE3OcCV.d.ts} +0 -0
  320. /package/dist/{signatures-W-_brwdb.d.ts → signatures-DOKNMiZI.d.ts} +0 -0
  321. /package/dist/{state-codes-oeFKlwXZ.d.ts → state-codes-VOFWhHA0.d.ts} +0 -0
  322. /package/dist/{tax-types-CsQ76JMf.d.ts → tax-types-ieqw5Ze7.d.ts} +0 -0
package/dist/index18.cjs CHANGED
@@ -1,340 +1,6 @@
1
+ require('./document-vDphtJTv.cjs');
2
+ const require_documentSubmission = require('./documentSubmission-D5TC0MPC.cjs');
1
3
 
2
- //#region src/utils/helpers.ts
3
- /**
4
- * MyInvois Invoice Helper Functions
5
- *
6
- * Provides convenient utilities for common invoice scenarios and business patterns.
7
- * These helpers simplify the creation of compliant MyInvois documents.
8
- */
9
- /**
10
- * Payment Method Helpers
11
- */
12
- const PaymentHelpers = {
13
- cash() {
14
- return {
15
- paymentMeansCode: "01",
16
- paymentTerms: "Cash payment"
17
- };
18
- },
19
- cheque(accountId) {
20
- return {
21
- paymentMeansCode: "02",
22
- payeeFinancialAccountID: accountId,
23
- paymentTerms: "Cheque payment"
24
- };
25
- },
26
- bankTransfer(accountId, dueDate) {
27
- return {
28
- paymentMeansCode: "03",
29
- payeeFinancialAccountID: accountId,
30
- paymentDueDate: dueDate,
31
- paymentTerms: "Bank transfer"
32
- };
33
- },
34
- creditCard() {
35
- return {
36
- paymentMeansCode: "04",
37
- paymentTerms: "Credit card payment"
38
- };
39
- },
40
- eWallet(accountId) {
41
- return {
42
- paymentMeansCode: "05",
43
- payeeFinancialAccountID: accountId,
44
- paymentTerms: "E-wallet payment"
45
- };
46
- },
47
- net(days, accountId) {
48
- const dueDate = /* @__PURE__ */ new Date();
49
- dueDate.setDate(dueDate.getDate() + days);
50
- return {
51
- paymentMeansCode: "03",
52
- payeeFinancialAccountID: accountId,
53
- paymentDueDate: dueDate.toISOString().split("T")[0],
54
- paymentTerms: `Net ${days} days`
55
- };
56
- }
57
- };
58
- /**
59
- * Currency and Exchange Rate Helpers
60
- */
61
- const CurrencyHelpers = {
62
- domestic() {
63
- return {
64
- sourceCurrencyCode: "MYR",
65
- targetCurrencyCode: "MYR",
66
- calculationRate: 1
67
- };
68
- },
69
- international(fromCurrency, toCurrency = "MYR", exchangeRate, rateDate) {
70
- return {
71
- sourceCurrencyCode: fromCurrency,
72
- targetCurrencyCode: toCurrency,
73
- calculationRate: exchangeRate,
74
- exchangeRateDate: rateDate || (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
75
- };
76
- },
77
- commonRates: {
78
- USD_MYR: 4.75,
79
- SGD_MYR: 3.45,
80
- EUR_MYR: 5.1,
81
- GBP_MYR: 5.85,
82
- JPY_MYR: .032,
83
- AUD_MYR: 3.12
84
- }
85
- };
86
- /**
87
- * Tax Calculation Helpers
88
- */
89
- const TaxHelpers = {
90
- calculateSST(amount, rate = 6) {
91
- const taxAmount = amount * rate / 100;
92
- return {
93
- taxAmount: Math.round(taxAmount * 100) / 100,
94
- totalWithTax: Math.round((amount + taxAmount) * 100) / 100
95
- };
96
- },
97
- calculateServiceTax(amount, rate = 6) {
98
- return TaxHelpers.calculateSST(amount, rate);
99
- },
100
- zeroRated(amount) {
101
- return {
102
- taxAmount: 0,
103
- totalWithTax: amount
104
- };
105
- },
106
- exempt(amount) {
107
- return {
108
- taxAmount: 0,
109
- totalWithTax: amount
110
- };
111
- }
112
- };
113
- /**
114
- * Allowance and Charge Helpers
115
- */
116
- const AllowanceChargeHelpers = {
117
- discount(reason, amount, percentage) {
118
- return {
119
- chargeIndicator: false,
120
- reason,
121
- amount,
122
- multiplierFactorNumeric: percentage ? percentage / 100 : void 0
123
- };
124
- },
125
- shipping(amount, description = "Shipping and handling") {
126
- return {
127
- chargeIndicator: true,
128
- reason: description,
129
- amount
130
- };
131
- },
132
- earlyPaymentDiscount(percentage, baseAmount) {
133
- const discountAmount = baseAmount * percentage / 100;
134
- return {
135
- chargeIndicator: false,
136
- reason: `Early payment discount ${percentage}%`,
137
- amount: Math.round(discountAmount * 100) / 100,
138
- multiplierFactorNumeric: percentage / 100,
139
- baseAmount
140
- };
141
- },
142
- handlingFee(amount) {
143
- return {
144
- chargeIndicator: true,
145
- reason: "Handling fee",
146
- amount
147
- };
148
- }
149
- };
150
- /**
151
- * Delivery Helpers
152
- */
153
- const DeliveryHelpers = {
154
- standard(deliveryDate, address) {
155
- return {
156
- actualDeliveryDate: deliveryDate,
157
- deliveryLocation: {
158
- ...address,
159
- country: address.country || "MYS"
160
- }
161
- };
162
- },
163
- pickup(pickupDate) {
164
- return {
165
- actualDeliveryDate: pickupDate,
166
- deliveryLocation: {
167
- addressLine0: "Customer pickup",
168
- cityName: "N/A",
169
- state: "N/A",
170
- country: "MYS"
171
- }
172
- };
173
- },
174
- withFreight(deliveryDate, address, freightAmount, freightDescription = "Freight charges") {
175
- return {
176
- actualDeliveryDate: deliveryDate,
177
- deliveryLocation: address,
178
- shipment: {
179
- id: `SHIP-${Date.now()}`,
180
- freightAllowanceCharge: {
181
- chargeIndicator: true,
182
- reason: freightDescription,
183
- amount: freightAmount
184
- }
185
- }
186
- };
187
- }
188
- };
189
- /**
190
- * Document Reference Helpers
191
- */
192
- const DocumentReferenceHelpers = {
193
- purchaseOrder(poNumber) {
194
- return { purchaseOrderReference: poNumber };
195
- },
196
- contract(contractNumber) {
197
- return { contractReference: contractNumber };
198
- },
199
- project(projectNumber) {
200
- return { projectReference: projectNumber };
201
- },
202
- billing(billingNumber) {
203
- return { billingReference: billingNumber };
204
- },
205
- customs(customsFormNumber) {
206
- return {
207
- id: customsFormNumber,
208
- documentType: "CustomsImportForm",
209
- documentDescription: "Customs import declaration"
210
- };
211
- },
212
- freeTradeAgreement(ftaNumber, country) {
213
- return {
214
- id: ftaNumber,
215
- documentType: "FreeTradeAgreement",
216
- documentDescription: `Free trade agreement with ${country}`
217
- };
218
- }
219
- };
220
- /**
221
- * Industry Classification Helpers
222
- */
223
- const IndustryHelpers = {
224
- trading: {
225
- industryClassificationCode: "47900",
226
- industryClassificationDescription: "Retail sale via mail order houses or via Internet"
227
- },
228
- manufacturing: {
229
- industryClassificationCode: "10131",
230
- industryClassificationDescription: "Processing and preserving of meat"
231
- },
232
- software: {
233
- industryClassificationCode: "62012",
234
- industryClassificationDescription: "Business and domestic software development"
235
- },
236
- consulting: {
237
- industryClassificationCode: "70200",
238
- industryClassificationDescription: "Management consultancy activities"
239
- },
240
- restaurant: {
241
- industryClassificationCode: "56101",
242
- industryClassificationDescription: "Restaurants"
243
- },
244
- construction: {
245
- industryClassificationCode: "41000",
246
- industryClassificationDescription: "Development of building projects"
247
- },
248
- logistics: {
249
- industryClassificationCode: "49301",
250
- industryClassificationDescription: "Land freight transport"
251
- },
252
- custom(code, description) {
253
- return {
254
- industryClassificationCode: code,
255
- industryClassificationDescription: description
256
- };
257
- }
258
- };
259
- /**
260
- * Date and Time Helpers
261
- */
262
- const DateTimeHelpers = {
263
- currentDate() {
264
- return (/* @__PURE__ */ new Date()).toISOString().split("T")[0] || "";
265
- },
266
- currentTime() {
267
- return (/* @__PURE__ */ new Date()).toISOString().split("T")[1]?.split(".")[0] + "Z" || "";
268
- },
269
- formatDate(date) {
270
- return date.toISOString().split("T")[0] || "";
271
- },
272
- formatTime(date) {
273
- return date.toISOString().split("T")[1]?.split(".")[0] + "Z" || "";
274
- },
275
- addDays(date, days) {
276
- const result = new Date(date);
277
- result.setDate(result.getDate() + days);
278
- return result;
279
- },
280
- monthlyPeriod(year, month) {
281
- const start = new Date(Date.UTC(year, month - 1, 1));
282
- const end = new Date(Date.UTC(year, month, 0));
283
- return {
284
- start: DateTimeHelpers.formatDate(start),
285
- end: DateTimeHelpers.formatDate(end)
286
- };
287
- }
288
- };
289
- /**
290
- * Complete Invoice Builder Helper
291
- */
292
- const InvoiceBuilder = {
293
- basicCash(invoiceNumber) {
294
- return {
295
- eInvoiceCodeOrNumber: invoiceNumber,
296
- eInvoiceDate: DateTimeHelpers.currentDate(),
297
- eInvoiceTime: DateTimeHelpers.currentTime(),
298
- eInvoiceTypeCode: "01",
299
- eInvoiceVersion: "1.1",
300
- invoiceCurrencyCode: "MYR",
301
- paymentMeans: [PaymentHelpers.cash()]
302
- };
303
- },
304
- businessInvoice(invoiceNumber, accountId, netDays = 30) {
305
- return {
306
- eInvoiceCodeOrNumber: invoiceNumber,
307
- eInvoiceDate: DateTimeHelpers.currentDate(),
308
- eInvoiceTime: DateTimeHelpers.currentTime(),
309
- eInvoiceTypeCode: "01",
310
- eInvoiceVersion: "1.1",
311
- invoiceCurrencyCode: "MYR",
312
- paymentMeans: [PaymentHelpers.net(netDays, accountId)]
313
- };
314
- },
315
- international(invoiceNumber, currency, exchangeRate) {
316
- return {
317
- eInvoiceCodeOrNumber: invoiceNumber,
318
- eInvoiceDate: DateTimeHelpers.currentDate(),
319
- eInvoiceTime: DateTimeHelpers.currentTime(),
320
- eInvoiceTypeCode: "01",
321
- eInvoiceVersion: "1.1",
322
- invoiceCurrencyCode: currency,
323
- currencyExchangeRate: exchangeRate,
324
- taxExchangeRate: CurrencyHelpers.international(currency, "MYR", exchangeRate),
325
- paymentMeans: [PaymentHelpers.bankTransfer("")]
326
- };
327
- }
328
- };
329
-
330
- //#endregion
331
- exports.AllowanceChargeHelpers = AllowanceChargeHelpers;
332
- exports.CurrencyHelpers = CurrencyHelpers;
333
- exports.DateTimeHelpers = DateTimeHelpers;
334
- exports.DeliveryHelpers = DeliveryHelpers;
335
- exports.DocumentReferenceHelpers = DocumentReferenceHelpers;
336
- exports.IndustryHelpers = IndustryHelpers;
337
- exports.InvoiceBuilder = InvoiceBuilder;
338
- exports.PaymentHelpers = PaymentHelpers;
339
- exports.TaxHelpers = TaxHelpers;
340
- //# sourceMappingURL=index18.cjs.map
4
+ exports.getSubmissionStatus = require_documentSubmission.getSubmissionStatus;
5
+ exports.performDocumentAction = require_documentSubmission.performDocumentAction;
6
+ exports.submitDocument = require_documentSubmission.submitDocument;
package/dist/index19.cjs CHANGED
@@ -1,329 +1,5 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_document = require('./document-CARHiGdp.cjs');
3
- const crypto = require_chunk.__toESM(require("crypto"));
1
+ const require_documentTypeManagement = require('./documentTypeManagement-DXRLfTsW.cjs');
4
2
 
5
- //#region src/utils/signature-diagnostics.ts
6
- /**
7
- * Analyzes certificate for MyInvois compatibility issues
8
- */
9
- function analyzeCertificateForDiagnostics(certificatePem) {
10
- const issues = [];
11
- const recommendations = [];
12
- try {
13
- const cert = new crypto.default.X509Certificate(certificatePem);
14
- const certInfo = require_document.extractCertificateInfo(certificatePem);
15
- const parseSubjectFields = (dn) => {
16
- const fields = {};
17
- dn.split("\n").forEach((line) => {
18
- const trimmed = line.trim();
19
- if (trimmed.includes("=")) {
20
- const [key, ...valueParts] = trimmed.split("=");
21
- if (key) fields[key.trim()] = valueParts.join("=").trim();
22
- }
23
- });
24
- return fields;
25
- };
26
- const subjectFields = parseSubjectFields(cert.subject);
27
- const organizationIdentifier = subjectFields["organizationIdentifier"] || subjectFields["2.5.4.97"];
28
- const serialNumber = subjectFields["serialNumber"];
29
- if (!organizationIdentifier) {
30
- issues.push("DS311: Certificate missing organizationIdentifier field (TIN)");
31
- recommendations.push("CRITICAL: Generate new certificate with organizationIdentifier matching your MyInvois TIN");
32
- recommendations.push("Portal Error: \"Signer of invoice doesn't match the submitter of document. TIN doesn't match with the OI.\"");
33
- } else if (organizationIdentifier.length < 10) {
34
- issues.push("DS311: OrganizationIdentifier (TIN) appears too short - may cause submission rejection");
35
- recommendations.push("Verify TIN format matches exactly what is registered in MyInvois");
36
- }
37
- if (!serialNumber) {
38
- issues.push("DS312: Certificate missing serialNumber field (business registration)");
39
- recommendations.push("CRITICAL: Generate new certificate with serialNumber matching your business registration");
40
- recommendations.push("Portal Error: \"Submitter registration/identity number doesn't match with the certificate SERIALNUMBER.\"");
41
- }
42
- if (cert.issuer === cert.subject) {
43
- issues.push("DS329: Self-signed certificate detected - will fail chain of trust validation");
44
- recommendations.push("BLOCKING: Obtain certificate from MyInvois-approved CA:");
45
- recommendations.push("• MSC Trustgate Sdn Bhd");
46
- recommendations.push("• DigiCert Sdn Bhd");
47
- recommendations.push("• Cybersign Asia Sdn Bhd");
48
- recommendations.push("Portal Error: \"Certificate is not valid according to the chain of trust validation or has been issued by an untrusted certificate authority.\"");
49
- } else {
50
- const issuerName = cert.issuer.toLowerCase();
51
- const approvedCAs = [
52
- "msc trustgate",
53
- "digicert",
54
- "cybersign"
55
- ];
56
- const isFromApprovedCA = approvedCAs.some((ca) => issuerName.includes(ca));
57
- if (!isFromApprovedCA) {
58
- issues.push("DS329: Certificate may not be from MyInvois-approved CA");
59
- recommendations.push("Verify certificate was issued by an approved CA for MyInvois");
60
- }
61
- }
62
- const rawIssuer = cert.issuer;
63
- const normalizedIssuer = certInfo.issuerName;
64
- const normalizedIssuerIssues = [
65
- {
66
- check: normalizedIssuer.includes("\n"),
67
- issue: "Normalized issuer still contains newlines"
68
- },
69
- {
70
- check: normalizedIssuer.includes(" "),
71
- issue: "Normalized issuer contains double spaces"
72
- },
73
- {
74
- check: /=\s+/.test(normalizedIssuer),
75
- issue: "Normalized issuer has spaces after equals"
76
- },
77
- {
78
- check: /\s+=/.test(normalizedIssuer),
79
- issue: "Normalized issuer has spaces before equals"
80
- },
81
- {
82
- check: normalizedIssuer.includes("\r"),
83
- issue: "Normalized issuer contains carriage returns"
84
- }
85
- ];
86
- const hasActualFormatIssues = normalizedIssuerIssues.some(({ check, issue }) => {
87
- if (check) {
88
- issues.push(`DS326: ${issue} - will cause X509IssuerName mismatch`);
89
- return true;
90
- }
91
- return false;
92
- });
93
- const hasRawIssuesButNormalizedOk = rawIssuer.includes("\n") && !normalizedIssuer.includes("\n");
94
- if (hasActualFormatIssues) {
95
- recommendations.push("CRITICAL: Fix issuer name normalization in signature generation");
96
- recommendations.push("Portal Error: \"Certificate X509IssuerName doesn't match the X509IssuerName value provided in the signed properties section.\"");
97
- recommendations.push("The normalization function is not properly formatting the issuer name");
98
- recommendations.push("Debug: Check document.ts extractCertificateInfo() normalization logic");
99
- } else if (hasRawIssuesButNormalizedOk) console.log("ℹ️ Note: Raw certificate issuer has newlines but normalization is handling them correctly");
100
- const now = /* @__PURE__ */ new Date();
101
- const validFrom = new Date(cert.validFrom);
102
- const validTo = new Date(cert.validTo);
103
- if (now < validFrom) {
104
- issues.push("DS329: Certificate not yet valid (future start date)");
105
- recommendations.push("Wait until certificate validity period begins");
106
- }
107
- if (now > validTo) {
108
- issues.push("DS329: Certificate has expired");
109
- recommendations.push("BLOCKING: Renew certificate - expired certificates are rejected");
110
- }
111
- try {
112
- if (cert.keyUsage && !cert.keyUsage.includes("digital signature")) {
113
- issues.push("DS333: Certificate lacks digitalSignature key usage");
114
- recommendations.push("Generate new certificate with digitalSignature key usage enabled");
115
- }
116
- } catch {
117
- console.log("Note: Could not check key usage extensions");
118
- }
119
- return {
120
- organizationIdentifier,
121
- serialNumber,
122
- issuerName: certInfo.issuerName,
123
- subjectName: certInfo.subjectName,
124
- issues,
125
- recommendations
126
- };
127
- } catch (error) {
128
- issues.push(`Certificate parsing failed: ${error}`);
129
- recommendations.push("Verify certificate format and validity");
130
- return {
131
- issuerName: "",
132
- subjectName: "",
133
- issues,
134
- recommendations
135
- };
136
- }
137
- }
138
- /**
139
- * Analyzes signature generation for potential issues
140
- */
141
- function analyzeSignatureForDiagnostics(invoices, certificatePem) {
142
- const issues = [];
143
- const recommendations = [];
144
- try {
145
- const documentDigest = require_document.calculateDocumentDigest(invoices);
146
- const certificateDigest = require_document.calculateCertificateDigest(certificatePem);
147
- const certInfo = require_document.extractCertificateInfo(certificatePem);
148
- const signingTime = (/* @__PURE__ */ new Date()).toISOString();
149
- const signedProperties = require_document.createSignedProperties(certificateDigest, signingTime, certInfo.issuerName, certInfo.serialNumber);
150
- const signedPropertiesDigest = require_document.calculateSignedPropertiesDigest(signedProperties);
151
- if (documentDigest.length === 0) {
152
- issues.push("DS333: Document digest generation failed");
153
- recommendations.push("CRITICAL: Verify document serialization excludes UBLExtensions/Signature");
154
- recommendations.push("Portal Error: \"Document signature value is not a valid signature of the document digest using the public key of the certificate provided.\"");
155
- }
156
- if (certificateDigest.length === 0) {
157
- issues.push("DS333: Certificate digest generation failed");
158
- recommendations.push("CRITICAL: Verify certificate format and encoding");
159
- recommendations.push("Certificate must be properly base64 encoded without headers/footers");
160
- }
161
- if (signedPropertiesDigest.length === 0) {
162
- issues.push("DS333: Signed properties digest generation failed");
163
- recommendations.push("CRITICAL: Verify signed properties structure and canonicalization");
164
- recommendations.push("Check XML canonicalization (C14N) is applied correctly");
165
- }
166
- try {
167
- const cert = new crypto.default.X509Certificate(certificatePem);
168
- const publicKey = cert.publicKey;
169
- const keyDetails = publicKey.asymmetricKeyDetails;
170
- if (keyDetails) {
171
- if (publicKey.asymmetricKeyType === "rsa" && keyDetails.modulusLength && keyDetails.modulusLength < 2048) {
172
- issues.push("DS333: RSA key size too small (minimum 2048 bits required)");
173
- recommendations.push("CRITICAL: Generate new certificate with RSA 2048+ bits");
174
- }
175
- const supportedKeyTypes = ["rsa", "ec"];
176
- if (!supportedKeyTypes.includes(publicKey.asymmetricKeyType || "")) {
177
- issues.push(`DS333: Unsupported key type: ${publicKey.asymmetricKeyType}`);
178
- recommendations.push("CRITICAL: Use RSA or EC key types for MyInvois compatibility");
179
- }
180
- }
181
- const certBuffer = Buffer.from(certificatePem.replace(/-----[^-]+-----/g, "").replace(/\s/g, ""), "base64");
182
- if (certBuffer.length === 0) {
183
- issues.push("DS333: Certificate encoding appears invalid");
184
- recommendations.push("CRITICAL: Verify certificate is properly PEM encoded");
185
- }
186
- } catch (error) {
187
- issues.push(`DS333: Certificate validation failed - ${error}`);
188
- recommendations.push("CRITICAL: Verify certificate format and structure are valid");
189
- }
190
- const isValidBase64 = (str) => {
191
- try {
192
- return Buffer.from(str, "base64").toString("base64") === str;
193
- } catch {
194
- return false;
195
- }
196
- };
197
- if (documentDigest && !isValidBase64(documentDigest)) {
198
- issues.push("DS333: Document digest is not valid base64 format");
199
- recommendations.push("Ensure digest is properly base64 encoded");
200
- }
201
- if (certificateDigest && !isValidBase64(certificateDigest)) {
202
- issues.push("DS333: Certificate digest is not valid base64 format");
203
- recommendations.push("Ensure certificate digest is properly base64 encoded");
204
- }
205
- if (signedPropertiesDigest && !isValidBase64(signedPropertiesDigest)) {
206
- issues.push("DS333: Signed properties digest is not valid base64 format");
207
- recommendations.push("Ensure signed properties digest is properly base64 encoded");
208
- }
209
- return {
210
- documentDigest,
211
- certificateDigest,
212
- signedPropertiesDigest,
213
- issues,
214
- recommendations
215
- };
216
- } catch (error) {
217
- issues.push(`Signature analysis failed: ${error}`);
218
- recommendations.push("Review signature generation implementation");
219
- return {
220
- documentDigest: "",
221
- certificateDigest: "",
222
- signedPropertiesDigest: "",
223
- issues,
224
- recommendations
225
- };
226
- }
227
- }
228
- /**
229
- * Comprehensive signature diagnostics
230
- */
231
- function diagnoseSignatureIssues(invoices, certificatePem) {
232
- const certificateAnalysis = analyzeCertificateForDiagnostics(certificatePem);
233
- const signatureAnalysis = analyzeSignatureForDiagnostics(invoices, certificatePem);
234
- const certificateIssues = certificateAnalysis.issues.length;
235
- const signatureIssues = signatureAnalysis.issues.length;
236
- return {
237
- certificateAnalysis,
238
- signatureAnalysis,
239
- summary: {
240
- totalIssues: certificateIssues + signatureIssues,
241
- certificateIssues,
242
- signatureIssues
243
- }
244
- };
245
- }
246
- /**
247
- * Prints diagnostic results in a formatted way
248
- */
249
- function printDiagnostics(result) {
250
- console.log("\n🔍 MyInvois Signature Diagnostics Report");
251
- console.log("=".repeat(60));
252
- console.log("\n📜 CERTIFICATE ANALYSIS");
253
- console.log("-".repeat(30));
254
- console.log(` Issuer: ${result.certificateAnalysis.issuerName}`);
255
- console.log(` Subject: ${result.certificateAnalysis.subjectName}`);
256
- if (result.certificateAnalysis.organizationIdentifier) console.log(` Organization ID (TIN): ${result.certificateAnalysis.organizationIdentifier}`);
257
- if (result.certificateAnalysis.serialNumber) console.log(` Serial Number: ${result.certificateAnalysis.serialNumber}`);
258
- if (result.certificateAnalysis.issues.length > 0) {
259
- console.log("\n 🚨 Certificate Issues:");
260
- result.certificateAnalysis.issues.forEach((issue, index) => {
261
- console.log(` ${index + 1}. ${issue}`);
262
- });
263
- }
264
- if (result.certificateAnalysis.recommendations.length > 0) {
265
- console.log("\n 💡 Certificate Recommendations:");
266
- result.certificateAnalysis.recommendations.forEach((rec, index) => {
267
- console.log(` ${index + 1}. ${rec}`);
268
- });
269
- }
270
- console.log("\n🔐 SIGNATURE ANALYSIS");
271
- console.log("-".repeat(30));
272
- console.log(` Document Digest: ${result.signatureAnalysis.documentDigest.substring(0, 32)}...`);
273
- console.log(` Certificate Digest: ${result.signatureAnalysis.certificateDigest.substring(0, 32)}...`);
274
- console.log(` Signed Properties Digest: ${result.signatureAnalysis.signedPropertiesDigest.substring(0, 32)}...`);
275
- if (result.signatureAnalysis.issues.length > 0) {
276
- console.log("\n 🚨 Signature Issues:");
277
- result.signatureAnalysis.issues.forEach((issue, index) => {
278
- console.log(` ${index + 1}. ${issue}`);
279
- });
280
- }
281
- if (result.signatureAnalysis.recommendations.length > 0) {
282
- console.log("\n 💡 Signature Recommendations:");
283
- result.signatureAnalysis.recommendations.forEach((rec, index) => {
284
- console.log(` ${index + 1}. ${rec}`);
285
- });
286
- }
287
- console.log("\n📊 SUMMARY");
288
- console.log("-".repeat(30));
289
- console.log(` Total Issues Found: ${result.summary.totalIssues}`);
290
- console.log(` Certificate Issues: ${result.summary.certificateIssues}`);
291
- console.log(` Signature Issues: ${result.summary.signatureIssues}`);
292
- if (result.summary.totalIssues === 0) {
293
- console.log("\n ✅ No issues detected in current analysis");
294
- console.log(" 🎉 Certificate and signature implementation appear valid");
295
- } else {
296
- console.log("\n ⚠️ Issues detected - review recommendations above");
297
- const hasDS311 = result.certificateAnalysis.issues.some((issue) => issue.includes("DS311"));
298
- const hasDS312 = result.certificateAnalysis.issues.some((issue) => issue.includes("DS312"));
299
- const hasDS326 = result.certificateAnalysis.issues.some((issue) => issue.includes("DS326"));
300
- const hasDS329 = result.certificateAnalysis.issues.some((issue) => issue.includes("DS329"));
301
- const hasDS333 = result.signatureAnalysis.issues.some((issue) => issue.includes("DS333"));
302
- console.log("\n 🎯 MYINVOIS PORTAL ERROR ANALYSIS:");
303
- if (hasDS311) console.log(" ❌ DS311 - TIN mismatch between certificate and submitter");
304
- if (hasDS312) console.log(" ❌ DS312 - Registration number mismatch with certificate");
305
- if (hasDS326) console.log(" ❌ DS326 - X509IssuerName format inconsistency");
306
- if (hasDS329) console.log(" ❌ DS329 - Certificate trust chain validation failure");
307
- if (hasDS333) console.log(" ❌ DS333 - Document signature validation failure");
308
- if (result.summary.certificateIssues > 0) {
309
- console.log("\n 🚨 PRIMARY ACTION REQUIRED:");
310
- console.log(" Certificate issues must be resolved first");
311
- console.log(" Self-generated certificates cannot pass MyInvois validation");
312
- }
313
- if (result.summary.signatureIssues > 0) {
314
- console.log("\n ⚙️ SECONDARY ACTION:");
315
- console.log(" Review and optimize signature implementation");
316
- }
317
- console.log("\n 📋 NEXT STEPS:");
318
- console.log(" 1. Address BLOCKING/CRITICAL issues first");
319
- console.log(" 2. Test with updated certificate/implementation");
320
- console.log(" 3. Re-run diagnostics to verify fixes");
321
- console.log(" 4. Submit test document to MyInvois portal");
322
- }
323
- console.log("\n" + "=".repeat(60));
324
- }
325
-
326
- //#endregion
327
- exports.diagnoseSignatureIssues = diagnoseSignatureIssues;
328
- exports.printDiagnostics = printDiagnostics;
329
- //# sourceMappingURL=index19.cjs.map
3
+ exports.getDocumentType = require_documentTypeManagement.getDocumentType;
4
+ exports.getDocumentTypeVersion = require_documentTypeManagement.getDocumentTypeVersion;
5
+ exports.getDocumentTypes = require_documentTypeManagement.getDocumentTypes;