@ripwords/myinvois-client 0.3.6 → 0.4.0

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 (400) hide show
  1. package/README.md +27 -0
  2. package/dist/{apiQueue-DgKWaQDS.cjs → apiQueue-C45w-ymm.cjs} +1 -1
  3. package/dist/{apiQueue-DgKWaQDS.cjs.map → apiQueue-C45w-ymm.cjs.map} +1 -1
  4. package/dist/{certificate-CWmfCPdt.cjs → certificate-Dw46fkYv.cjs} +5 -31
  5. package/dist/certificate-Dw46fkYv.cjs.map +1 -0
  6. package/dist/{document-B6ab06s1.cjs → document-B11B5lqd.cjs} +75 -21
  7. package/dist/document-B11B5lqd.cjs.map +1 -0
  8. package/dist/{documentManagement-BviJDtf2.cjs → documentManagement-qJnd0l1z.cjs} +3 -2
  9. package/dist/documentManagement-qJnd0l1z.cjs.map +1 -0
  10. package/dist/{documentSubmission-B6hkivRK.cjs → documentSubmission-BaPECvYU.cjs} +6 -5
  11. package/dist/{documentSubmission-B6hkivRK.cjs.map → documentSubmission-BaPECvYU.cjs.map} +1 -1
  12. package/dist/{documentTypeManagement-D_-LiQVg.cjs → documentTypeManagement-DXRLfTsW.cjs} +1 -1
  13. package/dist/{documentTypeManagement-D_-LiQVg.cjs.map → documentTypeManagement-DXRLfTsW.cjs.map} +1 -1
  14. package/dist/{getBaseUrl-D0G4GZmp.cjs → getBaseUrl-D2iJdUGL.cjs} +1 -1
  15. package/dist/{getBaseUrl-D0G4GZmp.cjs.map → getBaseUrl-D2iJdUGL.cjs.map} +1 -1
  16. package/dist/index.cjs +14 -12
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index10.cjs +6 -195
  19. package/dist/index11.cjs +22 -0
  20. package/dist/index12.cjs +2 -24
  21. package/dist/index13.cjs +3 -0
  22. package/dist/index14.cjs +3 -0
  23. package/dist/index15.cjs +325 -25
  24. package/dist/index15.cjs.map +1 -1
  25. package/dist/index16.cjs +187 -19
  26. package/dist/index16.cjs.map +1 -1
  27. package/dist/index17.cjs +62 -0
  28. package/dist/index17.cjs.map +1 -0
  29. package/dist/index18.cjs +523 -25
  30. package/dist/index18.cjs.map +1 -1
  31. package/dist/index19.cjs +187 -15
  32. package/dist/index19.cjs.map +1 -1
  33. package/dist/index2.cjs +1 -1
  34. package/dist/index21.cjs +25 -0
  35. package/dist/{index12.cjs.map → index21.cjs.map} +1 -1
  36. package/dist/index23.cjs +0 -5
  37. package/dist/index24.cjs +25 -9
  38. package/dist/index24.cjs.map +1 -1
  39. package/dist/index25.cjs +24 -4
  40. package/dist/index25.cjs.map +1 -0
  41. package/dist/index26.cjs +0 -22
  42. package/dist/index27.cjs +33 -2
  43. package/dist/index27.cjs.map +1 -0
  44. package/dist/index28.cjs +23 -2
  45. package/dist/index28.cjs.map +1 -0
  46. package/dist/index29.cjs +0 -330
  47. package/dist/index3.cjs +2 -2
  48. package/dist/index30.cjs +0 -193
  49. package/dist/index31.cjs +0 -208
  50. package/dist/index32.cjs +203 -104
  51. package/dist/index32.cjs.map +1 -1
  52. package/dist/index33.cjs +104 -132
  53. package/dist/index33.cjs.map +1 -1
  54. package/dist/index34.cjs +132 -59
  55. package/dist/index34.cjs.map +1 -1
  56. package/dist/index35.cjs +59 -262
  57. package/dist/index35.cjs.map +1 -1
  58. package/dist/index36.cjs +262 -74
  59. package/dist/index36.cjs.map +1 -1
  60. package/dist/index37.cjs +74 -102
  61. package/dist/index37.cjs.map +1 -1
  62. package/dist/index38.cjs +102 -68
  63. package/dist/index38.cjs.map +1 -1
  64. package/dist/index39.cjs +68 -107
  65. package/dist/index39.cjs.map +1 -1
  66. package/dist/index4.cjs +1 -1
  67. package/dist/index40.cjs +107 -95
  68. package/dist/index40.cjs.map +1 -1
  69. package/dist/index41.cjs +95 -13
  70. package/dist/index41.cjs.map +1 -1
  71. package/dist/index42.cjs +11 -31
  72. package/dist/index42.cjs.map +1 -1
  73. package/dist/index43.cjs +31 -12
  74. package/dist/index43.cjs.map +1 -1
  75. package/dist/index44.cjs +12 -22
  76. package/dist/index44.cjs.map +1 -1
  77. package/dist/index45.cjs +22 -13
  78. package/dist/index45.cjs.map +1 -1
  79. package/dist/index46.cjs +13 -7
  80. package/dist/index46.cjs.map +1 -1
  81. package/dist/index47.cjs +7 -7
  82. package/dist/index47.cjs.map +1 -1
  83. package/dist/index48.cjs +7 -10
  84. package/dist/index48.cjs.map +1 -1
  85. package/dist/index49.cjs +10 -6
  86. package/dist/index49.cjs.map +1 -1
  87. package/dist/index5.cjs +1 -1
  88. package/dist/index50.cjs +6 -101
  89. package/dist/index50.cjs.map +1 -1
  90. package/dist/index51.cjs +101 -106
  91. package/dist/index51.cjs.map +1 -1
  92. package/dist/index52.cjs +106 -119
  93. package/dist/index52.cjs.map +1 -1
  94. package/dist/index53.cjs +119 -106
  95. package/dist/index53.cjs.map +1 -1
  96. package/dist/index54.cjs +106 -98
  97. package/dist/index54.cjs.map +1 -1
  98. package/dist/index55.cjs +98 -118
  99. package/dist/index55.cjs.map +1 -1
  100. package/dist/index56.cjs +118 -127
  101. package/dist/index56.cjs.map +1 -1
  102. package/dist/index57.cjs +127 -117
  103. package/dist/index57.cjs.map +1 -1
  104. package/dist/index58.cjs +117 -14
  105. package/dist/index58.cjs.map +1 -1
  106. package/dist/index59.cjs +14 -95
  107. package/dist/index59.cjs.map +1 -1
  108. package/dist/index6.cjs +1 -1
  109. package/dist/index60.cjs +95 -142
  110. package/dist/index60.cjs.map +1 -1
  111. package/dist/index61.cjs +142 -114
  112. package/dist/index61.cjs.map +1 -1
  113. package/dist/index62.cjs +114 -144
  114. package/dist/index62.cjs.map +1 -1
  115. package/dist/index63.cjs +144 -113
  116. package/dist/index63.cjs.map +1 -1
  117. package/dist/index64.cjs +113 -17
  118. package/dist/index64.cjs.map +1 -1
  119. package/dist/index65.cjs +17 -112
  120. package/dist/index65.cjs.map +1 -1
  121. package/dist/index66.cjs +112 -47
  122. package/dist/index66.cjs.map +1 -1
  123. package/dist/index67.cjs +47 -14
  124. package/dist/index67.cjs.map +1 -1
  125. package/dist/index68.cjs +14 -28
  126. package/dist/index68.cjs.map +1 -1
  127. package/dist/index69.cjs +28 -22
  128. package/dist/index69.cjs.map +1 -1
  129. package/dist/index7.cjs +1 -1
  130. package/dist/index70.cjs +22 -9
  131. package/dist/index70.cjs.map +1 -1
  132. package/dist/index71.cjs +9 -8
  133. package/dist/index71.cjs.map +1 -1
  134. package/dist/index72.cjs +8 -17
  135. package/dist/index72.cjs.map +1 -1
  136. package/dist/index73.cjs +17 -412
  137. package/dist/index73.cjs.map +1 -1
  138. package/dist/index74.cjs +412 -8
  139. package/dist/index74.cjs.map +1 -1
  140. package/dist/index75.cjs +8 -9
  141. package/dist/index75.cjs.map +1 -1
  142. package/dist/index76.cjs +16 -0
  143. package/dist/index76.cjs.map +1 -0
  144. package/dist/index8.cjs +4 -61
  145. package/dist/index9.cjs +9 -528
  146. package/dist/index9.cjs.map +1 -1
  147. package/dist/lineItems-C8iT0OL1.cjs +64 -0
  148. package/dist/lineItems-C8iT0OL1.cjs.map +1 -0
  149. package/dist/{notificationManagement-DLBDn77E.cjs → notificationManagement-C_qrFwWL.cjs} +1 -1
  150. package/dist/{notificationManagement-DLBDn77E.cjs.map → notificationManagement-C_qrFwWL.cjs.map} +1 -1
  151. package/dist/{platformLogin-Ch6hFKoU.cjs → platformLogin-DC4s6Qpv.cjs} +1 -1
  152. package/dist/{platformLogin-Ch6hFKoU.cjs.map → platformLogin-DC4s6Qpv.cjs.map} +1 -1
  153. package/dist/{taxpayerValidation-j8s6YGED.cjs → taxpayerValidation-DzCJROgP.cjs} +1 -1
  154. package/dist/{taxpayerValidation-j8s6YGED.cjs.map → taxpayerValidation-DzCJROgP.cjs.map} +1 -1
  155. package/package.json +1 -1
  156. package/dist/0X-Cr3M7hci.d.cts +0 -211
  157. package/dist/0X-qj3c_vAo.d.ts +0 -210
  158. package/dist/1X-B-lyAVC4.d.ts +0 -111
  159. package/dist/1X-C72Wa4pk.d.ts +0 -19
  160. package/dist/1X-CWwmfCzo.d.cts +0 -112
  161. package/dist/1X-DYw2tURz.d.cts +0 -20
  162. package/dist/2X-BfCK614i.d.ts +0 -139
  163. package/dist/2X-CH89y3Af.d.ts +0 -39
  164. package/dist/2X-CXtqiwRg.d.cts +0 -40
  165. package/dist/2X-DNtkJ0tj.d.cts +0 -140
  166. package/dist/3X-BOxfatu3.d.cts +0 -62
  167. package/dist/3X-Bk_fUIAk.d.cts +0 -21
  168. package/dist/3X-DryrwYRf.d.ts +0 -20
  169. package/dist/3X-Du10Ix_V.d.ts +0 -61
  170. package/dist/4X-BPMLRoDv.d.ts +0 -30
  171. package/dist/4X-C7fzDWJ_.d.cts +0 -265
  172. package/dist/4X-CK9rj5qd.d.cts +0 -31
  173. package/dist/4X-x3cRFuSM.d.ts +0 -264
  174. package/dist/5X-B52AKeTz.d.ts +0 -76
  175. package/dist/5X-Bv7M6KyG.d.ts +0 -21
  176. package/dist/5X-CNAFsDm2.d.cts +0 -77
  177. package/dist/5X-CpAvNxvd.d.cts +0 -22
  178. package/dist/6X-DBwpWPQ6.d.ts +0 -104
  179. package/dist/6X-ZeZ8OB57.d.ts +0 -15
  180. package/dist/6X-bXWr_7xY.d.cts +0 -16
  181. package/dist/6X-uObUP4VG.d.cts +0 -105
  182. package/dist/7X-BJBOlWhV.d.cts +0 -16
  183. package/dist/7X-BifJnY24.d.cts +0 -71
  184. package/dist/7X-C_XGDSpE.d.ts +0 -70
  185. package/dist/7X-Dvw2Z2VN.d.ts +0 -15
  186. package/dist/8X-BkgoX8dg.d.ts +0 -18
  187. package/dist/8X-Di_0wuRX.d.ts +0 -109
  188. package/dist/8X-DioBXCJ0.d.cts +0 -110
  189. package/dist/8X-dshwiOxU.d.cts +0 -19
  190. package/dist/9X-8ZnvvViY.d.ts +0 -97
  191. package/dist/9X-9j2Djy4W.d.cts +0 -15
  192. package/dist/9X-BjffnXuq.d.cts +0 -98
  193. package/dist/9X-Du0e44cq.d.ts +0 -14
  194. package/dist/AX-BSPLpkVT.d.ts +0 -110
  195. package/dist/AX-CWCopjCC.d.cts +0 -111
  196. package/dist/BX-Cq7WdhD3.d.cts +0 -115
  197. package/dist/BX-u4yMaIkz.d.ts +0 -114
  198. package/dist/CX-BKZG0pVE.d.ts +0 -127
  199. package/dist/CX-DlcVZfxx.d.cts +0 -128
  200. package/dist/DX-CwA9WJAf.d.ts +0 -114
  201. package/dist/DX-DLdv-Nxj.d.cts +0 -115
  202. package/dist/EX-BRNu1Ooi.d.ts +0 -106
  203. package/dist/EX-CIJv8-Lw.d.cts +0 -107
  204. package/dist/FX-DBxjq6xY.d.ts +0 -126
  205. package/dist/FX-DlDM_Zea.d.cts +0 -127
  206. package/dist/GX-B3CvWNrP.d.ts +0 -135
  207. package/dist/GX-BFGNX6Jy.d.cts +0 -136
  208. package/dist/HX-D7FABgTv.d.ts +0 -125
  209. package/dist/HX-D7Y9qRSm.d.cts +0 -126
  210. package/dist/IX-D3ZknsAB.d.ts +0 -22
  211. package/dist/IX-DPTrbhgX.d.cts +0 -23
  212. package/dist/JX-BRaZM3Gc.d.ts +0 -103
  213. package/dist/JX-D8JmtNpo.d.cts +0 -104
  214. package/dist/KX-B1K0OWoi.d.ts +0 -150
  215. package/dist/KX-B46KJZrH.d.cts +0 -151
  216. package/dist/LX-CKRefinL.d.ts +0 -122
  217. package/dist/LX-CfTKy8Sx.d.cts +0 -123
  218. package/dist/MX-BKJ4gNvV.d.cts +0 -153
  219. package/dist/MX-DKmaeO9r.d.ts +0 -152
  220. package/dist/NX-CJL2Gn1U.d.ts +0 -121
  221. package/dist/NX-CSdLIFqU.d.cts +0 -122
  222. package/dist/OX-BwqOsulT.d.cts +0 -26
  223. package/dist/OX-Do2ap5v_.d.ts +0 -25
  224. package/dist/PX-BTx0TXsJ.d.cts +0 -121
  225. package/dist/PX-_DOr_rm9.d.ts +0 -120
  226. package/dist/QX-BUXR8RJL.d.cts +0 -59
  227. package/dist/QX-HlXLkIki.d.ts +0 -58
  228. package/dist/RX-CZ8HiH37.d.cts +0 -23
  229. package/dist/RX-DVPGOVES.d.ts +0 -22
  230. package/dist/SX-CLxsqiQk.d.cts +0 -40
  231. package/dist/SX-OGT3qwlS.d.ts +0 -39
  232. package/dist/TX-DKc8hLc4.d.cts +0 -31
  233. package/dist/TX-cPDINmZ5.d.ts +0 -30
  234. package/dist/UX-Be3sqvPV.d.ts +0 -17
  235. package/dist/UX-bc7xDnZI.d.cts +0 -18
  236. package/dist/VX-CIHTFyoC.d.cts +0 -17
  237. package/dist/VX-CoEuBNDK.d.ts +0 -16
  238. package/dist/WX-BHvlq7Jx.d.cts +0 -26
  239. package/dist/WX-DMvw__jH.d.ts +0 -25
  240. package/dist/XX-DOA-10JW.d.ts +0 -827
  241. package/dist/XX-DztQxYHJ.d.cts +0 -828
  242. package/dist/YX-CkxLeFb4.d.cts +0 -20
  243. package/dist/YX-F34sJ7Ik.d.ts +0 -19
  244. package/dist/ZX-CDQOfsHh.d.ts +0 -21
  245. package/dist/ZX-DVb_buNI.d.cts +0 -22
  246. package/dist/api/documentManagement.d.ts +0 -89
  247. package/dist/api/documentManagement.js +0 -3
  248. package/dist/api/documentSubmission.d.ts +0 -92
  249. package/dist/api/documentSubmission.js +0 -5
  250. package/dist/api/documentTypeManagement.d.ts +0 -70
  251. package/dist/api/documentTypeManagement.js +0 -3
  252. package/dist/api/notificationManagement.d.ts +0 -68
  253. package/dist/api/notificationManagement.js +0 -3
  254. package/dist/api/platformLogin.d.ts +0 -68
  255. package/dist/api/platformLogin.js +0 -3
  256. package/dist/api/taxpayerValidation.d.ts +0 -71
  257. package/dist/api/taxpayerValidation.js +0 -4
  258. package/dist/apiQueue-B6Q644Bz.js +0 -201
  259. package/dist/certificate-COwqszxD.js +0 -71
  260. package/dist/certificate-CWmfCPdt.cjs.map +0 -1
  261. package/dist/chunk-CUT6urMc.cjs +0 -30
  262. package/dist/classification-codes-B15PbWxz.d.cts +0 -118
  263. package/dist/classification-codes-C2X4xW5-.d.ts +0 -117
  264. package/dist/country-code-DPeNFMMi.d.cts +0 -543
  265. package/dist/country-code-DsI8Mbzx.d.ts +0 -542
  266. package/dist/currencies-DKuDflOO.d.ts +0 -207
  267. package/dist/currencies-S5g1gzBU.d.cts +0 -208
  268. package/dist/document-B6ab06s1.cjs.map +0 -1
  269. package/dist/document-Bb5WkhRe.js +0 -626
  270. package/dist/documentManagement-BviJDtf2.cjs.map +0 -1
  271. package/dist/documentManagement-lPm8Gziu.js +0 -49
  272. package/dist/documentSubmission-CMMzKvVl.js +0 -134
  273. package/dist/documentTypeManagement-cBtVCOY3.js +0 -22
  274. package/dist/documents-BYV12TVt.d.ts +0 -1196
  275. package/dist/documents-D_V38Q_U.d.cts +0 -1197
  276. package/dist/e-invoice-BuwtFnlI.d.cts +0 -44
  277. package/dist/e-invoice-C2TxhyrK.d.ts +0 -43
  278. package/dist/formatIdValue-qTxJqj9o.js +0 -7
  279. package/dist/getBaseUrl-D7nUmoYb.js +0 -7
  280. package/dist/index-CygwSf0x.d.ts +0 -15
  281. package/dist/index-Yr1QAbIF.d.cts +0 -16
  282. package/dist/index.d.ts +0 -614
  283. package/dist/index.js +0 -627
  284. package/dist/index10.cjs.map +0 -1
  285. package/dist/index29.cjs.map +0 -1
  286. package/dist/index30.cjs.map +0 -1
  287. package/dist/index31.cjs.map +0 -1
  288. package/dist/index61.cts.map +0 -1
  289. package/dist/index62.cts.map +0 -1
  290. package/dist/index63.cts.map +0 -1
  291. package/dist/index64.cts.map +0 -1
  292. package/dist/index65.cts.map +0 -1
  293. package/dist/index66.cts.map +0 -1
  294. package/dist/index67.cts.map +0 -1
  295. package/dist/index68.cts.map +0 -1
  296. package/dist/index69.cts.map +0 -1
  297. package/dist/index70.cts.map +0 -1
  298. package/dist/index71.cts.map +0 -1
  299. package/dist/index72.cts.map +0 -1
  300. package/dist/index73.cts.map +0 -1
  301. package/dist/index74.cts.map +0 -1
  302. package/dist/index75.cts.map +0 -1
  303. package/dist/index8.cjs.map +0 -1
  304. package/dist/msic-codes-CIKdPqag.d.cts +0 -26
  305. package/dist/msic-codes-CjrrJmzb.d.ts +0 -25
  306. package/dist/notificationManagement-n4Z5e-My.js +0 -19
  307. package/dist/notifications-DdlEkprb.d.cts +0 -63
  308. package/dist/notifications-sFhgh3rJ.d.ts +0 -62
  309. package/dist/payment-modes-7c1lWlIr.d.cts +0 -44
  310. package/dist/payment-modes-g3DzLmWb.d.ts +0 -43
  311. package/dist/platformLogin-CqI9OLYP.js +0 -39
  312. package/dist/signatures-CerHUrj3.d.ts +0 -172
  313. package/dist/signatures-CyDSZr_e.d.cts +0 -173
  314. package/dist/state-codes-Ow4oehYT.d.ts +0 -61
  315. package/dist/state-codes-u3ppueWo.d.cts +0 -62
  316. package/dist/tax-types-ClyLgydM.d.ts +0 -41
  317. package/dist/tax-types-fu5Q6dic.d.cts +0 -42
  318. package/dist/taxpayer-BAoT73gg.d.ts +0 -35
  319. package/dist/taxpayer-DwGzY1IL.d.cts +0 -36
  320. package/dist/taxpayerValidation-Xd_EHDvk.js +0 -47
  321. package/dist/types/classification-codes.d.ts +0 -2
  322. package/dist/types/country-code.d.ts +0 -2
  323. package/dist/types/currencies.d.ts +0 -2
  324. package/dist/types/documents.d.ts +0 -55
  325. package/dist/types/e-invoice.d.ts +0 -2
  326. package/dist/types/index.d.ts +0 -61
  327. package/dist/types/msic/0X.d.ts +0 -2
  328. package/dist/types/msic/1X.d.ts +0 -2
  329. package/dist/types/msic/2X.d.ts +0 -2
  330. package/dist/types/msic/3X.d.ts +0 -2
  331. package/dist/types/msic/4X.d.ts +0 -2
  332. package/dist/types/msic/5X.d.ts +0 -2
  333. package/dist/types/msic/6X.d.ts +0 -2
  334. package/dist/types/msic/7X.d.ts +0 -2
  335. package/dist/types/msic/8X.d.ts +0 -2
  336. package/dist/types/msic/9X.d.ts +0 -2
  337. package/dist/types/msic-codes.d.ts +0 -12
  338. package/dist/types/notifications.d.ts +0 -2
  339. package/dist/types/payment-modes.d.ts +0 -2
  340. package/dist/types/signatures.d.ts +0 -2
  341. package/dist/types/state-codes.d.ts +0 -2
  342. package/dist/types/tax-types.d.ts +0 -2
  343. package/dist/types/taxpayer.d.ts +0 -56
  344. package/dist/types/unit/1X.d.ts +0 -2
  345. package/dist/types/unit/2X.d.ts +0 -2
  346. package/dist/types/unit/3X.d.ts +0 -2
  347. package/dist/types/unit/4X.d.ts +0 -2
  348. package/dist/types/unit/5X.d.ts +0 -2
  349. package/dist/types/unit/6X.d.ts +0 -2
  350. package/dist/types/unit/7X.d.ts +0 -2
  351. package/dist/types/unit/8X.d.ts +0 -2
  352. package/dist/types/unit/9X.d.ts +0 -2
  353. package/dist/types/unit/AX.d.ts +0 -2
  354. package/dist/types/unit/BX.d.ts +0 -2
  355. package/dist/types/unit/CX.d.ts +0 -2
  356. package/dist/types/unit/DX.d.ts +0 -2
  357. package/dist/types/unit/EX.d.ts +0 -2
  358. package/dist/types/unit/FX.d.ts +0 -2
  359. package/dist/types/unit/GX.d.ts +0 -2
  360. package/dist/types/unit/HX.d.ts +0 -2
  361. package/dist/types/unit/IX.d.ts +0 -2
  362. package/dist/types/unit/JX.d.ts +0 -2
  363. package/dist/types/unit/KX.d.ts +0 -2
  364. package/dist/types/unit/LX.d.ts +0 -2
  365. package/dist/types/unit/MX.d.ts +0 -2
  366. package/dist/types/unit/NX.d.ts +0 -2
  367. package/dist/types/unit/OX.d.ts +0 -2
  368. package/dist/types/unit/PX.d.ts +0 -2
  369. package/dist/types/unit/QX.d.ts +0 -2
  370. package/dist/types/unit/RX.d.ts +0 -2
  371. package/dist/types/unit/SX.d.ts +0 -2
  372. package/dist/types/unit/TX.d.ts +0 -2
  373. package/dist/types/unit/UX.d.ts +0 -2
  374. package/dist/types/unit/VX.d.ts +0 -2
  375. package/dist/types/unit/WX.d.ts +0 -2
  376. package/dist/types/unit/XX.d.ts +0 -2
  377. package/dist/types/unit/YX.d.ts +0 -2
  378. package/dist/types/unit/ZX.d.ts +0 -2
  379. package/dist/types/unit-types.d.ts +0 -37
  380. package/dist/types/utils.d.ts +0 -2
  381. package/dist/unit-types-BXdufGWm.d.cts +0 -56
  382. package/dist/unit-types-VgYXIwTT.d.ts +0 -55
  383. package/dist/utils/apiQueue.d.ts +0 -45
  384. package/dist/utils/apiQueue.js +0 -3
  385. package/dist/utils/base64.d.ts +0 -5
  386. package/dist/utils/base64.js +0 -10
  387. package/dist/utils/certificate.d.ts +0 -26
  388. package/dist/utils/certificate.js +0 -3
  389. package/dist/utils/document.d.ts +0 -211
  390. package/dist/utils/document.js +0 -4
  391. package/dist/utils/formatIdValue.d.ts +0 -4
  392. package/dist/utils/formatIdValue.js +0 -3
  393. package/dist/utils/getBaseUrl.d.ts +0 -4
  394. package/dist/utils/getBaseUrl.js +0 -3
  395. package/dist/utils/signature-diagnostics.d.ts +0 -96
  396. package/dist/utils/signature-diagnostics.js +0 -327
  397. package/dist/utils/validation.d.ts +0 -108
  398. package/dist/utils/validation.js +0 -186
  399. package/dist/utils-C4FoVKLq.d.ts +0 -4
  400. package/dist/utils-Cdqbbzca.d.cts +0 -5
