@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/index.js CHANGED
@@ -1,7 +1,12 @@
1
- import { platformLogin } from "./platformLogin-f0bNAoZI.js";
2
- import { getBaseUrl } from "./getBaseUrl-R3IdgCu3.js";
3
- import { extractCertificateInfo, validateKeyPair } from "./certificate-aooIRf9A.js";
4
- import { generateCompleteDocument } from "./document-D6VKMAtx.js";
1
+ import { getDocument, getDocumentDetails, searchDocuments } from "./documentManagement-CIQPkmyb.js";
2
+ import "./document-BSuYbfXR.js";
3
+ import { getSubmissionStatus, submitDocument } from "./documentSubmission-BdJxIB_I.js";
4
+ import { getDocumentType, getDocumentTypeVersion, getDocumentTypes } from "./documentTypeManagement-tojgXfm9.js";
5
+ import { getNotifications } from "./notificationManagement-CHDRVy8J.js";
6
+ import { platformLogin } from "./platformLogin-Ck1Fge2n.js";
7
+ import { verifyTin } from "./taxpayerValidation-DI4B6kWx.js";
8
+ import { extractCertificateInfo, validateKeyPair } from "./certificate-BDECQL9C.js";
9
+ import { getBaseUrl } from "./getBaseUrl-BYkBwhQP.js";
5
10
 
6
11
  //#region src/index.ts
