@ripwords/myinvois-client 0.4.0 → 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.
Files changed (515) hide show
  1. package/dist/0X-Cr3M7hci.d.cts +211 -0
  2. package/dist/0X-bPhcc9Vv.d.ts +211 -0
  3. package/dist/1X-Bqi8dmY1.d.ts +20 -0
  4. package/dist/1X-CWwmfCzo.d.cts +112 -0
  5. package/dist/1X-DKHYQyRy.d.ts +112 -0
  6. package/dist/1X-DYw2tURz.d.cts +20 -0
  7. package/dist/2X-CXtqiwRg.d.cts +40 -0
  8. package/dist/2X-CemxuAeL.d.ts +40 -0
  9. package/dist/2X-DN6M21cV.d.ts +140 -0
  10. package/dist/2X-DNtkJ0tj.d.cts +140 -0
  11. package/dist/3X-BOxfatu3.d.cts +62 -0
  12. package/dist/3X-Bk_fUIAk.d.cts +21 -0
  13. package/dist/3X-DIYh_ue4.d.ts +21 -0
  14. package/dist/3X-DJRj5xLv.d.ts +62 -0
  15. package/dist/4X-BCvTomUF.d.ts +265 -0
  16. package/dist/4X-C7fzDWJ_.d.cts +265 -0
  17. package/dist/4X-CK9rj5qd.d.cts +31 -0
  18. package/dist/4X-CZi5nwIr.d.ts +31 -0
  19. package/dist/5X-CNAFsDm2.d.cts +77 -0
  20. package/dist/5X-CpAvNxvd.d.cts +22 -0
  21. package/dist/5X-Dji6Soz5.d.ts +77 -0
  22. package/dist/5X-DyYBCAvY.d.ts +22 -0
  23. package/dist/6X-CO_u4RIY.d.ts +105 -0
  24. package/dist/6X-Csxu6lwi.d.ts +16 -0
  25. package/dist/6X-bXWr_7xY.d.cts +16 -0
  26. package/dist/6X-uObUP4VG.d.cts +105 -0
  27. package/dist/7X-BJBOlWhV.d.cts +16 -0
  28. package/dist/7X-BifJnY24.d.cts +71 -0
  29. package/dist/7X-DivvfBsk.d.ts +16 -0
  30. package/dist/7X-vzJ01lNF.d.ts +71 -0
  31. package/dist/8X-C4Wf4jYK.d.ts +110 -0
  32. package/dist/8X-D_Pw1H3K.d.ts +19 -0
  33. package/dist/8X-DioBXCJ0.d.cts +110 -0
  34. package/dist/8X-dshwiOxU.d.cts +19 -0
  35. package/dist/9X-1VwxN9g-.d.ts +98 -0
  36. package/dist/9X-9j2Djy4W.d.cts +15 -0
  37. package/dist/9X-BjffnXuq.d.cts +98 -0
  38. package/dist/9X-BwR9pibT.d.ts +15 -0
  39. package/dist/AX-CDubGAZO.d.ts +111 -0
  40. package/dist/AX-CWCopjCC.d.cts +111 -0
  41. package/dist/BX-CBsKI8np.d.ts +115 -0
  42. package/dist/BX-Cq7WdhD3.d.cts +115 -0
  43. package/dist/CX-DhOdAFyg.d.ts +128 -0
  44. package/dist/CX-DlcVZfxx.d.cts +128 -0
  45. package/dist/DX-CBiRJGqR.d.ts +115 -0
  46. package/dist/DX-DLdv-Nxj.d.cts +115 -0
  47. package/dist/EX-CAn62WaX.d.ts +107 -0
  48. package/dist/EX-CIJv8-Lw.d.cts +107 -0
  49. package/dist/FX-CANpsLC4.d.ts +127 -0
  50. package/dist/FX-DlDM_Zea.d.cts +127 -0
  51. package/dist/GX-BFGNX6Jy.d.cts +136 -0
  52. package/dist/GX-BvSZZ8pE.d.ts +136 -0
  53. package/dist/HX-CxrnY-YC.d.ts +126 -0
  54. package/dist/HX-D7Y9qRSm.d.cts +126 -0
  55. package/dist/IX-DPTrbhgX.d.cts +23 -0
  56. package/dist/IX-wdAD6eW8.d.ts +23 -0
  57. package/dist/JX-B5v815to.d.ts +104 -0
  58. package/dist/JX-D8JmtNpo.d.cts +104 -0
  59. package/dist/KX-B46KJZrH.d.cts +151 -0
  60. package/dist/KX-BI8n7ACj.d.ts +151 -0
  61. package/dist/LX-BVvEz6Ji.d.ts +123 -0
  62. package/dist/LX-CfTKy8Sx.d.cts +123 -0
  63. package/dist/MX-BKJ4gNvV.d.cts +153 -0
  64. package/dist/MX-D_OsOP_v.d.ts +153 -0
  65. package/dist/NX-CSdLIFqU.d.cts +122 -0
  66. package/dist/NX-DIhAzAY3.d.ts +122 -0
  67. package/dist/OX-BZrRnj5g.d.ts +26 -0
  68. package/dist/OX-BwqOsulT.d.cts +26 -0
  69. package/dist/PX-BTx0TXsJ.d.cts +121 -0
  70. package/dist/PX-DGGrJNym.d.ts +121 -0
  71. package/dist/QX-BUXR8RJL.d.cts +59 -0
  72. package/dist/QX-DuTJFnHX.d.ts +59 -0
  73. package/dist/RX-CZ8HiH37.d.cts +23 -0
  74. package/dist/RX-DYQoV7am.d.ts +23 -0
  75. package/dist/SX-CLxsqiQk.d.cts +40 -0
  76. package/dist/SX-Dl1RlNnc.d.ts +40 -0
  77. package/dist/TX-DKc8hLc4.d.cts +31 -0
  78. package/dist/TX-SoIfFaZj.d.ts +31 -0
  79. package/dist/UX-DqBfrSsY.d.ts +18 -0
  80. package/dist/UX-bc7xDnZI.d.cts +18 -0
  81. package/dist/VX-Ahcpp3Si.d.ts +17 -0
  82. package/dist/VX-CIHTFyoC.d.cts +17 -0
  83. package/dist/WX-BHvlq7Jx.d.cts +26 -0
  84. package/dist/WX-Di6vYD7A.d.ts +26 -0
  85. package/dist/XX-BE4flzh6.d.ts +828 -0
  86. package/dist/XX-DztQxYHJ.d.cts +828 -0
  87. package/dist/YX-BPO04gSZ.d.ts +20 -0
  88. package/dist/YX-CkxLeFb4.d.cts +20 -0
  89. package/dist/ZX-DHu4FRKS.d.ts +22 -0
  90. package/dist/ZX-DVb_buNI.d.cts +22 -0
  91. package/dist/{index2.cjs → api/documentManagement.cjs} +1 -1
  92. package/dist/api/documentManagement.d.cts +90 -0
  93. package/dist/api/documentManagement.d.ts +90 -0
  94. package/dist/api/documentManagement.js +3 -0
  95. package/dist/{index3.cjs → api/documentSubmission.cjs} +3 -3
  96. package/dist/api/documentSubmission.d.cts +93 -0
  97. package/dist/api/documentSubmission.d.ts +93 -0
  98. package/dist/api/documentSubmission.js +5 -0
  99. package/dist/{index4.cjs → api/documentTypeManagement.cjs} +1 -1
  100. package/dist/api/documentTypeManagement.d.cts +71 -0
  101. package/dist/api/documentTypeManagement.d.ts +71 -0
  102. package/dist/api/documentTypeManagement.js +3 -0
  103. package/dist/api/notificationManagement.cjs +3 -0
  104. package/dist/api/notificationManagement.d.cts +69 -0
  105. package/dist/api/notificationManagement.d.ts +69 -0
  106. package/dist/api/notificationManagement.js +3 -0
  107. package/dist/api/platformLogin.cjs +3 -0
  108. package/dist/api/platformLogin.d.cts +69 -0
  109. package/dist/api/platformLogin.d.ts +69 -0
  110. package/dist/api/platformLogin.js +3 -0
  111. package/dist/api/taxpayerValidation.cjs +6 -0
  112. package/dist/api/taxpayerValidation.d.cts +72 -0
  113. package/dist/api/taxpayerValidation.d.ts +72 -0
  114. package/dist/api/taxpayerValidation.js +4 -0
  115. package/dist/apiQueue-B6Q644Bz.js +202 -0
  116. package/dist/apiQueue-B6Q644Bz.js.map +1 -0
  117. package/dist/certificate-Cg6spxUs.js +52 -0
  118. package/dist/certificate-Cg6spxUs.js.map +1 -0
  119. package/dist/classification-codes-B15PbWxz.d.cts +118 -0
  120. package/dist/classification-codes-BQMnAQFr.d.ts +118 -0
  121. package/dist/country-code-DAejE5RV.d.ts +543 -0
  122. package/dist/country-code-DPeNFMMi.d.cts +543 -0
  123. package/dist/currencies-Cg9RkxRB.d.ts +208 -0
  124. package/dist/currencies-S5g1gzBU.d.cts +208 -0
  125. package/dist/document-BC52NCdW.js +653 -0
  126. package/dist/document-BC52NCdW.js.map +1 -0
  127. package/dist/document-BQdoGqOl.d.cts +157 -0
  128. package/dist/document-CnamySca.d.ts +157 -0
  129. package/dist/documentManagement-DZKm582-.js +51 -0
  130. package/dist/documentManagement-DZKm582-.js.map +1 -0
  131. package/dist/documentSubmission-DSsX0ldK.js +136 -0
  132. package/dist/documentSubmission-DSsX0ldK.js.map +1 -0
  133. package/dist/documentTypeManagement-cBtVCOY3.js +23 -0
  134. package/dist/documentTypeManagement-cBtVCOY3.js.map +1 -0
  135. package/dist/documents-BpZn3hJq.d.ts +1197 -0
  136. package/dist/documents-D_V38Q_U.d.cts +1197 -0
  137. package/dist/e-invoice-BSCFsH-H.d.ts +44 -0
  138. package/dist/e-invoice-BuwtFnlI.d.cts +44 -0
  139. package/dist/formatIdValue-qTxJqj9o.js +8 -0
  140. package/dist/formatIdValue-qTxJqj9o.js.map +1 -0
  141. package/dist/getBaseUrl-D7nUmoYb.js +8 -0
  142. package/dist/getBaseUrl-D7nUmoYb.js.map +1 -0
  143. package/dist/index-Dn3JIREW.d.ts +16 -0
  144. package/dist/index-Yr1QAbIF.d.cts +16 -0
  145. package/dist/index.d.cts +616 -0
  146. package/dist/index.d.ts +616 -0
  147. package/dist/index.js +629 -0
  148. package/dist/index.js.map +1 -0
  149. package/dist/lineItems-Btjkf6VX.js +58 -0
  150. package/dist/lineItems-Btjkf6VX.js.map +1 -0
  151. package/dist/lineItems-CBSo7giH.d.cts +32 -0
  152. package/dist/lineItems-CrkEXi2m.d.ts +32 -0
  153. package/dist/msic-codes-CIKdPqag.d.cts +26 -0
  154. package/dist/msic-codes-kysVPGdN.d.ts +26 -0
  155. package/dist/notificationManagement-n4Z5e-My.js +20 -0
  156. package/dist/notificationManagement-n4Z5e-My.js.map +1 -0
  157. package/dist/notifications-B4BymhRJ.d.ts +63 -0
  158. package/dist/notifications-DdlEkprb.d.cts +63 -0
  159. package/dist/payment-modes-7c1lWlIr.d.cts +44 -0
  160. package/dist/payment-modes-BGP5McTY.d.ts +44 -0
  161. package/dist/platformLogin-CqI9OLYP.js +40 -0
  162. package/dist/platformLogin-CqI9OLYP.js.map +1 -0
  163. package/dist/signatures-Bk5aKcq6.d.ts +173 -0
  164. package/dist/signatures-CyDSZr_e.d.cts +173 -0
  165. package/dist/state-codes-CAkYQnTd.d.ts +62 -0
  166. package/dist/state-codes-u3ppueWo.d.cts +62 -0
  167. package/dist/tax-types-QeZFKqew.d.ts +42 -0
  168. package/dist/tax-types-fu5Q6dic.d.cts +42 -0
  169. package/dist/taxpayer-B1CSMqNS.d.ts +36 -0
  170. package/dist/taxpayer-DwGzY1IL.d.cts +36 -0
  171. package/dist/taxpayerValidation-Xd_EHDvk.js +48 -0
  172. package/dist/taxpayerValidation-Xd_EHDvk.js.map +1 -0
  173. package/dist/{index17.cjs → types/classification-codes.d.cjs} +1 -1
  174. package/dist/types/classification-codes.d.cjs.map +1 -0
  175. package/dist/types/classification-codes.d.cts +2 -0
  176. package/dist/types/classification-codes.d.ts +2 -0
  177. package/dist/{index18.cjs → types/country-code.d.cjs} +1 -1
  178. package/dist/types/country-code.d.cjs.map +1 -0
  179. package/dist/types/country-code.d.cts +2 -0
  180. package/dist/types/country-code.d.ts +2 -0
  181. package/dist/{index19.cjs → types/currencies.d.cjs} +1 -1
  182. package/dist/types/currencies.d.cjs.map +1 -0
  183. package/dist/types/currencies.d.cts +2 -0
  184. package/dist/types/currencies.d.ts +2 -0
  185. package/dist/types/documents.d.cts +55 -0
  186. package/dist/types/documents.d.ts +55 -0
  187. package/dist/{index21.cjs → types/e-invoice.d.cjs} +1 -1
  188. package/dist/types/e-invoice.d.cjs.map +1 -0
  189. package/dist/types/e-invoice.d.cts +2 -0
  190. package/dist/types/e-invoice.d.ts +2 -0
  191. package/dist/types/index.d.cts +61 -0
  192. package/dist/types/index.d.ts +61 -0
  193. package/dist/{index32.cjs → types/msic/0X.d.cjs} +1 -1
  194. package/dist/types/msic/0X.d.cjs.map +1 -0
  195. package/dist/types/msic/0X.d.cts +2 -0
  196. package/dist/types/msic/0X.d.ts +2 -0
  197. package/dist/{index33.cjs → types/msic/1X.d.cjs} +1 -1
  198. package/dist/types/msic/1X.d.cjs.map +1 -0
  199. package/dist/types/msic/1X.d.cts +2 -0
  200. package/dist/types/msic/1X.d.ts +2 -0
  201. package/dist/{index34.cjs → types/msic/2X.d.cjs} +1 -1
  202. package/dist/types/msic/2X.d.cjs.map +1 -0
  203. package/dist/types/msic/2X.d.cts +2 -0
  204. package/dist/types/msic/2X.d.ts +2 -0
  205. package/dist/{index35.cjs → types/msic/3X.d.cjs} +1 -1
  206. package/dist/types/msic/3X.d.cjs.map +1 -0
  207. package/dist/types/msic/3X.d.cts +2 -0
  208. package/dist/types/msic/3X.d.ts +2 -0
  209. package/dist/{index36.cjs → types/msic/4X.d.cjs} +1 -1
  210. package/dist/types/msic/4X.d.cjs.map +1 -0
  211. package/dist/types/msic/4X.d.cts +2 -0
  212. package/dist/types/msic/4X.d.ts +2 -0
  213. package/dist/{index37.cjs → types/msic/5X.d.cjs} +1 -1
  214. package/dist/types/msic/5X.d.cjs.map +1 -0
  215. package/dist/types/msic/5X.d.cts +2 -0
  216. package/dist/types/msic/5X.d.ts +2 -0
  217. package/dist/{index38.cjs → types/msic/6X.d.cjs} +1 -1
  218. package/dist/types/msic/6X.d.cjs.map +1 -0
  219. package/dist/types/msic/6X.d.cts +2 -0
  220. package/dist/types/msic/6X.d.ts +2 -0
  221. package/dist/{index39.cjs → types/msic/7X.d.cjs} +1 -1
  222. package/dist/types/msic/7X.d.cjs.map +1 -0
  223. package/dist/types/msic/7X.d.cts +2 -0
  224. package/dist/types/msic/7X.d.ts +2 -0
  225. package/dist/{index40.cjs → types/msic/8X.d.cjs} +1 -1
  226. package/dist/types/msic/8X.d.cjs.map +1 -0
  227. package/dist/types/msic/8X.d.cts +2 -0
  228. package/dist/types/msic/8X.d.ts +2 -0
  229. package/dist/{index41.cjs → types/msic/9X.d.cjs} +1 -1
  230. package/dist/types/msic/9X.d.cjs.map +1 -0
  231. package/dist/types/msic/9X.d.cts +2 -0
  232. package/dist/types/msic/9X.d.ts +2 -0
  233. package/dist/types/msic-codes.d.cts +12 -0
  234. package/dist/types/msic-codes.d.ts +12 -0
  235. package/dist/{index24.cjs → types/notifications.d.cjs} +1 -1
  236. package/dist/types/notifications.d.cjs.map +1 -0
  237. package/dist/types/notifications.d.cts +2 -0
  238. package/dist/types/notifications.d.ts +2 -0
  239. package/dist/{index25.cjs → types/payment-modes.d.cjs} +1 -1
  240. package/dist/types/payment-modes.d.cjs.map +1 -0
  241. package/dist/types/payment-modes.d.cts +2 -0
  242. package/dist/types/payment-modes.d.ts +2 -0
  243. package/dist/types/signatures.d.cts +2 -0
  244. package/dist/types/signatures.d.ts +2 -0
  245. package/dist/{index27.cjs → types/state-codes.d.cjs} +1 -1
  246. package/dist/types/state-codes.d.cjs.map +1 -0
  247. package/dist/types/state-codes.d.cts +2 -0
  248. package/dist/types/state-codes.d.ts +2 -0
  249. package/dist/{index28.cjs → types/tax-types.d.cjs} +1 -1
  250. package/dist/types/tax-types.d.cjs.map +1 -0
  251. package/dist/types/tax-types.d.cts +2 -0
  252. package/dist/types/tax-types.d.ts +2 -0
  253. package/dist/types/taxpayer.d.cts +56 -0
  254. package/dist/types/taxpayer.d.ts +56 -0
  255. package/dist/{index42.cjs → types/unit/1X.d.cjs} +1 -1
  256. package/dist/types/unit/1X.d.cjs.map +1 -0
  257. package/dist/types/unit/1X.d.cts +2 -0
  258. package/dist/types/unit/1X.d.ts +2 -0
  259. package/dist/{index43.cjs → types/unit/2X.d.cjs} +1 -1
  260. package/dist/types/unit/2X.d.cjs.map +1 -0
  261. package/dist/types/unit/2X.d.cts +2 -0
  262. package/dist/types/unit/2X.d.ts +2 -0
  263. package/dist/{index44.cjs → types/unit/3X.d.cjs} +1 -1
  264. package/dist/types/unit/3X.d.cjs.map +1 -0
  265. package/dist/types/unit/3X.d.cts +2 -0
  266. package/dist/types/unit/3X.d.ts +2 -0
  267. package/dist/{index45.cjs → types/unit/4X.d.cjs} +1 -1
  268. package/dist/types/unit/4X.d.cjs.map +1 -0
  269. package/dist/types/unit/4X.d.cts +2 -0
  270. package/dist/types/unit/4X.d.ts +2 -0
  271. package/dist/{index46.cjs → types/unit/5X.d.cjs} +1 -1
  272. package/dist/types/unit/5X.d.cjs.map +1 -0
  273. package/dist/types/unit/5X.d.cts +2 -0
  274. package/dist/types/unit/5X.d.ts +2 -0
  275. package/dist/{index47.cjs → types/unit/6X.d.cjs} +1 -1
  276. package/dist/types/unit/6X.d.cjs.map +1 -0
  277. package/dist/types/unit/6X.d.cts +2 -0
  278. package/dist/types/unit/6X.d.ts +2 -0
  279. package/dist/{index48.cjs → types/unit/7X.d.cjs} +1 -1
  280. package/dist/types/unit/7X.d.cjs.map +1 -0
  281. package/dist/types/unit/7X.d.cts +2 -0
  282. package/dist/types/unit/7X.d.ts +2 -0
  283. package/dist/{index49.cjs → types/unit/8X.d.cjs} +1 -1
  284. package/dist/types/unit/8X.d.cjs.map +1 -0
  285. package/dist/types/unit/8X.d.cts +2 -0
  286. package/dist/types/unit/8X.d.ts +2 -0
  287. package/dist/{index50.cjs → types/unit/9X.d.cjs} +1 -1
  288. package/dist/types/unit/9X.d.cjs.map +1 -0
  289. package/dist/types/unit/9X.d.cts +2 -0
  290. package/dist/types/unit/9X.d.ts +2 -0
  291. package/dist/{index51.cjs → types/unit/AX.d.cjs} +1 -1
  292. package/dist/types/unit/AX.d.cjs.map +1 -0
  293. package/dist/types/unit/AX.d.cts +2 -0
  294. package/dist/types/unit/AX.d.ts +2 -0
  295. package/dist/{index52.cjs → types/unit/BX.d.cjs} +1 -1
  296. package/dist/types/unit/BX.d.cjs.map +1 -0
  297. package/dist/types/unit/BX.d.cts +2 -0
  298. package/dist/types/unit/BX.d.ts +2 -0
  299. package/dist/{index53.cjs → types/unit/CX.d.cjs} +1 -1
  300. package/dist/types/unit/CX.d.cjs.map +1 -0
  301. package/dist/types/unit/CX.d.cts +2 -0
  302. package/dist/types/unit/CX.d.ts +2 -0
  303. package/dist/{index54.cjs → types/unit/DX.d.cjs} +1 -1
  304. package/dist/types/unit/DX.d.cjs.map +1 -0
  305. package/dist/types/unit/DX.d.cts +2 -0
  306. package/dist/types/unit/DX.d.ts +2 -0
  307. package/dist/{index55.cjs → types/unit/EX.d.cjs} +1 -1
  308. package/dist/types/unit/EX.d.cjs.map +1 -0
  309. package/dist/types/unit/EX.d.cts +2 -0
  310. package/dist/types/unit/EX.d.ts +2 -0
  311. package/dist/{index56.cjs → types/unit/FX.d.cjs} +1 -1
  312. package/dist/types/unit/FX.d.cjs.map +1 -0
  313. package/dist/types/unit/FX.d.cts +2 -0
  314. package/dist/types/unit/FX.d.ts +2 -0
  315. package/dist/{index57.cjs → types/unit/GX.d.cjs} +1 -1
  316. package/dist/types/unit/GX.d.cjs.map +1 -0
  317. package/dist/types/unit/GX.d.cts +2 -0
  318. package/dist/types/unit/GX.d.ts +2 -0
  319. package/dist/{index58.cjs → types/unit/HX.d.cjs} +1 -1
  320. package/dist/types/unit/HX.d.cjs.map +1 -0
  321. package/dist/types/unit/HX.d.cts +2 -0
  322. package/dist/types/unit/HX.d.ts +2 -0
  323. package/dist/{index59.cjs → types/unit/IX.d.cjs} +1 -1
  324. package/dist/types/unit/IX.d.cjs.map +1 -0
  325. package/dist/types/unit/IX.d.cts +2 -0
  326. package/dist/types/unit/IX.d.ts +2 -0
  327. package/dist/{index60.cjs → types/unit/JX.d.cjs} +1 -1
  328. package/dist/types/unit/JX.d.cjs.map +1 -0
  329. package/dist/types/unit/JX.d.cts +2 -0
  330. package/dist/types/unit/JX.d.ts +2 -0
  331. package/dist/{index61.cjs → types/unit/KX.d.cjs} +1 -1
  332. package/dist/types/unit/KX.d.cjs.map +1 -0
  333. package/dist/types/unit/KX.d.cts +2 -0
  334. package/dist/types/unit/KX.d.ts +2 -0
  335. package/dist/{index62.cjs → types/unit/LX.d.cjs} +1 -1
  336. package/dist/types/unit/LX.d.cjs.map +1 -0
  337. package/dist/types/unit/LX.d.cts +2 -0
  338. package/dist/types/unit/LX.d.ts +2 -0
  339. package/dist/{index63.cjs → types/unit/MX.d.cjs} +1 -1
  340. package/dist/types/unit/MX.d.cjs.map +1 -0
  341. package/dist/types/unit/MX.d.cts +2 -0
  342. package/dist/types/unit/MX.d.ts +2 -0
  343. package/dist/{index64.cjs → types/unit/NX.d.cjs} +1 -1
  344. package/dist/types/unit/NX.d.cjs.map +1 -0
  345. package/dist/types/unit/NX.d.cts +2 -0
  346. package/dist/types/unit/NX.d.ts +2 -0
  347. package/dist/{index65.cjs → types/unit/OX.d.cjs} +1 -1
  348. package/dist/types/unit/OX.d.cjs.map +1 -0
  349. package/dist/types/unit/OX.d.cts +2 -0
  350. package/dist/types/unit/OX.d.ts +2 -0
  351. package/dist/{index66.cjs → types/unit/PX.d.cjs} +1 -1
  352. package/dist/types/unit/PX.d.cjs.map +1 -0
  353. package/dist/types/unit/PX.d.cts +2 -0
  354. package/dist/types/unit/PX.d.ts +2 -0
  355. package/dist/{index67.cjs → types/unit/QX.d.cjs} +1 -1
  356. package/dist/types/unit/QX.d.cjs.map +1 -0
  357. package/dist/types/unit/QX.d.cts +2 -0
  358. package/dist/types/unit/QX.d.ts +2 -0
  359. package/dist/{index68.cjs → types/unit/RX.d.cjs} +1 -1
  360. package/dist/types/unit/RX.d.cjs.map +1 -0
  361. package/dist/types/unit/RX.d.cts +2 -0
  362. package/dist/types/unit/RX.d.ts +2 -0
  363. package/dist/{index69.cjs → types/unit/SX.d.cjs} +1 -1
  364. package/dist/types/unit/SX.d.cjs.map +1 -0
  365. package/dist/types/unit/SX.d.cts +2 -0
  366. package/dist/types/unit/SX.d.ts +2 -0
  367. package/dist/{index70.cjs → types/unit/TX.d.cjs} +1 -1
  368. package/dist/types/unit/TX.d.cjs.map +1 -0
  369. package/dist/types/unit/TX.d.cts +2 -0
  370. package/dist/types/unit/TX.d.ts +2 -0
  371. package/dist/{index71.cjs → types/unit/UX.d.cjs} +1 -1
  372. package/dist/types/unit/UX.d.cjs.map +1 -0
  373. package/dist/types/unit/UX.d.cts +2 -0
  374. package/dist/types/unit/UX.d.ts +2 -0
  375. package/dist/{index72.cjs → types/unit/VX.d.cjs} +1 -1
  376. package/dist/types/unit/VX.d.cjs.map +1 -0
  377. package/dist/types/unit/VX.d.cts +2 -0
  378. package/dist/types/unit/VX.d.ts +2 -0
  379. package/dist/{index73.cjs → types/unit/WX.d.cjs} +1 -1
  380. package/dist/types/unit/WX.d.cjs.map +1 -0
  381. package/dist/types/unit/WX.d.cts +2 -0
  382. package/dist/types/unit/WX.d.ts +2 -0
  383. package/dist/{index74.cjs → types/unit/XX.d.cjs} +1 -1
  384. package/dist/types/unit/XX.d.cjs.map +1 -0
  385. package/dist/types/unit/XX.d.cts +2 -0
  386. package/dist/types/unit/XX.d.ts +2 -0
  387. package/dist/{index75.cjs → types/unit/YX.d.cjs} +1 -1
  388. package/dist/types/unit/YX.d.cjs.map +1 -0
  389. package/dist/types/unit/YX.d.cts +2 -0
  390. package/dist/types/unit/YX.d.ts +2 -0
  391. package/dist/{index76.cjs → types/unit/ZX.d.cjs} +1 -1
  392. package/dist/types/unit/ZX.d.cjs.map +1 -0
  393. package/dist/types/unit/ZX.d.cts +2 -0
  394. package/dist/types/unit/ZX.d.ts +2 -0
  395. package/dist/types/unit-types.d.cts +37 -0
  396. package/dist/types/unit-types.d.ts +37 -0
  397. package/dist/types/utils.d.cts +2 -0
  398. package/dist/types/utils.d.ts +2 -0
  399. package/dist/unit-types-BXdufGWm.d.cts +56 -0
  400. package/dist/unit-types-CZdxXbVN.d.ts +56 -0
  401. package/dist/{index8.cjs → utils/apiQueue.cjs} +1 -1
  402. package/dist/utils/apiQueue.d.cts +46 -0
  403. package/dist/utils/apiQueue.d.ts +46 -0
  404. package/dist/utils/apiQueue.js +3 -0
  405. package/dist/{index9.cjs → utils/base64.cjs} +1 -1
  406. package/dist/utils/base64.cjs.map +1 -0
  407. package/dist/utils/base64.d.cts +6 -0
  408. package/dist/utils/base64.d.ts +6 -0
  409. package/dist/utils/base64.js +11 -0
  410. package/dist/utils/base64.js.map +1 -0
  411. package/dist/utils/certificate.cjs +7 -0
  412. package/dist/utils/certificate.d.cts +78 -0
  413. package/dist/utils/certificate.d.ts +78 -0
  414. package/dist/utils/certificate.js +5 -0
  415. package/dist/{index11.cjs → utils/document.cjs} +2 -2
  416. package/dist/utils/document.d.cts +62 -0
  417. package/dist/utils/document.d.ts +62 -0
  418. package/dist/utils/document.js +4 -0
  419. package/dist/utils/formatIdValue.cjs +3 -0
  420. package/dist/utils/formatIdValue.d.cts +5 -0
  421. package/dist/utils/formatIdValue.d.ts +5 -0
  422. package/dist/utils/formatIdValue.js +3 -0
  423. package/dist/utils/getBaseUrl.cjs +3 -0
  424. package/dist/utils/getBaseUrl.d.cts +5 -0
  425. package/dist/utils/getBaseUrl.d.ts +5 -0
  426. package/dist/utils/getBaseUrl.js +3 -0
  427. package/dist/utils/lineItems.cjs +3 -0
  428. package/dist/utils/lineItems.d.cts +62 -0
  429. package/dist/utils/lineItems.d.ts +62 -0
  430. package/dist/utils/lineItems.js +3 -0
  431. package/dist/{index15.cjs → utils/signature-diagnostics.cjs} +3 -3
  432. package/dist/utils/signature-diagnostics.cjs.map +1 -0
  433. package/dist/utils/signature-diagnostics.d.cts +97 -0
  434. package/dist/utils/signature-diagnostics.d.ts +97 -0
  435. package/dist/utils/signature-diagnostics.js +328 -0
  436. package/dist/utils/signature-diagnostics.js.map +1 -0
  437. package/dist/{index16.cjs → utils/validation.cjs} +1 -1
  438. package/dist/utils/validation.cjs.map +1 -0
  439. package/dist/utils/validation.d.cts +109 -0
  440. package/dist/utils/validation.d.ts +109 -0
  441. package/dist/utils/validation.js +187 -0
  442. package/dist/utils/validation.js.map +1 -0
  443. package/dist/utils-BYVq373g.d.ts +5 -0
  444. package/dist/utils-Cdqbbzca.d.cts +5 -0
  445. package/package.json +17 -7
  446. package/dist/index10.cjs +0 -7
  447. package/dist/index12.cjs +0 -3
  448. package/dist/index13.cjs +0 -3
  449. package/dist/index14.cjs +0 -3
  450. package/dist/index15.cjs.map +0 -1
  451. package/dist/index16.cjs.map +0 -1
  452. package/dist/index17.cjs.map +0 -1
  453. package/dist/index18.cjs.map +0 -1
  454. package/dist/index19.cjs.map +0 -1
  455. package/dist/index21.cjs.map +0 -1
  456. package/dist/index24.cjs.map +0 -1
  457. package/dist/index25.cjs.map +0 -1
  458. package/dist/index27.cjs.map +0 -1
  459. package/dist/index28.cjs.map +0 -1
  460. package/dist/index32.cjs.map +0 -1
  461. package/dist/index33.cjs.map +0 -1
  462. package/dist/index34.cjs.map +0 -1
  463. package/dist/index35.cjs.map +0 -1
  464. package/dist/index36.cjs.map +0 -1
  465. package/dist/index37.cjs.map +0 -1
  466. package/dist/index38.cjs.map +0 -1
  467. package/dist/index39.cjs.map +0 -1
  468. package/dist/index40.cjs.map +0 -1
  469. package/dist/index41.cjs.map +0 -1
  470. package/dist/index42.cjs.map +0 -1
  471. package/dist/index43.cjs.map +0 -1
  472. package/dist/index44.cjs.map +0 -1
  473. package/dist/index45.cjs.map +0 -1
  474. package/dist/index46.cjs.map +0 -1
  475. package/dist/index47.cjs.map +0 -1
  476. package/dist/index48.cjs.map +0 -1
  477. package/dist/index49.cjs.map +0 -1
  478. package/dist/index5.cjs +0 -3
  479. package/dist/index50.cjs.map +0 -1
  480. package/dist/index51.cjs.map +0 -1
  481. package/dist/index52.cjs.map +0 -1
  482. package/dist/index53.cjs.map +0 -1
  483. package/dist/index54.cjs.map +0 -1
  484. package/dist/index55.cjs.map +0 -1
  485. package/dist/index56.cjs.map +0 -1
  486. package/dist/index57.cjs.map +0 -1
  487. package/dist/index58.cjs.map +0 -1
  488. package/dist/index59.cjs.map +0 -1
  489. package/dist/index6.cjs +0 -3
  490. package/dist/index60.cjs.map +0 -1
  491. package/dist/index61.cjs.map +0 -1
  492. package/dist/index62.cjs.map +0 -1
  493. package/dist/index63.cjs.map +0 -1
  494. package/dist/index64.cjs.map +0 -1
  495. package/dist/index65.cjs.map +0 -1
  496. package/dist/index66.cjs.map +0 -1
  497. package/dist/index67.cjs.map +0 -1
  498. package/dist/index68.cjs.map +0 -1
  499. package/dist/index69.cjs.map +0 -1
  500. package/dist/index7.cjs +0 -6
  501. package/dist/index70.cjs.map +0 -1
  502. package/dist/index71.cjs.map +0 -1
  503. package/dist/index72.cjs.map +0 -1
  504. package/dist/index73.cjs.map +0 -1
  505. package/dist/index74.cjs.map +0 -1
  506. package/dist/index75.cjs.map +0 -1
  507. package/dist/index76.cjs.map +0 -1
  508. package/dist/index9.cjs.map +0 -1
  509. /package/dist/{index20.cjs → types/documents.d.cjs} +0 -0
  510. /package/dist/{index22.cjs → types/index.d.cjs} +0 -0
  511. /package/dist/{index23.cjs → types/msic-codes.d.cjs} +0 -0
  512. /package/dist/{index26.cjs → types/signatures.d.cjs} +0 -0
  513. /package/dist/{index29.cjs → types/taxpayer.d.cjs} +0 -0
  514. /package/dist/{index30.cjs → types/unit-types.d.cjs} +0 -0
  515. /package/dist/{index31.cjs → types/utils.d.cjs} +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,629 @@