package/dist/index.js DELETED
@@ -1,627 +0,0 @@
1
- import { getDocument, getDocumentDetails, searchDocuments } from "./documentManagement-lPm8Gziu.js";
2
- import "./formatIdValue-qTxJqj9o.js";
3
- import "./document-Bb5WkhRe.js";
4
- import { getSubmissionStatus, performDocumentAction, submitDocument } from "./documentSubmission-CMMzKvVl.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 { extractCertificateInfo, getPemFromP12, validateKeyPair } from "./certificate-COwqszxD.js";
10
- import { getBaseUrl } from "./getBaseUrl-D7nUmoYb.js";
11
- import { categorizeRequest, queueRequest } from "./apiQueue-B6Q644Bz.js";
12
-
13
- //#region src/index.ts
14
- var MyInvoisClient = class MyInvoisClient {
15
- baseUrl;
16
- clientId;
17
- clientSecret;
18
- environment;
19
- onBehalfOf;
20
- signingCredentials;
21
- debug;
22
- token = "";
23
- tokenExpiration = void 0;
24
- requestCount = 0;
25
- constructor(clientId, clientSecret, environment, certificatePem, privateKeyPem, onBehalfOf, debug) {
26
- if (!privateKeyPem || !certificatePem) throw new Error("Missing required environment variables: PRIVATE_KEY and CERTIFICATE");
27
- if (!validateKeyPair(certificatePem, privateKeyPem)) throw new Error("Certificate and private key do not match");
28
- this.clientId = clientId;
29
- this.clientSecret = clientSecret;
30
- this.baseUrl = getBaseUrl(environment);
31
- this.environment = environment;
32
- this.onBehalfOf = onBehalfOf;
33
- this.debug = debug ?? process.env.MYINVOIS_DEBUG === "true" ? true : false;
34
- const { issuerName, serialNumber } = extractCertificateInfo(certificatePem);
35
- this.signingCredentials = {
36
- privateKeyPem,
37
- certificatePem,
38
- issuerName,
39
- serialNumber
40
- };
41
- }
42
- async updateOnBehalfOf(onBehalfOf) {
43
- this.onBehalfOf = onBehalfOf;
44
- await this.refreshToken();
45
- return;
46
- }
47
- async refreshToken() {
48
- const tokenResponse = await platformLogin({
49
- clientId: this.clientId,
50
- clientSecret: this.clientSecret,
51
- baseUrl: this.baseUrl,
52
- onBehalfOf: this.onBehalfOf,
53
- debug: this.debug
54
- });
55
- this.token = tokenResponse.token;
56
- this.tokenExpiration = tokenResponse.tokenExpiration;
57
- }
58
- async getToken() {
59
- if (!this.tokenExpiration || this.tokenExpiration < /* @__PURE__ */ new Date() || isNaN(this.tokenExpiration.getTime())) {
60
- if (this.debug) {
61
- console.log("Token expired");
62
- console.log("Refreshing token");
63
- }
64
- await this.refreshToken();
65
- }
66
- return this.token;
67
- }
68
- async fetch(path, options = {}) {
69
- this.requestCount++;
70
- if (this.debug) console.log(`[fetch] Request count: ${this.requestCount}`);
71
- const token = await this.getToken();
72
- const category = categorizeRequest(path, options?.method);
73
- return queueRequest(this.clientId, category, () => fetch(`${this.baseUrl}${path}`, {
74
- ...options,
75
- headers: {
76
- ...options.headers,
77
- Authorization: `Bearer ${token}`
78
- }
79
- }), this.debug);
80
- }
81
- /**
82
- * Validates a TIN against a NRIC/ARMY/PASSPORT/BRN (Business Registration Number)
83
- *
84
- * This method verifies if a given Tax Identification Number (TIN) is valid by checking it against
85
- * the provided identification type and value through the MyInvois platform's validation service.
86
- *
87
- * @param tin - The TIN to validate
88
- * @param idType - The type of ID to validate against ('NRIC', 'ARMY', 'PASSPORT', or 'BRN')
89
- * @param idValue - The value of the ID to validate against
90
- * @returns Promise resolving to true if the TIN is valid, false otherwise
91
- *
92
- * @example
93
- * ```typescript
94
- * // Validate TIN against NRIC
95
- * const isValid = await client.verifyTin('C12345678901234', 'NRIC', '123456789012');
96
- * if (isValid) {
97
- * console.log('TIN is valid');
98
- * }
99
- *
100
- * // Validate TIN against Business Registration Number
101
- * const isValidBusiness = await client.verifyTin('C98765432109876', 'BRN', '123456-K');
102
- * ```
103
- *
104
- * @remarks
105
- * - Returns false if validation fails due to network errors or invalid credentials
106
- * - Debug mode provides error logging for troubleshooting validation failures
107
- * - This is a non-blocking validation that won't throw exceptions on failure
108
- */
109
- async verifyTin(tin, idType, idValue) {
110
- return verifyTin({
111
- fetch: this.fetch.bind(this),
112
- debug: this.debug
113
- }, tin, idType, idValue);
114
- }
115
- /**
116
- * Searches for a Tax Identification Number (TIN) using taxpayer information.
117
- *
118
- * This method allows searching for a TIN using either a taxpayer name or a combination
119
- * of identification type and value. The search is flexible and supports multiple
120
- * identification types including NRIC, ARMY, PASSPORT, and BRN.
121
- *
122
- * @param params - Search parameters object
123
- * @param params.taxpayerName - Optional name of the taxpayer to search for
124
- * @param params.idType - Optional type of ID to search with (NRIC, ARMY, PASSPORT, BRN)
125
- * @param params.idValue - Optional value of the ID to search with
126
- * @returns Promise resolving to TIN search response or standard error
127
- *
128
- * @example
129
- * ```typescript
130
- * // Search by taxpayer name
131
- * const result = await client.searchTin({ taxpayerName: 'John Doe' });
132
- * if ('tin' in result) {
133
- * console.log('Found TIN:', result.tin);
134
- * }
135
- *
136
- * // Search by ID type and value
137
- * const result = await client.searchTin({
138
- * idType: 'NRIC',
139
- * idValue: '123456789012'
140
- * });
141
- * ```
142
- *
143
- * @remarks
144
- * - Either taxpayerName or both idType and idValue must be provided
145
- * - Returns StandardError object if search criteria are invalid or inconclusive
146
- * - Debug mode provides detailed error logging for troubleshooting
147
- * - Search results are not guaranteed to be unique
148
- */
149
- async searchTin(params) {
150
- return tinSearch({
151
- fetch: this.fetch.bind(this),
152
- debug: this.debug
153
- }, params);
154
- }
155
- /**
156
- * Retrieves taxpayer information from a QR code.
157
- *
158
- * This method decodes a QR code containing taxpayer information and returns
159
- * detailed taxpayer data including TIN, name, contact details, and business information.
160
- *
161
- * @param qrCodeText - The QR code text to decode
162
- * @returns Promise resolving to taxpayer QR code response or standard error
163
- *
164
- * @example
165
- * ```typescript
166
- * // Get taxpayer info from QR code
167
- * const taxpayerInfo = await client.getTaxpayerQRCode('QR_CODE_TEXT');
168
- * if ('tin' in taxpayerInfo) {
169
- * console.log('Taxpayer TIN:', taxpayerInfo.tin);
170
- * console.log('Business Name:', taxpayerInfo.name);
171
- * console.log('Address:', taxpayerInfo.addressLine1);
172
- * }
173
- * ```
174
- *
175
- * @remarks
176
- * - QR code must be in the correct format specified by MyInvois
177
- * - Returns StandardError if QR code is invalid or cannot be decoded
178
- * - Debug mode provides detailed error logging
179
- */
180
- async getTaxpayerQRCode(qrCodeText) {
181
- return taxpayerQRCode({
182
- fetch: this.fetch.bind(this),
183
- debug: this.debug
184
- }, qrCodeText);
185
- }
186
- /**
187
- * Performs an action on a document such as rejection or cancellation.
188
- *
189
- * This method allows updating the status of a document to either rejected or cancelled,
190
- * along with providing a reason for the action. Useful for managing document workflow
191
- * and maintaining audit trails.
192
- *
193
- * @param documentUid - The unique identifier of the document
194
- * @param status - The new status to set ('rejected' or 'cancelled')
195
- * @param reason - The reason for the status change (max 300 characters)
196
- * @returns Promise resolving to document action response containing UUID, status, and any errors
197
- *
198
- * @example
199
- * ```typescript
200
- * // Reject a document with reason
201
- * const result = await client.performDocumentAction(
202
- * 'doc-123',
203
- * 'rejected',
204
- * 'Invalid tax calculation'
205
- * );
206
- *
207
- * // Cancel a document
208
- * const result = await client.performDocumentAction(
209
- * 'doc-456',
210
- * 'cancelled',
211
- * 'Duplicate submission'
212
- * );
213
- * ```
214
- *
215
- * @remarks
216
- * - Only valid for documents in appropriate states
217
- * - Reason is required, max 300 characters
218
- * - Action is irreversible once completed
219
- * - Returns error if document cannot be found or action is invalid
220
- */
221
- async performDocumentAction(documentUid, status, reason) {
222
- return performDocumentAction({ fetch: this.fetch.bind(this) }, documentUid, status, reason);
223
- }
224
- /**
225
- * Cancels a document that was previously submitted.
226
- *
227
- * This is a convenience method that wraps performDocumentAction with 'cancelled' status.
228
- * Documents can only be cancelled within 72 hours of validation.
229
- *
230
- * @param documentUid - The unique identifier of the document to cancel
231
- * @param reason - The reason for cancellation (max 300 characters)
232
- * @returns Promise resolving to document action response containing UUID, status, and any errors
233
- *
234
- * @example
235
- * ```typescript
236
- * const result = await client.cancelDocument(
237
- * 'doc-456',
238
- * 'Duplicate submission'
239
- * );
240
- * if (!result.error) {
241
- * console.log('Document cancelled:', result.uuid);
242
- * }
243
- * ```
244
- *
245
- * @remarks
246
- * - Must be called within 72 hours of document validation
247
- * - Reason is required, max 300 characters
248
- * - Action is irreversible once completed
249
- * - Rate limited to 12 requests per minute
250
- */
251
- async cancelDocument(documentUid, reason) {
252
- return this.performDocumentAction(documentUid, "cancelled", reason);
253
- }
254
- /**
255
- * Rejects a document received from another party.
256
- *
257
- * This is a convenience method that wraps performDocumentAction with 'rejected' status.
258
- * Only documents received from other taxpayers can be rejected.
259
- *
260
- * @param documentUid - The unique identifier of the document to reject
261
- * @param reason - The reason for rejection (max 300 characters)
262
- * @returns Promise resolving to document action response containing UUID, status, and any errors
263
- *
264
- * @example
265
- * ```typescript
266
- * const result = await client.rejectDocument(
267
- * 'doc-123',
268
- * 'Invalid tax calculation'
269
- * );
270
- * if (!result.error) {
271
- * console.log('Document rejected:', result.uuid);
272
- * }
273
- * ```
274
- *
275
- * @remarks
276
- * - Only applicable to received documents
277
- * - Reason is required, max 300 characters
278
- * - Action is irreversible once completed
279
- * - Rate limited to 12 requests per minute
280
- */
281
- async rejectDocument(documentUid, reason) {
282
- return this.performDocumentAction(documentUid, "rejected", reason);
283
- }
284
- /**
285
- * Submits one or more e-invoice documents to the MyInvois platform for processing.
286
- *
287
- * This method digitally signs each document using the provided certificate and private key,
288
- * generates document hashes, encodes them for submission, and sends them to the platform.
289
- * The method includes comprehensive validation warnings for document size and count limits.
290
- *
291
- * @param documents - Array of InvoiceV1_1 documents to be submitted
292
- * @returns Promise resolving to submission response containing the submission data and HTTP status
293
- * @throws {Error} If PRIVATE_KEY or CERTIFICATE environment variables are missing
294
- * @throws {Error} If document signing, encoding, or API submission fails
295
- *
296
- * @example
297
- * ```typescript
298
- * // Submit a single invoice
299
- * const result = await client.submitDocument([invoiceData]);
300
- * console.log(result.data.submissionUid); // Track submission with this UID
301
- *
302
- * // Submit multiple invoices
303
- * const result = await client.submitDocument([invoice1, invoice2, invoice3]);
304
- * if (result.status === 202) {
305
- * console.log('Documents submitted successfully');
306
- * }
307
- * ```
308
- *
309
- * @remarks
310
- * - Requires PRIVATE_KEY and CERTIFICATE environment variables for document signing
311
- * - Each document is digitally signed with XML-DSIG before submission
312
- * - Documents are base64-encoded for transmission
313
- * - API limits: Max 100 documents per submission, 5MB total payload, 300KB per document
314
- * - Debug mode provides detailed logging of payload sizes and validation warnings
315
- * - Returns HTTP 202 for successful submissions that require processing
316
- */
317
- async submitDocument(documents) {
318
- return submitDocument({
319
- fetch: this.fetch.bind(this),
320
- debug: this.debug,
321
- signingCredentials: this.signingCredentials
322
- }, documents);
323
- }
324
- /**
325
- * Polls the MyInvois platform to get the current status of a document submission.
326
- *
327
- * This method continuously checks the submission status until it receives a final result
328
- * (Valid or Invalid) or reaches the maximum retry limit. It's designed to handle the
329
- * asynchronous nature of document processing on the MyInvois platform.
330
- *
331
- * @param submissionUid - The unique identifier of the submission to check
332
- * @param pollInterval - Time in milliseconds between status checks (default: 1000ms)
333
- * @param maxRetries - Maximum number of retry attempts (default: 10)
334
- * @returns Promise resolving to submission status object with document summary and any errors
335
- *
336
- * @example
337
- * ```typescript
338
- * // Check submission status with default polling
339
- * const result = await client.getSubmissionStatus('submission-uid-123');
340
- * if (result.status === 'Valid') {
341
- * console.log('All documents processed successfully');
342
- * console.log('Document summaries:', result.documentSummary);
343
- * }
344
- *
345
- * // Custom polling interval and retry count
346
- * const result = await client.getSubmissionStatus(
347
- * 'submission-uid-123',
348
- * 2000, // Poll every 2 seconds
349
- * 20 // Try up to 20 times
350
- * );
351
- * ```
352
- *
353
- * @remarks
354
- * - Automatically retries on network errors until maxRetries is reached
355
- * - Returns 'Invalid' status with timeout error if submission processing takes too long
356
- * - Debug mode provides detailed logging of polling attempts and responses
357
- * - Use reasonable poll intervals to avoid overwhelming the API
358
- */
359
- async getSubmissionStatus(submissionUid, pollInterval = 1e3, maxRetries = 10, pageNo = 0, pageSize = 10) {
360
- return getSubmissionStatus({
361
- fetch: this.fetch.bind(this),
362
- debug: this.debug
363
- }, submissionUid, pollInterval, maxRetries, pageNo, pageSize);
364
- }
365
- /**
366
- * Retrieves a document by its unique identifier with the raw document content.
367
- *
368
- * @param documentUid - The unique identifier of the document to retrieve
369
- * @returns Promise resolving to document summary with raw document content as a string
370
- * @throws {Error} If the document is not found or request fails
371
- *
372
- * @example
373
- * ```typescript
374
- * const document = await client.getDocument('doc-uuid-123');
375
- * console.log(document.document); // Raw XML/JSON content
376
- * console.log(document.uuid); // Document UUID
377
- * ```
378
- */
379
- async getDocument(documentUid) {
380
- return getDocument({ fetch: this.fetch.bind(this) }, documentUid);
381
- }
382
- /**
383
- * Retrieves detailed information about a document including validation results.
384
- *
385
- * @param documentUid - The unique identifier of the document to get details for
386
- * @returns Promise resolving to document summary with detailed validation results
387
- * @throws {Error} If the document is not found or request fails
388
- *
389
- * @example
390
- * ```typescript
391
- * const details = await client.getDocumentDetails('doc-uuid-123');
392
- * console.log(details.validationResults.status); // 'Valid' | 'Invalid' | 'Processing'
393
- * console.log(details.validationResults.validationSteps); // Array of validation step results
394
- * ```
395
- */
396
- async getDocumentDetails(documentUid) {
397
- return getDocumentDetails({ fetch: this.fetch.bind(this) }, documentUid);
398
- }
399
- /**
400
- * Searches for documents based on various filter criteria.
401
- *
402
- * @param params - Search parameters object
403
- * @param params.uuid - Optional specific document UUID to search for
404
- * @param params.submissionDateFrom - Required start date for submission date range (ISO date string)
405
- * @param params.submissionDateTo - Optional end date for submission date range (ISO date string)
406
- * @param params.pageSize - Optional number of results per page (default handled by API)
407
- * @param params.pageNo - Optional page number for pagination (0-based)
408
- * @param params.issueDateFrom - Optional start date for issue date range (ISO date string)
409
- * @param params.issueDateTo - Optional end date for issue date range (ISO date string)
410
- * @param params.invoiceDirection - Optional filter by invoice direction ('Sent' or 'Received')
411
- * @param params.status - Optional filter by document status
412
- * @param params.documentType - Optional filter by e-invoice type code
413
- * @param params.searchQuery - Optional text search across uuid, buyerTIN, supplierTIN, buyerName, supplierName, internalID, total
414
- * @returns Promise resolving to array of document summaries matching the search criteria
415
- * @throws {Error} If the search request fails
416
- *
417
- * @example
418
- * ```typescript
419
- * // Search for documents submitted in the last 30 days
420
- * const documents = await client.searchDocuments({
421
- * submissionDateFrom: '2024-01-01',
422
- * submissionDateTo: '2024-01-31',
423
- * status: 'Valid',
424
- * pageSize: 10
425
- * });
426
- *
427
- * // Search by supplier name
428
- * const supplierDocs = await client.searchDocuments({
429
- * submissionDateFrom: '2024-01-01',
430
- * searchQuery: 'ACME Corp',
431
- * invoiceDirection: 'Received'
432
- * });
433
- * ```
434
- */
435
- async searchDocuments({ uuid, submissionDateFrom, submissionDateTo, pageSize, pageNo, issueDateFrom, issueDateTo, invoiceDirection, status, documentType, searchQuery }) {
436
- return searchDocuments({ fetch: this.fetch.bind(this) }, {
437
- uuid,
438
- submissionDateFrom,
439
- submissionDateTo,
440
- pageSize,
441
- pageNo,
442
- issueDateFrom,
443
- issueDateTo,
444
- invoiceDirection,
445
- status,
446
- documentType,
447
- searchQuery
448
- });
449
- }
450
- /**
451
- * Retrieves notifications from the MyInvois platform based on specified search criteria.
452
- *
453
- * This method allows you to search for system notifications, alerts, and messages
454
- * sent by the MyInvois platform regarding document processing, system updates,
455
- * or account-related information.
456
- *
457
- * @param params - Search parameters object for filtering notifications
458
- * @param params.dateFrom - Optional start date for notification date range (ISO date string)
459
- * @param params.dateTo - Optional end date for notification date range (ISO date string)
460
- * @param params.type - Optional notification type filter
461
- * @param params.language - Optional language preference for notifications
462
- * @param params.status - Optional notification status filter
463
- * @param params.pageNo - Optional page number for pagination (0-based)
464
- * @param params.pageSize - Optional number of results per page
465
- * @returns Promise resolving to notification response object or standard error
466
- *
467
- * @example
468
- * ```typescript
469
- * // Get all notifications from the last 7 days
470
- * const notifications = await client.getNotifications({
471
- * dateFrom: '2024-01-01',
472
- * dateTo: '2024-01-07',
473
- * pageSize: 20
474
- * });
475
- *
476
- * // Get unread notifications only
477
- * const unreadNotifications = await client.getNotifications({
478
- * status: 0, // Assuming 0 = unread
479
- * language: 'en'
480
- * });
481
- *
482
- * // Paginated notification retrieval
483
- * const firstPage = await client.getNotifications({
484
- * dateFrom: '2024-01-01',
485
- * pageNo: 0,
486
- * pageSize: 10
487
- * });
488
- * ```
489
- *
490
- * @remarks
491
- * - All parameters are optional, allowing flexible filtering
492
- * - Returns paginated results when pageNo and pageSize are specified
493
- * - Date parameters should be in ISO format (YYYY-MM-DD)
494
- * - May return StandardError object if the request fails
495
- */
496
- async getNotifications({ dateFrom, dateTo, type, language, status, pageNo, pageSize }) {
497
- return getNotifications({ fetch: this.fetch.bind(this) }, {
498
- dateFrom,
499
- dateTo,
500
- type,
501
- language,
502
- status,
503
- pageNo,
504
- pageSize
505
- });
506
- }
507
- async getDocumentTypes() {
508
- return getDocumentTypes({ fetch: this.fetch.bind(this) });
509
- }
510
- /**
511
- * Retrieves detailed information about a specific document type from the MyInvois platform.
512
- *
513
- * This method fetches metadata and configuration details for a specific document type,
514
- * including supported versions, validation rules, and structural requirements.
515
- * Useful for understanding document format requirements before submission.
516
- *
517
- * @param id - The unique identifier of the document type to retrieve
518
- * @returns Promise resolving to document type response object or standard error
519
- *
520
- * @example
521
- * ```typescript
522
- * // Get details for e-invoice document type
523
- * const invoiceType = await client.getDocumentType(1);
524
- * if ('id' in invoiceType) {
525
- * console.log('Document type name:', invoiceType.name);
526
- * console.log('Available versions:', invoiceType.versionNumber);
527
- * console.log('Description:', invoiceType.description);
528
- * }
529
- *
530
- * // Handle potential errors
531
- * const documentType = await client.getDocumentType(999);
532
- * if ('error' in documentType) {
533
- * console.error('Failed to retrieve document type:', documentType.error.message);
534
- * }
535
- * ```
536
- *
537
- * @remarks
538
- * - Returns StandardError object if the document type ID doesn't exist
539
- * - Document type information includes validation schemas and business rules
540
- * - Use this method to discover supported document formats and versions
541
- * - Essential for understanding submission requirements for different document types
542
- */
543
- async getDocumentType(id) {
544
- return getDocumentType({ fetch: this.fetch.bind(this) }, id);
545
- }
546
- /**
547
- * Generates a shareable QR code URL for a specific document.
548
- *
549
- * This method retrieves the document details using its unique identifier,
550
- * then constructs a URL that can be used to access or share the document
551
- * via the MyInvois platform. The URL format differs between sandbox and
552
- * production environments.
553
- *
554
- * @param documentUid - The unique identifier of the document
555
- * @returns Promise resolving to a string containing the QR code URL
556
- *
557
- * @example
558
- * ```typescript
559
- * const qrCodeUrl = await client.getDocumentQrCode('abc123');
560
- * console.log('Shareable QR code URL:', qrCodeUrl);
561
- * // Output (sandbox): https://preprod.myinvois.hasil.gov.my/abc123/share/longId
562
- * // Output (production): https://myinvois.hasil.gov.my/abc123/share/longId
563
- * ```
564
- *
565
- * @remarks
566
- * - The returned URL can be embedded in a QR code for document sharing.
567
- * - The method fetches the document to obtain its longId, which is required for the URL.
568
- * - Ensure the documentUid is valid and accessible by the current client.
569
- */
570
- async getDocumentQrCode(documentUid, longId) {
571
- const doc = await getDocument({ fetch: this.fetch.bind(this) }, documentUid);
572
- const qrCodeBaseLink = `https://${this.environment === "sandbox" ? "preprod." : ""}myinvois.hasil.gov.my/`;
573
- if (!doc.longId && !longId) return null;
574
- return qrCodeBaseLink + documentUid + "/share/" + (longId ?? doc.longId);
575
- }
576
- /**
577
- * Retrieves detailed information about a specific version of a document type.
578
- *
579
- * This method fetches version-specific metadata, schema definitions, and validation rules
580
- * for a particular document type version. Essential for understanding the exact format
581
- * and requirements for document submission in a specific version.
582
- *
583
- * @param id - The unique identifier of the document type
584
- * @param versionId - The unique identifier of the specific version to retrieve
585
- * @returns Promise resolving to document type version response object or standard error
586
- *
587
- * @example
588
- * ```typescript
589
- * // Get specific version details for e-invoice
590
- * const invoiceV1_1 = await client.getDocumentTypeVersion(1, 1);
591
- * if ('id' in invoiceV1_1) {
592
- * console.log('Version number:', invoiceV1_1.versionNumber);
593
- * console.log('Schema:', invoiceV1_1.jsonSchema);
594
- * console.log('Status:', invoiceV1_1.status);
595
- * }
596
- *
597
- * // Compare different versions
598
- * const [v1_0, v1_1] = await Promise.all([
599
- * client.getDocumentTypeVersion(1, 0),
600
- * client.getDocumentTypeVersion(1, 1)
601
- * ]);
602
- *
603
- * // Handle version not found
604
- * const result = await client.getDocumentTypeVersion(1, 999);
605
- * if ('error' in result) {
606
- * console.error('Version not found:', result.error.message);
607
- * }
608
- * ```
609
- *
610
- * @remarks
611
- * - Returns StandardError object if document type ID or version ID doesn't exist
612
- * - Version information includes JSON schema for validation
613
- * - Different versions may have different validation rules and field requirements
614
- * - Use this to ensure your documents conform to the specific version requirements
615
- * - Version status indicates if the version is active, deprecated, or under development
616
- */
617
- async getDocumentTypeVersion(id, versionId) {
618
- return getDocumentTypeVersion({ fetch: this.fetch.bind(this) }, id, versionId);
619
- }
620
- static fromP12(clientId, clientSecret, environment, p12Input, passphrase, onBehalfOf, debug) {
621
- const { certificatePem, privateKeyPem } = getPemFromP12(p12Input, passphrase);
622
- return new MyInvoisClient(clientId, clientSecret, environment, certificatePem, privateKeyPem, onBehalfOf, debug);
623
- }
624
- };
625
-
626
- //#endregion
627
- export { MyInvoisClient };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index10.cjs","names":[],"sources":["../src/types/currencies.d.ts"],"sourcesContent":["/**\n * Represents the allowed ISO-4217 3-letter currency codes.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/currencies/\n */\nexport type CurrencyCode =\n | 'AED'\n | 'AFN'\n | 'ALL'\n | 'AMD'\n | 'ANG'\n | 'AOA'\n | 'ARS'\n | 'AUD'\n | 'AWG'\n | 'AZN'\n | 'BAM'\n | 'BBD'\n | 'BDT'\n | 'BGN'\n | 'BHD'\n | 'BIF'\n | 'BMD'\n | 'BND'\n | 'BOB'\n | 'BOV'\n | 'BRL'\n | 'BSD'\n | 'BTN'\n | 'BWP'\n | 'BYN'\n | 'BZD'\n | 'CAD'\n | 'CDF'\n | 'CHE'\n | 'CHF'\n | 'CHW'\n | 'CLF'\n | 'CLP'\n | 'CNY'\n | 'COP'\n | 'COU'\n | 'CRC'\n | 'CUC'\n | 'CUP'\n | 'CVE'\n | 'CZK'\n | 'DJF'\n | 'DKK'\n | 'DOP'\n | 'DZD'\n | 'EGP'\n | 'ERN'\n | 'ETB'\n | 'EUR'\n | 'FJD'\n | 'FKP'\n | 'GBP'\n | 'GEL'\n | 'GHS'\n | 'GIP'\n | 'GMD'\n | 'GNF'\n | 'GTQ'\n | 'GYD'\n | 'HKD'\n | 'HNL'\n | 'HRK'\n | 'HTG'\n | 'HUF'\n | 'IDR'\n | 'ILS'\n | 'INR'\n | 'IQD'\n | 'IRR'\n | 'ISK'\n | 'JMD'\n | 'JOD'\n | 'JPY'\n | 'KES'\n | 'KGS'\n | 'KHR'\n | 'KMF'\n | 'KPW'\n | 'KRW'\n | 'KWD'\n | 'KYD'\n | 'KZT'\n | 'LAK'\n | 'LBP'\n | 'LKR'\n | 'LRD'\n | 'LSL'\n | 'LYD'\n | 'MAD'\n | 'MDL'\n | 'MGA'\n | 'MKD'\n | 'MMK'\n | 'MNT'\n | 'MOP'\n | 'MRU'\n | 'MUR'\n | 'MVR'\n | 'MWK'\n | 'MXN'\n | 'MXV'\n | 'MYR'\n | 'MZN'\n | 'NAD'\n | 'NGN'\n | 'NIO'\n | 'NOK'\n | 'NPR'\n | 'NZD'\n | 'OMR'\n | 'PAB'\n | 'PEN'\n | 'PGK'\n | 'PHP'\n | 'PKR'\n | 'PLN'\n | 'PYG'\n | 'QAR'\n | 'RON'\n | 'RSD'\n | 'RUB'\n | 'RWF'\n | 'SAR'\n | 'SBD'\n | 'SCR'\n | 'SDG'\n | 'SEK'\n | 'SGD'\n | 'SHP'\n | 'SLL'\n | 'SOS'\n | 'SRD'\n | 'SSP'\n | 'STN'\n | 'SVC'\n | 'SYP'\n | 'SZL'\n | 'THB'\n | 'TJS'\n | 'TMT'\n | 'TND'\n | 'TOP'\n | 'TRY'\n | 'TTD'\n | 'TWD'\n | 'TZS'\n | 'UAH'\n | 'UGX'\n | 'USD'\n | 'USN'\n | 'UYI'\n | 'UYU'\n | 'UYW'\n | 'UZS'\n | 'VED'\n | 'VES'\n | 'VND'\n | 'VUV'\n | 'WST'\n | 'XAF'\n | 'XAG'\n | 'XAU'\n | 'XBA'\n | 'XBB'\n | 'XBC'\n | 'XBD'\n | 'XCD'\n | 'XDR'\n | 'XOF'\n | 'XPD'\n | 'XPF'\n | 'XPT'\n | 'XSU'\n | 'XUA'\n | 'XXX'\n | 'YER'\n | 'ZAR'\n | 'ZMW'\n | 'ZWL'\n\n/**\n * Enum representing the allowed ISO-4217 3-letter currency codes.\n * Provides a more readable way to reference currency codes.\n *\n * @example\n * const currency = CurrencyCodeEnum.MYR;\n * console.log(currency); // Output: \"MYR\"\n */\nexport enum CurrencyCodeEnum {\n AED = 'AED',\n AFN = 'AFN',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BOV = 'BOV',\n BRL = 'BRL',\n BSD = 'BSD',\n BTN = 'BTN',\n BWP = 'BWP',\n BYN = 'BYN',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHE = 'CHE',\n CHF = 'CHF',\n CHW = 'CHW',\n CLF = 'CLF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n COU = 'COU',\n CRC = 'CRC',\n CUC = 'CUC',\n CUP = 'CUP',\n CVE = 'CVE',\n CZK = 'CZK',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KMF = 'KMF',\n KPW = 'KPW',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MXV = 'MXV',\n MYR = 'MYR',\n MZN = 'MZN',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STN = 'STN',\n SVC = 'SVC',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n USN = 'USN',\n UYI = 'UYI',\n UYU = 'UYU',\n UYW = 'UYW',\n UZS = 'UZS',\n VED = 'VED',\n VES = 'VES',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XAG = 'XAG',\n XAU = 'XAU',\n XBA = 'XBA',\n XBB = 'XBB',\n XBC = 'XBC',\n XBD = 'XBD',\n XCD = 'XCD',\n XDR = 'XDR',\n XOF = 'XOF',\n XPD = 'XPD',\n XPF = 'XPF',\n XPT = 'XPT',\n XSU = 'XSU',\n XUA = 'XUA',\n XXX = 'XXX',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMW = 'ZMW',\n ZWL = 'ZWL',\n}\n\n/**\n * Interface representing a currency entry.\n * Contains the ISO-4217 code and the currency name.\n */\nexport interface Currency {\n code: CurrencyCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AAiMA,IAAY,gEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}