7
12
  var MyInvoisClient = class {
@@ -63,20 +68,36 @@ var MyInvoisClient = class {
63
68
  /**
64
69
  * Validates a TIN against a NRIC/ARMY/PASSPORT/BRN (Business Registration Number)
65
70
  *
71
+ * This method verifies if a given Tax Identification Number (TIN) is valid by checking it against
72
+ * the provided identification type and value through the MyInvois platform's validation service.
73
+ *
66
74
  * @param tin - The TIN to validate
67
- * @param idType - The type of ID to validate against
75
+ * @param idType - The type of ID to validate against ('NRIC', 'ARMY', 'PASSPORT', or 'BRN')
68
76
  * @param idValue - The value of the ID to validate against
69
- * @returns true if the TIN is valid, false otherwise
77
+ * @returns Promise resolving to true if the TIN is valid, false otherwise
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * // Validate TIN against NRIC
82
+ * const isValid = await client.verifyTin('C12345678901234', 'NRIC', '123456789012');
83
+ * if (isValid) {
84
+ * console.log('TIN is valid');
85
+ * }
86
+ *
87
+ * // Validate TIN against Business Registration Number
88
+ * const isValidBusiness = await client.verifyTin('C98765432109876', 'BRN', '123456-K');
89
+ * ```
90
+ *
91
+ * @remarks
92
+ * - Returns false if validation fails due to network errors or invalid credentials
93
+ * - Debug mode provides error logging for troubleshooting validation failures
94
+ * - This is a non-blocking validation that won't throw exceptions on failure
70
95
  */
71
96
  async verifyTin(tin, idType, idValue) {
72
- try {
73
- const response = await this.fetch(`/api/v1.0/taxpayer/validate/${tin}?idType=${idType}&idValue=${idValue}`, { method: "GET" });
74
- if (response.status === 200) return true;
75
- return false;
76
- } catch (error) {
77
- if (this.debug) console.error(error);
78
- return false;
79
- }
97
+ return verifyTin({
98
+ fetch: this.fetch.bind(this),
99
+ debug: this.debug
100
+ }, tin, idType, idValue);
80
101
  }
81
102
  /**
82
103
  * Submits one or more e-invoice documents to the MyInvois platform for processing.
@@ -112,104 +133,52 @@ var MyInvoisClient = class {
112
133
  * - Returns HTTP 202 for successful submissions that require processing
113
134
  */
114
135
  async submitDocument(documents) {
115
- if (this.debug) console.log(`📦 Preparing to submit ${documents.length} document(s)...`);
116
- const completeDocument = generateCompleteDocument(documents, this.signingCredentials);
117
- if (this.debug) {
118
- console.log("✅ Documents signed successfully");
119
- console.log("📄 Document structure keys:", Object.keys(completeDocument));
120
- console.log("📊 Number of invoices:", completeDocument.Invoice.length);
121
- }
122
- const documentJson = JSON.stringify(completeDocument);
123
- if (this.debug) console.log(`📏 Document JSON size: ${documentJson.length} bytes`);
124
- const crypto = await import("crypto");
125
- const documentHash = crypto.createHash("sha256").update(documentJson, "utf8").digest("hex");
126
- const documentBase64 = Buffer.from(documentJson, "utf8").toString("base64");
127
- if (this.debug) {
128
- console.log(`🔒 Document hash: ${documentHash.substring(0, 16)}...`);
129
- console.log(`📦 Base64 size: ${documentBase64.length} bytes`);
130
- }
131
- const submissionPayload = { documents: documents.map((doc) => ({
132
- format: "JSON",
133
- document: documentBase64,
134
- documentHash,
135
- codeNumber: doc.eInvoiceCodeOrNumber
136
- })) };
137
- if (this.debug) {
138
- console.log("🚀 Submission payload structure:");
139
- console.log("- Format: JSON");
140
- console.log("- Documents count:", submissionPayload.documents.length);
141
- console.log("- Total payload size:", JSON.stringify(submissionPayload).length, "bytes");
142
- const payloadSize = JSON.stringify(submissionPayload).length;
143
- if (payloadSize > 5 * 1024 * 1024) console.warn("⚠️ WARNING: Payload size exceeds 5MB limit");
144
- if (documents.length > 100) console.warn("⚠️ WARNING: Document count exceeds 100 document limit");
145
- if (documentJson.length > 300 * 1024) console.warn("⚠️ WARNING: Document size exceeds 300KB limit");
146
- }
147
- const response = await this.fetch("/api/v1.0/documentsubmissions", {
148
- method: "POST",
149
- headers: { "Content-Type": "application/json" },
150
- body: JSON.stringify(submissionPayload)
151
- });
152
- if (this.debug) console.log(`📡 API Response status: ${response.status}`);
153
- const data = await response.json();
154
- if (this.debug) if (response.status !== 202) {
155
- console.error("❌ Submission failed with status:", response.status);
156
- console.error("❌ Response data:", data);
157
- } else {
158
- console.log("✅ Submission successful!");
159
- console.log(`📋 Submission UID: ${data.submissionUid}`);
160
- console.log(`✅ Accepted documents: ${data.acceptedDocuments?.length || 0}`);
161
- console.log(`❌ Rejected documents: ${data.rejectedDocuments?.length || 0}`);
162
- }
163
- return {
164
- data,
165
- status: response.status
166
- };
136
+ return submitDocument({
137
+ fetch: this.fetch.bind(this),
138
+ debug: this.debug,
139
+ signingCredentials: this.signingCredentials
140
+ }, documents);
167
141
  }
142
+ /**
143
+ * Polls the MyInvois platform to get the current status of a document submission.
144
+ *
145
+ * This method continuously checks the submission status until it receives a final result
146
+ * (Valid or Invalid) or reaches the maximum retry limit. It's designed to handle the
147
+ * asynchronous nature of document processing on the MyInvois platform.
148
+ *
149
+ * @param submissionUid - The unique identifier of the submission to check
150
+ * @param pollInterval - Time in milliseconds between status checks (default: 1000ms)
151
+ * @param maxRetries - Maximum number of retry attempts (default: 10)
152
+ * @returns Promise resolving to submission status object with document summary and any errors
153
+ *
154
+ * @example
155
+ * ```typescript
156
+ * // Check submission status with default polling
157
+ * const result = await client.getSubmissionStatus('submission-uid-123');
158
+ * if (result.status === 'Valid') {
159
+ * console.log('All documents processed successfully');
160
+ * console.log('Document summaries:', result.documentSummary);
161
+ * }
162
+ *
163
+ * // Custom polling interval and retry count
164
+ * const result = await client.getSubmissionStatus(
165
+ * 'submission-uid-123',
166
+ * 2000, // Poll every 2 seconds
167
+ * 20 // Try up to 20 times
168
+ * );
169
+ * ```
170
+ *
171
+ * @remarks
172
+ * - Automatically retries on network errors until maxRetries is reached
173
+ * - Returns 'Invalid' status with timeout error if submission processing takes too long
174
+ * - Debug mode provides detailed logging of polling attempts and responses
175
+ * - Use reasonable poll intervals to avoid overwhelming the API
176
+ */
168
177
  async getSubmissionStatus(submissionUid, pollInterval = 1e3, maxRetries = 10) {
169
- try {
170
- const response = await this.fetch(`/api/v1.0/documentsubmissions/${submissionUid}`);
171
- const data = await response.json();
172
- if (this.debug) {
173
- console.log("Submission:", data);
174
- if (data.error) console.log("Submission error details:", data.error.details);
175
- }
176
- if (data.overallStatus === "Valid") return {
177
- status: data.overallStatus,
178
- documentSummary: data.documentSummary
179
- };
180
- if (data.overallStatus === "Invalid") return {
181
- status: "Invalid",
182
- documentSummary: data.documentSummary
183
- };
184
- if (maxRetries > 0) {
185
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
186
- return await this.getSubmissionStatus(submissionUid, pollInterval, maxRetries - 1);
187
- }
188
- return {
189
- status: "Invalid",
190
- error: {
191
- code: "Timeout",
192
- message: "Submission timed out",
193
- target: "submission",
194
- details: []
195
- }
196
- };
197
- } catch (error) {
198
- if (maxRetries > 0) {
199
- if (this.debug) console.log("Request error, retrying...", error);
200
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
201
- return await this.getSubmissionStatus(submissionUid, pollInterval, maxRetries - 1);
202
- }
203
- return {
204
- status: "Invalid",
205
- error: {
206
- code: "Timeout",
207
- message: "Submission timed out after request errors",
208
- target: "submission",
209
- details: []
210
- }
211
- };
212
- }
178
+ return getSubmissionStatus({
179
+ fetch: this.fetch.bind(this),
180
+ debug: this.debug
181
+ }, submissionUid, pollInterval, maxRetries);
213
182
  }
214
183
  /**
215
184
  * Retrieves a document by its unique identifier with the raw document content.
@@ -226,9 +195,7 @@ var MyInvoisClient = class {
226
195
  * ```
227
196
  */
228
197
  async getDocument(documentUid) {
229
- const response = await this.fetch(`/api/v1.0/documents/${documentUid}/raw`);
230
- const data = await response.json();
231
- return data;
198
+ return getDocument({ fetch: this.fetch.bind(this) }, documentUid);
232
199
  }
233
200
  /**
234
201
  * Retrieves detailed information about a document including validation results.
@@ -245,9 +212,7 @@ var MyInvoisClient = class {
245
212
  * ```
246
213
  */
247
214
  async getDocumentDetails(documentUid) {
248
- const response = await this.fetch(`/api/v1.0/documents/${documentUid}/details`);
249
- const data = await response.json();
250
- return data;
215
+ return getDocumentDetails({ fetch: this.fetch.bind(this) }, documentUid);
251
216
  }
252
217
  /**
253
218
  * Searches for documents based on various filter criteria.
@@ -286,21 +251,159 @@ var MyInvoisClient = class {
286
251
  * ```
287
252
  */
288
253
  async searchDocuments({ uuid, submissionDateFrom, submissionDateTo, pageSize, pageNo, issueDateFrom, issueDateTo, invoiceDirection, status, documentType, searchQuery }) {
289
- const queryParams = new URLSearchParams();
290
- if (uuid) queryParams.set("uuid", uuid);
291
- if (submissionDateFrom) queryParams.set("submissionDateFrom", submissionDateFrom);
292
- if (submissionDateTo) queryParams.set("submissionDateTo", submissionDateTo);
293
- if (pageSize) queryParams.set("pageSize", pageSize.toString());
294
- if (pageNo) queryParams.set("pageNo", pageNo.toString());
295
- if (issueDateFrom) queryParams.set("issueDateFrom", issueDateFrom);
296
- if (issueDateTo) queryParams.set("issueDateTo", issueDateTo);
297
- if (invoiceDirection) queryParams.set("invoiceDirection", invoiceDirection);
298
- if (status) queryParams.set("status", status);
299
- if (documentType) queryParams.set("documentType", documentType);
300
- if (searchQuery) queryParams.set("searchQuery", searchQuery);
301
- const response = await this.fetch(`/api/v1.0/documents/search?${queryParams.toString()}`);
302
- const data = await response.json();
303
- return data;
254
+ return searchDocuments({ fetch: this.fetch.bind(this) }, {
255
+ uuid,
256
+ submissionDateFrom,
257
+ submissionDateTo,
258
+ pageSize,
259
+ pageNo,
260
+ issueDateFrom,
261
+ issueDateTo,
262
+ invoiceDirection,
263
+ status,
264
+ documentType,
265
+ searchQuery
266
+ });
267
+ }
268
+ /**
269
+ * Retrieves notifications from the MyInvois platform based on specified search criteria.
270
+ *
271
+ * This method allows you to search for system notifications, alerts, and messages
272
+ * sent by the MyInvois platform regarding document processing, system updates,
273
+ * or account-related information.
274
+ *
275
+ * @param params - Search parameters object for filtering notifications
276
+ * @param params.dateFrom - Optional start date for notification date range (ISO date string)
277
+ * @param params.dateTo - Optional end date for notification date range (ISO date string)
278
+ * @param params.type - Optional notification type filter
279
+ * @param params.language - Optional language preference for notifications
280
+ * @param params.status - Optional notification status filter
281
+ * @param params.pageNo - Optional page number for pagination (0-based)
282
+ * @param params.pageSize - Optional number of results per page
283
+ * @returns Promise resolving to notification response object or standard error
284
+ *
285
+ * @example
286
+ * ```typescript
287
+ * // Get all notifications from the last 7 days
288
+ * const notifications = await client.getNotifications({
289
+ * dateFrom: '2024-01-01',
290
+ * dateTo: '2024-01-07',
291
+ * pageSize: 20
292
+ * });
293
+ *
294
+ * // Get unread notifications only
295
+ * const unreadNotifications = await client.getNotifications({
296
+ * status: 0, // Assuming 0 = unread
297
+ * language: 'en'
298
+ * });
299
+ *
300
+ * // Paginated notification retrieval
301
+ * const firstPage = await client.getNotifications({
302
+ * dateFrom: '2024-01-01',
303
+ * pageNo: 0,
304
+ * pageSize: 10
305
+ * });
306
+ * ```
307
+ *
308
+ * @remarks
309
+ * - All parameters are optional, allowing flexible filtering
310
+ * - Returns paginated results when pageNo and pageSize are specified
311
+ * - Date parameters should be in ISO format (YYYY-MM-DD)
312
+ * - May return StandardError object if the request fails
313
+ */
314
+ async getNotifications({ dateFrom, dateTo, type, language, status, pageNo, pageSize }) {
315
+ return getNotifications({ fetch: this.fetch.bind(this) }, {
316
+ dateFrom,
317
+ dateTo,
318
+ type,
319
+ language,
320
+ status,
321
+ pageNo,
322
+ pageSize
323
+ });
324
+ }
325
+ async getDocumentTypes() {
326
+ return getDocumentTypes({ fetch: this.fetch.bind(this) });
327
+ }
328
+ /**
329
+ * Retrieves detailed information about a specific document type from the MyInvois platform.
330
+ *
331
+ * This method fetches metadata and configuration details for a specific document type,
332
+ * including supported versions, validation rules, and structural requirements.
333
+ * Useful for understanding document format requirements before submission.
334
+ *
335
+ * @param id - The unique identifier of the document type to retrieve
336
+ * @returns Promise resolving to document type response object or standard error
337
+ *
338
+ * @example
339
+ * ```typescript
340
+ * // Get details for e-invoice document type
341
+ * const invoiceType = await client.getDocumentType(1);
342
+ * if ('id' in invoiceType) {
343
+ * console.log('Document type name:', invoiceType.name);
344
+ * console.log('Available versions:', invoiceType.versionNumber);
345
+ * console.log('Description:', invoiceType.description);
346
+ * }
347
+ *
348
+ * // Handle potential errors
349
+ * const documentType = await client.getDocumentType(999);
350
+ * if ('error' in documentType) {
351
+ * console.error('Failed to retrieve document type:', documentType.error.message);
352
+ * }
353
+ * ```
354
+ *
355
+ * @remarks
356
+ * - Returns StandardError object if the document type ID doesn't exist
357
+ * - Document type information includes validation schemas and business rules
358
+ * - Use this method to discover supported document formats and versions
359
+ * - Essential for understanding submission requirements for different document types
360
+ */
361
+ async getDocumentType(id) {
362
+ return getDocumentType({ fetch: this.fetch.bind(this) }, id);
363
+ }
364
+ /**
365
+ * Retrieves detailed information about a specific version of a document type.
366
+ *
367
+ * This method fetches version-specific metadata, schema definitions, and validation rules
368
+ * for a particular document type version. Essential for understanding the exact format
369
+ * and requirements for document submission in a specific version.
370
+ *
371
+ * @param id - The unique identifier of the document type
372
+ * @param versionId - The unique identifier of the specific version to retrieve
373
+ * @returns Promise resolving to document type version response object or standard error
374
+ *
375
+ * @example
376
+ * ```typescript
377
+ * // Get specific version details for e-invoice
378
+ * const invoiceV1_1 = await client.getDocumentTypeVersion(1, 1);
379
+ * if ('id' in invoiceV1_1) {
380
+ * console.log('Version number:', invoiceV1_1.versionNumber);
381
+ * console.log('Schema:', invoiceV1_1.jsonSchema);
382
+ * console.log('Status:', invoiceV1_1.status);
383
+ * }
384
+ *
385
+ * // Compare different versions
386
+ * const [v1_0, v1_1] = await Promise.all([
387
+ * client.getDocumentTypeVersion(1, 0),
388
+ * client.getDocumentTypeVersion(1, 1)
389
+ * ]);
390
+ *
391
+ * // Handle version not found
392
+ * const result = await client.getDocumentTypeVersion(1, 999);
393
+ * if ('error' in result) {
394
+ * console.error('Version not found:', result.error.message);
395
+ * }
396
+ * ```
397
+ *
398
+ * @remarks
399
+ * - Returns StandardError object if document type ID or version ID doesn't exist
400
+ * - Version information includes JSON schema for validation
401
+ * - Different versions may have different validation rules and field requirements
402
+ * - Use this to ensure your documents conform to the specific version requirements
403
+ * - Version status indicates if the version is active, deprecated, or under development
404
+ */
405
+ async getDocumentTypeVersion(id, versionId) {
406
+ return getDocumentTypeVersion({ fetch: this.fetch.bind(this) }, id, versionId);
304
407
  }
305
408
  };
306
409
 
package/dist/index10.cjs CHANGED
@@ -0,0 +1,25 @@
1
+
2
+ //#region src/types/payment-modes.d.ts
3
+ /**
4
+ * Enum representing the allowed payment mode codes with descriptive names.
5
+ * Provides a more readable way to reference payment modes.
6
+ *
7
+ * @example
8
+ * const mode = PaymentModeCodeEnum.Cash;
9
+ * console.log(mode); // Output: "01"
10
+ */
11
+ let PaymentModeCodeEnum = /* @__PURE__ */ function(PaymentModeCodeEnum$1) {
12
+ PaymentModeCodeEnum$1["Cash"] = "01";
13
+ PaymentModeCodeEnum$1["Cheque"] = "02";
14
+ PaymentModeCodeEnum$1["BankTransfer"] = "03";
15
+ PaymentModeCodeEnum$1["CreditCard"] = "04";
16
+ PaymentModeCodeEnum$1["DebitCard"] = "05";
17
+ PaymentModeCodeEnum$1["EWalletDigitalWallet"] = "06";
18
+ PaymentModeCodeEnum$1["DigitalBank"] = "07";
19
+ PaymentModeCodeEnum$1["Others"] = "08";
20
+ return PaymentModeCodeEnum$1;
21
+ }({});
22
+
23
+ //#endregion
24
+ exports.PaymentModeCodeEnum = PaymentModeCodeEnum;
25
+ //# sourceMappingURL=index10.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index10.cjs","names":[],"sources":["../src/types/payment-modes.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for payment modes.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/payment-methods/\n */\nexport type PaymentModeCode =\n | '01' // Cash\n | '02' // Cheque\n | '03' // Bank Transfer\n | '04' // Credit Card\n | '05' // Debit Card\n | '06' // e-Wallet / Digital Wallet\n | '07' // Digital Bank\n | '08' // Others\n\n/**\n * Enum representing the allowed payment mode codes with descriptive names.\n * Provides a more readable way to reference payment modes.\n *\n * @example\n * const mode = PaymentModeCodeEnum.Cash;\n * console.log(mode); // Output: \"01\"\n */\nexport enum PaymentModeCodeEnum {\n Cash = '01',\n Cheque = '02',\n BankTransfer = '03',\n CreditCard = '04',\n DebitCard = '05',\n EWalletDigitalWallet = '06',\n DigitalBank = '07',\n Others = '08',\n}\n\n/**\n * Interface representing a payment mode entry.\n * Contains the code and its corresponding description.\n */\nexport interface PaymentMode {\n code: PaymentModeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAsBA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index11.cjs CHANGED
@@ -1,34 +0,0 @@
1
-
2
- //#region src/types/state-codes.d.ts
3
- /**
4
- * Enum representing the allowed state codes with descriptive names.
5
- * Provides a more readable way to reference states.
6
- *
7
- * @example
8
- * const code = StateCodeEnum.Selangor;
9
- * console.log(code); // Output: "10"
10
- */
11
- let StateCodeEnum = /* @__PURE__ */ function(StateCodeEnum$1) {
12
- StateCodeEnum$1["Johor"] = "01";
13
- StateCodeEnum$1["Kedah"] = "02";
14
- StateCodeEnum$1["Kelantan"] = "03";
15
- StateCodeEnum$1["Melaka"] = "04";
16
- StateCodeEnum$1["NegeriSembilan"] = "05";
17
- StateCodeEnum$1["Pahang"] = "06";
18
- StateCodeEnum$1["PulauPinang"] = "07";
19
- StateCodeEnum$1["Perak"] = "08";
20
- StateCodeEnum$1["Perlis"] = "09";
21
- StateCodeEnum$1["Selangor"] = "10";
22
- StateCodeEnum$1["Terengganu"] = "11";
23
- StateCodeEnum$1["Sabah"] = "12";
24
- StateCodeEnum$1["Sarawak"] = "13";
25
- StateCodeEnum$1["WPKualaLumpur"] = "14";
26
- StateCodeEnum$1["WPLabuan"] = "15";
27
- StateCodeEnum$1["WPPutrajaya"] = "16";
28
- StateCodeEnum$1["NotApplicable"] = "17";
29
- return StateCodeEnum$1;
30
- }({});
31
-
32
- //#endregion
33
- exports.StateCodeEnum = StateCodeEnum;
34
- //# sourceMappingURL=index11.cjs.map
package/dist/index12.cjs CHANGED
@@ -1,24 +1,34 @@
1
1
 
2
- //#region src/types/tax-types.d.ts
2
+ //#region src/types/state-codes.d.ts
3
3
  /**
4
- * Enum representing the allowed tax type codes with descriptive names.
5
- * Provides a more readable way to reference tax types.
4
+ * Enum representing the allowed state codes with descriptive names.
5
+ * Provides a more readable way to reference states.
6
6
  *
7
7
  * @example
8
- * const code = TaxTypeCodeEnum.SalesTax;
9
- * console.log(code); // Output: "01"
8
+ * const code = StateCodeEnum.Selangor;
9
+ * console.log(code); // Output: "10"
10
10
  */
11
- let TaxTypeCodeEnum = /* @__PURE__ */ function(TaxTypeCodeEnum$1) {
12
- TaxTypeCodeEnum$1["SalesTax"] = "01";
13
- TaxTypeCodeEnum$1["ServiceTax"] = "02";
14
- TaxTypeCodeEnum$1["TourismTax"] = "03";
15
- TaxTypeCodeEnum$1["HighValueGoodsTax"] = "04";
16
- TaxTypeCodeEnum$1["SalesTaxLowValueGoods"] = "05";
17
- TaxTypeCodeEnum$1["NotApplicable"] = "06";
18
- TaxTypeCodeEnum$1["TaxExemption"] = "E";
19
- return TaxTypeCodeEnum$1;
11
+ let StateCodeEnum = /* @__PURE__ */ function(StateCodeEnum$1) {
12
+ StateCodeEnum$1["Johor"] = "01";
13
+ StateCodeEnum$1["Kedah"] = "02";
14
+ StateCodeEnum$1["Kelantan"] = "03";
15
+ StateCodeEnum$1["Melaka"] = "04";
16
+ StateCodeEnum$1["NegeriSembilan"] = "05";
17
+ StateCodeEnum$1["Pahang"] = "06";
18
+ StateCodeEnum$1["PulauPinang"] = "07";
19
+ StateCodeEnum$1["Perak"] = "08";
20
+ StateCodeEnum$1["Perlis"] = "09";
21
+ StateCodeEnum$1["Selangor"] = "10";
22
+ StateCodeEnum$1["Terengganu"] = "11";
23
+ StateCodeEnum$1["Sabah"] = "12";
24
+ StateCodeEnum$1["Sarawak"] = "13";
25
+ StateCodeEnum$1["WPKualaLumpur"] = "14";
26
+ StateCodeEnum$1["WPLabuan"] = "15";
27
+ StateCodeEnum$1["WPPutrajaya"] = "16";
28
+ StateCodeEnum$1["NotApplicable"] = "17";
29
+ return StateCodeEnum$1;
20
30
  }({});
21
31
 
22
32
  //#endregion
23
- exports.TaxTypeCodeEnum = TaxTypeCodeEnum;
33
+ exports.StateCodeEnum = StateCodeEnum;
24
34
  //# sourceMappingURL=index12.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index12.cjs","names":[],"sources":["../src/types/tax-types.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for tax types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/tax-types/\n */\nexport type TaxTypeCode =\n | '01' // Sales Tax\n | '02' // Service Tax\n | '03' // Tourism Tax\n | '04' // High-Value Goods Tax\n | '05' // Sales Tax on Low Value Goods\n | '06' // Not Applicable\n | 'E' // Tax exemption (where applicable)\n\n/**\n * Enum representing the allowed tax type codes with descriptive names.\n * Provides a more readable way to reference tax types.\n *\n * @example\n * const code = TaxTypeCodeEnum.SalesTax;\n * console.log(code); // Output: \"01\"\n */\nexport enum TaxTypeCodeEnum {\n SalesTax = '01',\n ServiceTax = '02',\n TourismTax = '03',\n HighValueGoodsTax = '04',\n SalesTaxLowValueGoods = '05',\n NotApplicable = '06',\n TaxExemption = 'E',\n}\n\n/**\n * Interface representing a tax type entry.\n * Contains the code and its corresponding description.\n */\nexport interface TaxType {\n code: TaxTypeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
1
+ {"version":3,"file":"index12.cjs","names":[],"sources":["../src/types/state-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for Malaysian states and federal territories.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/state-codes/\n */\nexport type StateCode =\n | '01' // Johor\n | '02' // Kedah\n | '03' // Kelantan\n | '04' // Melaka\n | '05' // Negeri Sembilan\n | '06' // Pahang\n | '07' // Pulau Pinang\n | '08' // Perak\n | '09' // Perlis\n | '10' // Selangor\n | '11' // Terengganu\n | '12' // Sabah\n | '13' // Sarawak\n | '14' // Wilayah Persekutuan Kuala Lumpur\n | '15' // Wilayah Persekutuan Labuan\n | '16' // Wilayah Persekutuan Putrajaya\n | '17' // Not Applicable\n\n/**\n * Enum representing the allowed state codes with descriptive names.\n * Provides a more readable way to reference states.\n *\n * @example\n * const code = StateCodeEnum.Selangor;\n * console.log(code); // Output: \"10\"\n */\nexport enum StateCodeEnum {\n Johor = '01',\n Kedah = '02',\n Kelantan = '03',\n Melaka = '04',\n NegeriSembilan = '05',\n Pahang = '06',\n PulauPinang = '07',\n Perak = '08',\n Perlis = '09',\n Selangor = '10',\n Terengganu = '11',\n Sabah = '12',\n Sarawak = '13',\n WPKualaLumpur = '14',\n WPLabuan = '15',\n WPPutrajaya = '16',\n NotApplicable = '17',\n}\n\n/**\n * Interface representing a state code entry.\n * Contains the code and its corresponding name.\n */\nexport interface State {\n code: StateCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index13.cjs CHANGED
@@ -0,0 +1,24 @@
1
+
2
+ //#region src/types/tax-types.d.ts
3
+ /**
4
+ * Enum representing the allowed tax type codes with descriptive names.
5
+ * Provides a more readable way to reference tax types.
6
+ *
7
+ * @example
8
+ * const code = TaxTypeCodeEnum.SalesTax;
9
+ * console.log(code); // Output: "01"
10
+ */
11
+ let TaxTypeCodeEnum = /* @__PURE__ */ function(TaxTypeCodeEnum$1) {
12
+ TaxTypeCodeEnum$1["SalesTax"] = "01";
13
+ TaxTypeCodeEnum$1["ServiceTax"] = "02";
14
+ TaxTypeCodeEnum$1["TourismTax"] = "03";
15
+ TaxTypeCodeEnum$1["HighValueGoodsTax"] = "04";
16
+ TaxTypeCodeEnum$1["SalesTaxLowValueGoods"] = "05";
17
+ TaxTypeCodeEnum$1["NotApplicable"] = "06";
18
+ TaxTypeCodeEnum$1["TaxExemption"] = "E";
19
+ return TaxTypeCodeEnum$1;
20
+ }({});
21
+
22
+ //#endregion
23
+ exports.TaxTypeCodeEnum = TaxTypeCodeEnum;
24
+ //# sourceMappingURL=index13.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index13.cjs","names":[],"sources":["../src/types/tax-types.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for tax types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/tax-types/\n */\nexport type TaxTypeCode =\n | '01' // Sales Tax\n | '02' // Service Tax\n | '03' // Tourism Tax\n | '04' // High-Value Goods Tax\n | '05' // Sales Tax on Low Value Goods\n | '06' // Not Applicable\n | 'E' // Tax exemption (where applicable)\n\n/**\n * Enum representing the allowed tax type codes with descriptive names.\n * Provides a more readable way to reference tax types.\n *\n * @example\n * const code = TaxTypeCodeEnum.SalesTax;\n * console.log(code); // Output: \"01\"\n */\nexport enum TaxTypeCodeEnum {\n SalesTax = '01',\n ServiceTax = '02',\n TourismTax = '03',\n HighValueGoodsTax = '04',\n SalesTaxLowValueGoods = '05',\n NotApplicable = '06',\n TaxExemption = 'E',\n}\n\n/**\n * Interface representing a tax type entry.\n * Contains the code and its corresponding description.\n */\nexport interface TaxType {\n code: TaxTypeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index14.cjs CHANGED
@@ -1,13 +0,0 @@
1
-
2
- //#region src/utils/base64.ts
3
- function encodeToBase64(content) {
4
- return Buffer.from(content).toString("base64");
5
- }
6
- function decodeFromBase64(content) {
7
- return Buffer.from(content, "base64").toString("utf-8");
8
- }
9
-
10
- //#endregion
11
- exports.decodeFromBase64 = decodeFromBase64;
12
- exports.encodeToBase64 = encodeToBase64;
13
- //# sourceMappingURL=index14.cjs.map
package/dist/index15.cjs CHANGED
@@ -1,4 +0,0 @@
1
- const require_certificate = require('./certificate-DFK-788s.cjs');
2
-
3
- exports.extractCertificateInfo = require_certificate.extractCertificateInfo;
4
- exports.validateKeyPair = require_certificate.validateKeyPair;
package/dist/index16.cjs CHANGED
@@ -1,13 +0,0 @@
1
- const require_document = require('./document-CARHiGdp.cjs');
2
-
3
- exports.calculateCertificateDigest = require_document.calculateCertificateDigest;
4
- exports.calculateDocumentDigest = require_document.calculateDocumentDigest;
5
- exports.calculateSignedPropertiesDigest = require_document.calculateSignedPropertiesDigest;
6
- exports.canonicalizeJSON = require_document.canonicalizeJSON;
7
- exports.createSignedInfoAndSign = require_document.createSignedInfoAndSign;
8
- exports.createSignedProperties = require_document.createSignedProperties;
9
- exports.extractCertificateInfo = require_document.extractCertificateInfo;
10
- exports.generateCleanInvoiceObject = require_document.generateCleanInvoiceObject;
11
- exports.generateCleanUBLDocument = require_document.generateCleanUBLDocument;
12
- exports.generateCompleteDocument = require_document.generateCompleteDocument;
13
- exports.sortObjectKeys = require_document.sortObjectKeys;
package/dist/index17.cjs CHANGED
@@ -1,3 +1,5 @@
1
- const require_getBaseUrl = require('./getBaseUrl-CO7Jp27d.cjs');
1
+ const require_documentManagement = require('./documentManagement-DQ7JEcBq.cjs');
2
2
 
3
- exports.getBaseUrl = require_getBaseUrl.getBaseUrl;
3
+ exports.getDocument = require_documentManagement.getDocument;
4
+ exports.getDocumentDetails = require_documentManagement.getDocumentDetails;
5
+ exports.searchDocuments = require_documentManagement.searchDocuments;