1
+ import { getDocument, getDocumentDetails, searchDocuments } from "./documentManagement-DZKm582-.js";
2
+ import "./formatIdValue-qTxJqj9o.js";
3
+ import { extractCertificateInfo } from "./document-BC52NCdW.js";
4
+ import { getSubmissionStatus, performDocumentAction, submitDocument } from "./documentSubmission-DSsX0ldK.js";
5
+ import { getDocumentType, getDocumentTypeVersion, getDocumentTypes } from "./documentTypeManagement-cBtVCOY3.js";
6
+ import { getNotifications } from "./notificationManagement-n4Z5e-My.js";
7
+ import { platformLogin } from "./platformLogin-CqI9OLYP.js";
8
+ import { taxpayerQRCode, tinSearch, verifyTin } from "./taxpayerValidation-Xd_EHDvk.js";
9
+ import { getPemFromP12, validateKeyPair } from "./certificate-Cg6spxUs.js";
10
+ import { getBaseUrl } from "./getBaseUrl-D7nUmoYb.js";
11
+ import { categorizeRequest, queueRequest } from "./apiQueue-B6Q644Bz.js";
12
+ import { aggregateLineItemsByTaxCategory } from "./lineItems-Btjkf6VX.js";
13
+
14
+ //#region src/index.ts
15
+ var MyInvoisClient = class MyInvoisClient {
16
+ baseUrl;
17
+ clientId;
18
+ clientSecret;
19
+ environment;
20
+ onBehalfOf;
21
+ signingCredentials;
22
+ debug;
23
+ token = "";
24
+ tokenExpiration = void 0;
25
+ requestCount = 0;
26
+ constructor(clientId, clientSecret, environment, certificatePem, privateKeyPem, onBehalfOf, debug) {
27
+ if (!privateKeyPem || !certificatePem) throw new Error("Missing required environment variables: PRIVATE_KEY and CERTIFICATE");
28
+ if (!validateKeyPair(certificatePem, privateKeyPem)) throw new Error("Certificate and private key do not match");
29
+ this.clientId = clientId;
30
+ this.clientSecret = clientSecret;
31
+ this.baseUrl = getBaseUrl(environment);
32
+ this.environment = environment;
33
+ this.onBehalfOf = onBehalfOf;
34
+ this.debug = debug ?? process.env.MYINVOIS_DEBUG === "true" ? true : false;
35
+ const { issuerName, serialNumber } = extractCertificateInfo(certificatePem);
36
+ this.signingCredentials = {
37
+ privateKeyPem,
38
+ certificatePem,
39
+ issuerName,
40
+ serialNumber
41
+ };
42
+ }
43
+ async updateOnBehalfOf(onBehalfOf) {
44
+ this.onBehalfOf = onBehalfOf;
45
+ await this.refreshToken();
46
+ return;
47
+ }
48
+ async refreshToken() {
49
+ const tokenResponse = await platformLogin({
50
+ clientId: this.clientId,
51
+ clientSecret: this.clientSecret,
52
+ baseUrl: this.baseUrl,
53
+ onBehalfOf: this.onBehalfOf,
54
+ debug: this.debug
55
+ });
56
+ this.token = tokenResponse.token;
57
+ this.tokenExpiration = tokenResponse.tokenExpiration;
58
+ }
59
+ async getToken() {
60
+ if (!this.tokenExpiration || this.tokenExpiration < /* @__PURE__ */ new Date() || isNaN(this.tokenExpiration.getTime())) {
61
+ if (this.debug) {
62
+ console.log("Token expired");
63
+ console.log("Refreshing token");
64
+ }
65
+ await this.refreshToken();
66
+ }
67
+ return this.token;
68
+ }
69
+ async fetch(path, options = {}) {
70
+ this.requestCount++;
71
+ if (this.debug) console.log(`[fetch] Request count: ${this.requestCount}`);
72
+ const token = await this.getToken();
73
+ const category = categorizeRequest(path, options?.method);
74
+ return queueRequest(this.clientId, category, () => fetch(`${this.baseUrl}${path}`, {
75
+ ...options,
76
+ headers: {
77
+ ...options.headers,
78
+ Authorization: `Bearer ${token}`
79
+ }
80
+ }), this.debug);
81
+ }
82
+ /**
83
+ * Validates a TIN against a NRIC/ARMY/PASSPORT/BRN (Business Registration Number)
84
+ *
85
+ * This method verifies if a given Tax Identification Number (TIN) is valid by checking it against
86
+ * the provided identification type and value through the MyInvois platform's validation service.
87
+ *
88
+ * @param tin - The TIN to validate
89
+ * @param idType - The type of ID to validate against ('NRIC', 'ARMY', 'PASSPORT', or 'BRN')
90
+ * @param idValue - The value of the ID to validate against
91
+ * @returns Promise resolving to true if the TIN is valid, false otherwise
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * // Validate TIN against NRIC
96
+ * const isValid = await client.verifyTin('C12345678901234', 'NRIC', '123456789012');
97
+ * if (isValid) {
98
+ * console.log('TIN is valid');
99
+ * }
100
+ *
101
+ * // Validate TIN against Business Registration Number
102
+ * const isValidBusiness = await client.verifyTin('C98765432109876', 'BRN', '123456-K');
103
+ * ```
104
+ *
105
+ * @remarks
106
+ * - Returns false if validation fails due to network errors or invalid credentials
107
+ * - Debug mode provides error logging for troubleshooting validation failures
108
+ * - This is a non-blocking validation that won't throw exceptions on failure
109
+ */
110
+ async verifyTin(tin, idType, idValue) {
111
+ return verifyTin({
112
+ fetch: this.fetch.bind(this),
113
+ debug: this.debug
114
+ }, tin, idType, idValue);
115
+ }
116
+ /**
117
+ * Searches for a Tax Identification Number (TIN) using taxpayer information.
118
+ *
119
+ * This method allows searching for a TIN using either a taxpayer name or a combination
120
+ * of identification type and value. The search is flexible and supports multiple
121
+ * identification types including NRIC, ARMY, PASSPORT, and BRN.
122
+ *
123
+ * @param params - Search parameters object
124
+ * @param params.taxpayerName - Optional name of the taxpayer to search for
125
+ * @param params.idType - Optional type of ID to search with (NRIC, ARMY, PASSPORT, BRN)
126
+ * @param params.idValue - Optional value of the ID to search with
127
+ * @returns Promise resolving to TIN search response or standard error
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * // Search by taxpayer name
132
+ * const result = await client.searchTin({ taxpayerName: 'John Doe' });
133
+ * if ('tin' in result) {
134
+ * console.log('Found TIN:', result.tin);
135
+ * }
136
+ *
137
+ * // Search by ID type and value
138
+ * const result = await client.searchTin({
139
+ * idType: 'NRIC',
140
+ * idValue: '123456789012'
141
+ * });
142
+ * ```
143
+ *
144
+ * @remarks
145
+ * - Either taxpayerName or both idType and idValue must be provided
146
+ * - Returns StandardError object if search criteria are invalid or inconclusive
147
+ * - Debug mode provides detailed error logging for troubleshooting
148
+ * - Search results are not guaranteed to be unique
149
+ */
150
+ async searchTin(params) {
151
+ return tinSearch({
152
+ fetch: this.fetch.bind(this),
153
+ debug: this.debug
154
+ }, params);
155
+ }
156
+ /**
157
+ * Retrieves taxpayer information from a QR code.
158
+ *
159
+ * This method decodes a QR code containing taxpayer information and returns
160
+ * detailed taxpayer data including TIN, name, contact details, and business information.
161
+ *
162
+ * @param qrCodeText - The QR code text to decode
163
+ * @returns Promise resolving to taxpayer QR code response or standard error
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * // Get taxpayer info from QR code
168
+ * const taxpayerInfo = await client.getTaxpayerQRCode('QR_CODE_TEXT');
169
+ * if ('tin' in taxpayerInfo) {
170
+ * console.log('Taxpayer TIN:', taxpayerInfo.tin);
171
+ * console.log('Business Name:', taxpayerInfo.name);
172
+ * console.log('Address:', taxpayerInfo.addressLine1);
173
+ * }
174
+ * ```
175
+ *
176
+ * @remarks
177
+ * - QR code must be in the correct format specified by MyInvois
178
+ * - Returns StandardError if QR code is invalid or cannot be decoded
179
+ * - Debug mode provides detailed error logging
180
+ */
181
+ async getTaxpayerQRCode(qrCodeText) {
182
+ return taxpayerQRCode({
183
+ fetch: this.fetch.bind(this),
184
+ debug: this.debug
185
+ }, qrCodeText);
186
+ }
187
+ /**
188
+ * Performs an action on a document such as rejection or cancellation.
189
+ *
190
+ * This method allows updating the status of a document to either rejected or cancelled,
191
+ * along with providing a reason for the action. Useful for managing document workflow
192
+ * and maintaining audit trails.
193
+ *
194
+ * @param documentUid - The unique identifier of the document
195
+ * @param status - The new status to set ('rejected' or 'cancelled')
196
+ * @param reason - The reason for the status change (max 300 characters)
197
+ * @returns Promise resolving to document action response containing UUID, status, and any errors
198
+ *
199
+ * @example
200
+ * ```typescript
201
+ * // Reject a document with reason
202
+ * const result = await client.performDocumentAction(
203
+ * 'doc-123',
204
+ * 'rejected',
205
+ * 'Invalid tax calculation'
206
+ * );
207
+ *
208
+ * // Cancel a document
209
+ * const result = await client.performDocumentAction(
210
+ * 'doc-456',
211
+ * 'cancelled',
212
+ * 'Duplicate submission'
213
+ * );
214
+ * ```
215
+ *
216
+ * @remarks
217
+ * - Only valid for documents in appropriate states
218
+ * - Reason is required, max 300 characters
219
+ * - Action is irreversible once completed
220
+ * - Returns error if document cannot be found or action is invalid
221
+ */
222
+ async performDocumentAction(documentUid, status, reason) {
223
+ return performDocumentAction({ fetch: this.fetch.bind(this) }, documentUid, status, reason);
224
+ }
225
+ /**
226
+ * Cancels a document that was previously submitted.
227
+ *
228
+ * This is a convenience method that wraps performDocumentAction with 'cancelled' status.
229
+ * Documents can only be cancelled within 72 hours of validation.
230
+ *
231
+ * @param documentUid - The unique identifier of the document to cancel
232
+ * @param reason - The reason for cancellation (max 300 characters)
233
+ * @returns Promise resolving to document action response containing UUID, status, and any errors
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * const result = await client.cancelDocument(
238
+ * 'doc-456',
239
+ * 'Duplicate submission'
240
+ * );
241
+ * if (!result.error) {
242
+ * console.log('Document cancelled:', result.uuid);
243
+ * }
244
+ * ```
245
+ *
246
+ * @remarks
247
+ * - Must be called within 72 hours of document validation
248
+ * - Reason is required, max 300 characters
249
+ * - Action is irreversible once completed
250
+ * - Rate limited to 12 requests per minute
251
+ */
252
+ async cancelDocument(documentUid, reason) {
253
+ return this.performDocumentAction(documentUid, "cancelled", reason);
254
+ }
255
+ /**
256
+ * Rejects a document received from another party.
257
+ *
258
+ * This is a convenience method that wraps performDocumentAction with 'rejected' status.
259
+ * Only documents received from other taxpayers can be rejected.
260
+ *
261
+ * @param documentUid - The unique identifier of the document to reject
262
+ * @param reason - The reason for rejection (max 300 characters)
263
+ * @returns Promise resolving to document action response containing UUID, status, and any errors
264
+ *
265
+ * @example
266
+ * ```typescript
267
+ * const result = await client.rejectDocument(
268
+ * 'doc-123',
269
+ * 'Invalid tax calculation'
270
+ * );
271
+ * if (!result.error) {
272
+ * console.log('Document rejected:', result.uuid);
273
+ * }
274
+ * ```
275
+ *
276
+ * @remarks
277
+ * - Only applicable to received documents
278
+ * - Reason is required, max 300 characters
279
+ * - Action is irreversible once completed
280
+ * - Rate limited to 12 requests per minute
281
+ */
282
+ async rejectDocument(documentUid, reason) {
283
+ return this.performDocumentAction(documentUid, "rejected", reason);
284
+ }
285
+ /**
286
+ * Submits one or more e-invoice documents to the MyInvois platform for processing.
287
+ *
288
+ * This method digitally signs each document using the provided certificate and private key,
289
+ * generates document hashes, encodes them for submission, and sends them to the platform.
290
+ * The method includes comprehensive validation warnings for document size and count limits.
291
+ *
292
+ * @param documents - Array of InvoiceV1_1 documents to be submitted
293
+ * @returns Promise resolving to submission response containing the submission data and HTTP status
294
+ * @throws {Error} If PRIVATE_KEY or CERTIFICATE environment variables are missing
295
+ * @throws {Error} If document signing, encoding, or API submission fails
296
+ *
297
+ * @example
298
+ * ```typescript
299
+ * // Submit a single invoice
300
+ * const result = await client.submitDocument([invoiceData]);
301
+ * console.log(result.data.submissionUid); // Track submission with this UID
302
+ *
303
+ * // Submit multiple invoices
304
+ * const result = await client.submitDocument([invoice1, invoice2, invoice3]);
305
+ * if (result.status === 202) {
306
+ * console.log('Documents submitted successfully');
307
+ * }
308
+ * ```
309
+ *
310
+ * @remarks
311
+ * - Requires PRIVATE_KEY and CERTIFICATE environment variables for document signing
312
+ * - Each document is digitally signed with XML-DSIG before submission
313
+ * - Documents are base64-encoded for transmission
314
+ * - API limits: Max 100 documents per submission, 5MB total payload, 300KB per document
315
+ * - Debug mode provides detailed logging of payload sizes and validation warnings
316
+ * - Returns HTTP 202 for successful submissions that require processing
317
+ */
318
+ async submitDocument(documents) {
319
+ return submitDocument({
320
+ fetch: this.fetch.bind(this),
321
+ debug: this.debug,
322
+ signingCredentials: this.signingCredentials
323
+ }, documents);
324
+ }
325
+ /**
326
+ * Polls the MyInvois platform to get the current status of a document submission.
327
+ *
328
+ * This method continuously checks the submission status until it receives a final result
329
+ * (Valid or Invalid) or reaches the maximum retry limit. It's designed to handle the
330
+ * asynchronous nature of document processing on the MyInvois platform.
331
+ *
332
+ * @param submissionUid - The unique identifier of the submission to check
333
+ * @param pollInterval - Time in milliseconds between status checks (default: 1000ms)
334
+ * @param maxRetries - Maximum number of retry attempts (default: 10)
335
+ * @returns Promise resolving to submission status object with document summary and any errors
336
+ *
337
+ * @example
338
+ * ```typescript
339
+ * // Check submission status with default polling
340
+ * const result = await client.getSubmissionStatus('submission-uid-123');
341
+ * if (result.status === 'Valid') {
342
+ * console.log('All documents processed successfully');
343
+ * console.log('Document summaries:', result.documentSummary);
344
+ * }
345
+ *
346
+ * // Custom polling interval and retry count
347
+ * const result = await client.getSubmissionStatus(
348
+ * 'submission-uid-123',
349
+ * 2000, // Poll every 2 seconds
350
+ * 20 // Try up to 20 times
351
+ * );
352
+ * ```
353
+ *
354
+ * @remarks
355
+ * - Automatically retries on network errors until maxRetries is reached
356
+ * - Returns 'Invalid' status with timeout error if submission processing takes too long
357
+ * - Debug mode provides detailed logging of polling attempts and responses
358
+ * - Use reasonable poll intervals to avoid overwhelming the API
359
+ */
360
+ async getSubmissionStatus(submissionUid, pollInterval = 1e3, maxRetries = 10, pageNo = 1, pageSize = 10) {
361
+ return getSubmissionStatus({
362
+ fetch: this.fetch.bind(this),
363
+ debug: this.debug
364
+ }, submissionUid, pollInterval, maxRetries, pageNo, pageSize);
365
+ }
366
+ /**
367
+ * Retrieves a document by its unique identifier with the raw document content.
368
+ *
369
+ * @param documentUid - The unique identifier of the document to retrieve
370
+ * @returns Promise resolving to document summary with raw document content as a string
371
+ * @throws {Error} If the document is not found or request fails
372
+ *
373
+ * @example
374
+ * ```typescript
375
+ * const document = await client.getDocument('doc-uuid-123');
376
+ * console.log(document.document); // Raw XML/JSON content
377
+ * console.log(document.uuid); // Document UUID
378
+ * ```
379
+ */
380
+ async getDocument(documentUid) {
381
+ return getDocument({ fetch: this.fetch.bind(this) }, documentUid);
382
+ }
383
+ /**
384
+ * Retrieves detailed information about a document including validation results.
385
+ *
386
+ * @param documentUid - The unique identifier of the document to get details for
387
+ * @returns Promise resolving to document summary with detailed validation results
388
+ * @throws {Error} If the document is not found or request fails
389
+ *
390
+ * @example
391
+ * ```typescript
392
+ * const details = await client.getDocumentDetails('doc-uuid-123');
393
+ * console.log(details.validationResults.status); // 'Valid' | 'Invalid' | 'Processing'
394
+ * console.log(details.validationResults.validationSteps); // Array of validation step results
395
+ * ```
396
+ */
397
+ async getDocumentDetails(documentUid) {
398
+ return getDocumentDetails({ fetch: this.fetch.bind(this) }, documentUid);
399
+ }
400
+ /**
401
+ * Searches for documents based on various filter criteria.
402
+ *
403
+ * @param params - Search parameters object
404
+ * @param params.uuid - Optional specific document UUID to search for
405
+ * @param params.submissionDateFrom - Required start date for submission date range (ISO date string)
406
+ * @param params.submissionDateTo - Optional end date for submission date range (ISO date string)
407
+ * @param params.pageSize - Optional number of results per page (default handled by API)
408
+ * @param params.pageNo - Optional page number for pagination (0-based)
409
+ * @param params.issueDateFrom - Optional start date for issue date range (ISO date string)
410
+ * @param params.issueDateTo - Optional end date for issue date range (ISO date string)
411
+ * @param params.invoiceDirection - Optional filter by invoice direction ('Sent' or 'Received')
412
+ * @param params.status - Optional filter by document status
413
+ * @param params.documentType - Optional filter by e-invoice type code
414
+ * @param params.searchQuery - Optional text search across uuid, buyerTIN, supplierTIN, buyerName, supplierName, internalID, total
415
+ * @returns Promise resolving to array of document summaries matching the search criteria
416
+ * @throws {Error} If the search request fails
417
+ *
418
+ * @example
419
+ * ```typescript
420
+ * // Search for documents submitted in the last 30 days
421
+ * const documents = await client.searchDocuments({
422
+ * submissionDateFrom: '2024-01-01',
423
+ * submissionDateTo: '2024-01-31',
424
+ * status: 'Valid',
425
+ * pageSize: 10
426
+ * });
427
+ *
428
+ * // Search by supplier name
429
+ * const supplierDocs = await client.searchDocuments({
430
+ * submissionDateFrom: '2024-01-01',
431
+ * searchQuery: 'ACME Corp',
432
+ * invoiceDirection: 'Received'
433
+ * });
434
+ * ```
435
+ */
436
+ async searchDocuments({ uuid, submissionDateFrom, submissionDateTo, pageSize, pageNo, issueDateFrom, issueDateTo, invoiceDirection, status, documentType, searchQuery }) {
437
+ return searchDocuments({ fetch: this.fetch.bind(this) }, {
438
+ uuid,
439
+ submissionDateFrom,
440
+ submissionDateTo,
441
+ pageSize,
442
+ pageNo,
443
+ issueDateFrom,
444
+ issueDateTo,
445
+ invoiceDirection,
446
+ status,
447
+ documentType,
448
+ searchQuery
449
+ });
450
+ }
451
+ /**
452
+ * Retrieves notifications from the MyInvois platform based on specified search criteria.
453
+ *
454
+ * This method allows you to search for system notifications, alerts, and messages
455
+ * sent by the MyInvois platform regarding document processing, system updates,
456
+ * or account-related information.
457
+ *
458
+ * @param params - Search parameters object for filtering notifications
459
+ * @param params.dateFrom - Optional start date for notification date range (ISO date string)
460
+ * @param params.dateTo - Optional end date for notification date range (ISO date string)
461
+ * @param params.type - Optional notification type filter
462
+ * @param params.language - Optional language preference for notifications
463
+ * @param params.status - Optional notification status filter
464
+ * @param params.pageNo - Optional page number for pagination (0-based)
465
+ * @param params.pageSize - Optional number of results per page
466
+ * @returns Promise resolving to notification response object or standard error
467
+ *
468
+ * @example
469
+ * ```typescript
470
+ * // Get all notifications from the last 7 days
471
+ * const notifications = await client.getNotifications({
472
+ * dateFrom: '2024-01-01',
473
+ * dateTo: '2024-01-07',
474
+ * pageSize: 20
475
+ * });
476
+ *
477
+ * // Get unread notifications only
478
+ * const unreadNotifications = await client.getNotifications({
479
+ * status: 0, // Assuming 0 = unread
480
+ * language: 'en'
481
+ * });
482
+ *
483
+ * // Paginated notification retrieval
484
+ * const firstPage = await client.getNotifications({
485
+ * dateFrom: '2024-01-01',
486
+ * pageNo: 0,
487
+ * pageSize: 10
488
+ * });
489
+ * ```
490
+ *
491
+ * @remarks
492
+ * - All parameters are optional, allowing flexible filtering
493
+ * - Returns paginated results when pageNo and pageSize are specified
494
+ * - Date parameters should be in ISO format (YYYY-MM-DD)
495
+ * - May return StandardError object if the request fails
496
+ */
497
+ async getNotifications({ dateFrom, dateTo, type, language, status, pageNo, pageSize }) {
498
+ return getNotifications({ fetch: this.fetch.bind(this) }, {
499
+ dateFrom,
500
+ dateTo,
501
+ type,
502
+ language,
503
+ status,
504
+ pageNo,
505
+ pageSize
506
+ });
507
+ }
508
+ async getDocumentTypes() {
509
+ return getDocumentTypes({ fetch: this.fetch.bind(this) });
510
+ }
511
+ /**
512
+ * Retrieves detailed information about a specific document type from the MyInvois platform.
513
+ *
514
+ * This method fetches metadata and configuration details for a specific document type,
515
+ * including supported versions, validation rules, and structural requirements.
516
+ * Useful for understanding document format requirements before submission.
517
+ *
518
+ * @param id - The unique identifier of the document type to retrieve
519
+ * @returns Promise resolving to document type response object or standard error
520
+ *
521
+ * @example
522
+ * ```typescript
523
+ * // Get details for e-invoice document type
524
+ * const invoiceType = await client.getDocumentType(1);
525
+ * if ('id' in invoiceType) {
526
+ * console.log('Document type name:', invoiceType.name);
527
+ * console.log('Available versions:', invoiceType.versionNumber);
528
+ * console.log('Description:', invoiceType.description);
529
+ * }
530
+ *
531
+ * // Handle potential errors
532
+ * const documentType = await client.getDocumentType(999);
533
+ * if ('error' in documentType) {
534
+ * console.error('Failed to retrieve document type:', documentType.error.message);
535
+ * }
536
+ * ```
537
+ *
538
+ * @remarks
539
+ * - Returns StandardError object if the document type ID doesn't exist
540
+ * - Document type information includes validation schemas and business rules
541
+ * - Use this method to discover supported document formats and versions
542
+ * - Essential for understanding submission requirements for different document types
543
+ */
544
+ async getDocumentType(id) {
545
+ return getDocumentType({ fetch: this.fetch.bind(this) }, id);
546
+ }
547
+ /**
548
+ * Generates a shareable QR code URL for a specific document.
549
+ *
550
+ * This method retrieves the document details using its unique identifier,
551
+ * then constructs a URL that can be used to access or share the document
552
+ * via the MyInvois platform. The URL format differs between sandbox and
553
+ * production environments.
554
+ *
555
+ * @param documentUid - The unique identifier of the document
556
+ * @returns Promise resolving to a string containing the QR code URL
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * const qrCodeUrl = await client.getDocumentQrCode('abc123');
561
+ * console.log('Shareable QR code URL:', qrCodeUrl);
562
+ * // Output (sandbox): https://preprod.myinvois.hasil.gov.my/abc123/share/longId
563
+ * // Output (production): https://myinvois.hasil.gov.my/abc123/share/longId
564
+ * ```
565
+ *
566
+ * @remarks
567
+ * - The returned URL can be embedded in a QR code for document sharing.
568
+ * - The method fetches the document to obtain its longId, which is required for the URL.
569
+ * - Ensure the documentUid is valid and accessible by the current client.
570
+ */
571
+ async getDocumentQrCode(documentUid, longId) {
572
+ const doc = await getDocument({ fetch: this.fetch.bind(this) }, documentUid);
573
+ const qrCodeBaseLink = `https://${this.environment === "sandbox" ? "preprod." : ""}myinvois.hasil.gov.my/`;
574
+ if (!doc.longId && !longId) return null;
575
+ return qrCodeBaseLink + documentUid + "/share/" + (longId ?? doc.longId);
576
+ }
577
+ /**
578
+ * Retrieves detailed information about a specific version of a document type.
579
+ *
580
+ * This method fetches version-specific metadata, schema definitions, and validation rules
581
+ * for a particular document type version. Essential for understanding the exact format
582
+ * and requirements for document submission in a specific version.
583
+ *
584
+ * @param id - The unique identifier of the document type
585
+ * @param versionId - The unique identifier of the specific version to retrieve
586
+ * @returns Promise resolving to document type version response object or standard error
587
+ *
588
+ * @example
589
+ * ```typescript
590
+ * // Get specific version details for e-invoice
591
+ * const invoiceV1_1 = await client.getDocumentTypeVersion(1, 1);
592
+ * if ('id' in invoiceV1_1) {
593
+ * console.log('Version number:', invoiceV1_1.versionNumber);
594
+ * console.log('Schema:', invoiceV1_1.jsonSchema);
595
+ * console.log('Status:', invoiceV1_1.status);
596
+ * }
597
+ *
598
+ * // Compare different versions
599
+ * const [v1_0, v1_1] = await Promise.all([
600
+ * client.getDocumentTypeVersion(1, 0),
601
+ * client.getDocumentTypeVersion(1, 1)
602
+ * ]);
603
+ *
604
+ * // Handle version not found
605
+ * const result = await client.getDocumentTypeVersion(1, 999);
606
+ * if ('error' in result) {
607
+ * console.error('Version not found:', result.error.message);
608
+ * }
609
+ * ```
610
+ *
611
+ * @remarks
612
+ * - Returns StandardError object if document type ID or version ID doesn't exist
613
+ * - Version information includes JSON schema for validation
614
+ * - Different versions may have different validation rules and field requirements
615
+ * - Use this to ensure your documents conform to the specific version requirements
616
+ * - Version status indicates if the version is active, deprecated, or under development
617
+ */
618
+ async getDocumentTypeVersion(id, versionId) {
619
+ return getDocumentTypeVersion({ fetch: this.fetch.bind(this) }, id, versionId);
620
+ }
621
+ static fromP12(clientId, clientSecret, environment, p12Input, passphrase, onBehalfOf, debug) {
622
+ const { certificatePem, privateKeyPem } = getPemFromP12(p12Input, passphrase);
623
+ return new MyInvoisClient(clientId, clientSecret, environment, certificatePem, privateKeyPem, onBehalfOf, debug);
624
+ }
625
+ };
626
+
627
+ //#endregion
628
+ export { MyInvoisClient, aggregateLineItemsByTaxCategory };
629
+ //# sourceMappingURL=index.js.map