@ripwords/myinvois-client 0.1.2 → 0.1.4

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 (343) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +4 -5
  3. package/src/index.ts +2 -1
  4. package/src/types/documents.d.ts +17 -10
  5. package/src/utils/document.ts +2 -2
  6. package/test/dynamicInvoiceFeatures.test.ts +2 -0
  7. package/test/signAndSubmitInvoice.test.ts +2 -0
  8. package/test/signature-diagnostics.test.ts +2 -0
  9. package/bun.lock +0 -460
  10. package/dist/0X-CG1S1WKn.d.ts +0 -210
  11. package/dist/0X-ChfmeAYF.d.cts +0 -211
  12. package/dist/1X-CmlbG02M.d.ts +0 -111
  13. package/dist/1X-DFikQbP0.d.cts +0 -20
  14. package/dist/1X-DbFshzup.d.ts +0 -19
  15. package/dist/1X-jFrFCOs0.d.cts +0 -112
  16. package/dist/2X-5cE4ojEX.d.cts +0 -140
  17. package/dist/2X-DA6J6Wd7.d.ts +0 -139
  18. package/dist/2X-FWZ1rYVt.d.cts +0 -40
  19. package/dist/2X-eC_p0QJf.d.ts +0 -39
  20. package/dist/3X-D9duw0Ro.d.cts +0 -21
  21. package/dist/3X-DbfkwdkO.d.ts +0 -20
  22. package/dist/3X-GxuN79Ax.d.ts +0 -61
  23. package/dist/3X-r9xbWJ2l.d.cts +0 -62
  24. package/dist/4X-1ZkK-uH5.d.cts +0 -31
  25. package/dist/4X-CLO9OuKa.d.cts +0 -265
  26. package/dist/4X-CnHtgO6u.d.ts +0 -30
  27. package/dist/4X-DYz_nYSD.d.ts +0 -264
  28. package/dist/5X-BzPEdkbC.d.ts +0 -21
  29. package/dist/5X-BziH0a09.d.cts +0 -77
  30. package/dist/5X-Cfe39fFc.d.cts +0 -22
  31. package/dist/5X-kBF74qx1.d.ts +0 -76
  32. package/dist/6X-BceErbps.d.cts +0 -105
  33. package/dist/6X-C_xpeu6J.d.ts +0 -15
  34. package/dist/6X-DLWEe1bP.d.cts +0 -16
  35. package/dist/6X-sQZfT0ZK.d.ts +0 -104
  36. package/dist/7X-Bet2agJ6.d.ts +0 -15
  37. package/dist/7X-BoKQxMoO.d.ts +0 -70
  38. package/dist/7X-CucHYQsA.d.cts +0 -16
  39. package/dist/7X-CwPAqozm.d.cts +0 -71
  40. package/dist/8X-BIjJ9kaV.d.cts +0 -110
  41. package/dist/8X-BOEWATU3.d.ts +0 -109
  42. package/dist/8X-CJpqd5xp.d.cts +0 -19
  43. package/dist/8X-s5AzkHR-.d.ts +0 -18
  44. package/dist/9X-BBDP1gZ6.d.ts +0 -14
  45. package/dist/9X-CP5Xp6bE.d.cts +0 -98
  46. package/dist/9X-D3aOVCnz.d.cts +0 -15
  47. package/dist/9X-DAAZV4sr.d.ts +0 -97
  48. package/dist/AX-CmpMMhII.d.ts +0 -110
  49. package/dist/AX-DFzpxGOT.d.cts +0 -111
  50. package/dist/BX-CyiqNE6b.d.cts +0 -115
  51. package/dist/BX-j78z_ju_.d.ts +0 -114
  52. package/dist/CX-B6rEhQx7.d.ts +0 -127
  53. package/dist/CX-BTPvC3Dv.d.cts +0 -128
  54. package/dist/DX-BD4-hTCh.d.cts +0 -115
  55. package/dist/DX-CAmMnx5a.d.ts +0 -114
  56. package/dist/EX-CXhSC85J.d.ts +0 -106
  57. package/dist/EX-mTHCH0Yk.d.cts +0 -107
  58. package/dist/FX-DOOMoQl2.d.cts +0 -127
  59. package/dist/FX-DYVIJ3l0.d.ts +0 -126
  60. package/dist/GX-8URJ7WHz.d.cts +0 -136
  61. package/dist/GX-eBOVHqi6.d.ts +0 -135
  62. package/dist/HX-49z8CzsE.d.cts +0 -126
  63. package/dist/HX-Dz5T0xXI.d.ts +0 -125
  64. package/dist/IX-B6kblmBs.d.cts +0 -23
  65. package/dist/IX-PiKYro5a.d.ts +0 -22
  66. package/dist/JX-DMwHLGEE.d.cts +0 -104
  67. package/dist/JX-Dvnt0mSK.d.ts +0 -103
  68. package/dist/KX-BUb8e0yg.d.ts +0 -150
  69. package/dist/KX-DaJPkefl.d.cts +0 -151
  70. package/dist/LX-BnILxjdS.d.cts +0 -123
  71. package/dist/LX-l5ZBaGov.d.ts +0 -122
  72. package/dist/MX-BbPO8mTj.d.cts +0 -153
  73. package/dist/MX-C7C15AWi.d.ts +0 -152
  74. package/dist/NX-C7nFVC-D.d.ts +0 -121
  75. package/dist/NX-xy5uw7H3.d.cts +0 -122
  76. package/dist/OX-CIzARbON.d.cts +0 -26
  77. package/dist/OX-Dmkvcaij.d.ts +0 -25
  78. package/dist/PX-BKZ14N7N.d.ts +0 -120
  79. package/dist/PX-CL8waFgx.d.cts +0 -121
  80. package/dist/QX-6xdSNtxZ.d.ts +0 -58
  81. package/dist/QX-BowAYqZb.d.cts +0 -59
  82. package/dist/RX-DFoiOK5q.d.ts +0 -22
  83. package/dist/RX-fWoWcHTG.d.cts +0 -23
  84. package/dist/SX-CZ3e31OT.d.cts +0 -40
  85. package/dist/SX-D-Szi9wa.d.ts +0 -39
  86. package/dist/TX-CJhJ-HYX.d.cts +0 -31
  87. package/dist/TX-DTfkGsqn.d.ts +0 -30
  88. package/dist/UX-Bw4HHAj4.d.ts +0 -17
  89. package/dist/UX-P7-u2y70.d.cts +0 -18
  90. package/dist/VX-C8Eu5gQf.d.cts +0 -17
  91. package/dist/VX-DCv5x_hi.d.ts +0 -16
  92. package/dist/WX-BYtJ5_if.d.ts +0 -25
  93. package/dist/WX-DkiaqB2V.d.cts +0 -26
  94. package/dist/XX-D4p4iK-a.d.cts +0 -828
  95. package/dist/XX-Jo1yJO3A.d.ts +0 -827
  96. package/dist/YX-BvGmEsVG.d.ts +0 -19
  97. package/dist/YX-Du8zv9qz.d.cts +0 -20
  98. package/dist/ZX-B4jFD-21.d.cts +0 -22
  99. package/dist/ZX-B59AJcBY.d.ts +0 -21
  100. package/dist/api/platform/platformLogin.d.ts +0 -65
  101. package/dist/api/platform/platformLogin.js +0 -3
  102. package/dist/certificate-DFK-788s.cjs +0 -62
  103. package/dist/certificate-DFK-788s.cjs.map +0 -1
  104. package/dist/certificate-aooIRf9A.js +0 -49
  105. package/dist/chunk-CUT6urMc.cjs +0 -30
  106. package/dist/classification-codes-B15PbWxz.d.cts +0 -118
  107. package/dist/classification-codes-BKxV-rO9.d.ts +0 -117
  108. package/dist/country-code-CQuaiQm2.d.ts +0 -542
  109. package/dist/country-code-DPeNFMMi.d.cts +0 -543
  110. package/dist/currencies-BYJK-m6v.d.ts +0 -207
  111. package/dist/currencies-S5g1gzBU.d.cts +0 -208
  112. package/dist/document-DMIMRJV0.cjs +0 -472
  113. package/dist/document-DMIMRJV0.cjs.map +0 -1
  114. package/dist/document-NQos5fSr.js +0 -405
  115. package/dist/documents-BVG7KIKY.d.ts +0 -847
  116. package/dist/documents-C066EC9m.d.cts +0 -848
  117. package/dist/e-invoice-BuwtFnlI.d.cts +0 -44
  118. package/dist/e-invoice-CmbLQkHw.d.ts +0 -43
  119. package/dist/getBaseUrl-CO7Jp27d.cjs +0 -14
  120. package/dist/getBaseUrl-CO7Jp27d.cjs.map +0 -1
  121. package/dist/getBaseUrl-R3IdgCu3.js +0 -7
  122. package/dist/index-0-EvC6Nv.d.ts +0 -15
  123. package/dist/index-D2_HVwCz.d.cts +0 -16
  124. package/dist/index.cjs +0 -309
  125. package/dist/index.cjs.map +0 -1
  126. package/dist/index.d.ts +0 -233
  127. package/dist/index.js +0 -308
  128. package/dist/index10.cjs +0 -0
  129. package/dist/index11.cjs +0 -34
  130. package/dist/index11.cjs.map +0 -1
  131. package/dist/index12.cjs +0 -24
  132. package/dist/index12.cjs.map +0 -1
  133. package/dist/index13.cjs +0 -0
  134. package/dist/index14.cjs +0 -13
  135. package/dist/index14.cjs.map +0 -1
  136. package/dist/index15.cjs +0 -4
  137. package/dist/index16.cjs +0 -13
  138. package/dist/index17.cjs +0 -3
  139. package/dist/index18.cjs +0 -340
  140. package/dist/index18.cjs.map +0 -1
  141. package/dist/index19.cjs +0 -329
  142. package/dist/index19.cjs.map +0 -1
  143. package/dist/index2.cjs +0 -62
  144. package/dist/index2.cjs.map +0 -1
  145. package/dist/index20.cjs +0 -140
  146. package/dist/index20.cjs.map +0 -1
  147. package/dist/index21.cjs +0 -3
  148. package/dist/index22.cjs +0 -208
  149. package/dist/index22.cjs.map +0 -1
  150. package/dist/index23.cjs +0 -109
  151. package/dist/index23.cjs.map +0 -1
  152. package/dist/index24.cjs +0 -137
  153. package/dist/index24.cjs.map +0 -1
  154. package/dist/index25.cjs +0 -64
  155. package/dist/index25.cjs.map +0 -1
  156. package/dist/index26.cjs +0 -267
  157. package/dist/index26.cjs.map +0 -1
  158. package/dist/index27.cjs +0 -79
  159. package/dist/index27.cjs.map +0 -1
  160. package/dist/index28.cjs +0 -107
  161. package/dist/index28.cjs.map +0 -1
  162. package/dist/index29.cjs +0 -73
  163. package/dist/index29.cjs.map +0 -1
  164. package/dist/index3.cjs +0 -532
  165. package/dist/index3.cjs.map +0 -1
  166. package/dist/index30.cjs +0 -112
  167. package/dist/index30.cjs.map +0 -1
  168. package/dist/index31.cjs +0 -100
  169. package/dist/index31.cjs.map +0 -1
  170. package/dist/index32.cjs +0 -18
  171. package/dist/index32.cjs.map +0 -1
  172. package/dist/index33.cjs +0 -38
  173. package/dist/index33.cjs.map +0 -1
  174. package/dist/index34.cjs +0 -19
  175. package/dist/index34.cjs.map +0 -1
  176. package/dist/index35.cjs +0 -29
  177. package/dist/index35.cjs.map +0 -1
  178. package/dist/index36.cjs +0 -20
  179. package/dist/index36.cjs.map +0 -1
  180. package/dist/index37.cjs +0 -14
  181. package/dist/index37.cjs.map +0 -1
  182. package/dist/index38.cjs +0 -14
  183. package/dist/index38.cjs.map +0 -1
  184. package/dist/index39.cjs +0 -17
  185. package/dist/index39.cjs.map +0 -1
  186. package/dist/index4.cjs +0 -196
  187. package/dist/index4.cjs.map +0 -1
  188. package/dist/index40.cjs +0 -13
  189. package/dist/index40.cjs.map +0 -1
  190. package/dist/index41.cjs +0 -108
  191. package/dist/index41.cjs.map +0 -1
  192. package/dist/index42.cjs +0 -113
  193. package/dist/index42.cjs.map +0 -1
  194. package/dist/index43.cjs +0 -126
  195. package/dist/index43.cjs.map +0 -1
  196. package/dist/index44.cjs +0 -113
  197. package/dist/index44.cjs.map +0 -1
  198. package/dist/index45.cjs +0 -105
  199. package/dist/index45.cjs.map +0 -1
  200. package/dist/index46.cjs +0 -125
  201. package/dist/index46.cjs.map +0 -1
  202. package/dist/index47.cjs +0 -134
  203. package/dist/index47.cjs.map +0 -1
  204. package/dist/index48.cjs +0 -124
  205. package/dist/index48.cjs.map +0 -1
  206. package/dist/index49.cjs +0 -21
  207. package/dist/index49.cjs.map +0 -1
  208. package/dist/index5.cjs +0 -0
  209. package/dist/index50.cjs +0 -102
  210. package/dist/index50.cjs.map +0 -1
  211. package/dist/index51.cjs +0 -149
  212. package/dist/index51.cjs.map +0 -1
  213. package/dist/index52.cjs +0 -121
  214. package/dist/index52.cjs.map +0 -1
  215. package/dist/index53.cjs +0 -151
  216. package/dist/index53.cjs.map +0 -1
  217. package/dist/index54.cjs +0 -120
  218. package/dist/index54.cjs.map +0 -1
  219. package/dist/index55.cjs +0 -24
  220. package/dist/index55.cjs.map +0 -1
  221. package/dist/index56.cjs +0 -119
  222. package/dist/index56.cjs.map +0 -1
  223. package/dist/index57.cjs +0 -54
  224. package/dist/index57.cjs.map +0 -1
  225. package/dist/index58.cjs +0 -21
  226. package/dist/index58.cjs.map +0 -1
  227. package/dist/index58.cts.map +0 -1
  228. package/dist/index59.cjs +0 -35
  229. package/dist/index59.cjs.map +0 -1
  230. package/dist/index59.cts.map +0 -1
  231. package/dist/index6.cjs +0 -25
  232. package/dist/index6.cjs.map +0 -1
  233. package/dist/index60.cjs +0 -29
  234. package/dist/index60.cjs.map +0 -1
  235. package/dist/index60.cts.map +0 -1
  236. package/dist/index61.cjs +0 -16
  237. package/dist/index61.cjs.map +0 -1
  238. package/dist/index61.cts.map +0 -1
  239. package/dist/index62.cjs +0 -15
  240. package/dist/index62.cjs.map +0 -1
  241. package/dist/index62.cts.map +0 -1
  242. package/dist/index63.cjs +0 -24
  243. package/dist/index63.cjs.map +0 -1
  244. package/dist/index63.cts.map +0 -1
  245. package/dist/index64.cjs +0 -419
  246. package/dist/index64.cjs.map +0 -1
  247. package/dist/index64.cts.map +0 -1
  248. package/dist/index65.cjs +0 -15
  249. package/dist/index65.cjs.map +0 -1
  250. package/dist/index65.cts.map +0 -1
  251. package/dist/index66.cjs +0 -16
  252. package/dist/index66.cjs.map +0 -1
  253. package/dist/index66.cts.map +0 -1
  254. package/dist/index7.cjs +0 -0
  255. package/dist/index8.cjs +0 -0
  256. package/dist/index9.cjs +0 -25
  257. package/dist/index9.cjs.map +0 -1
  258. package/dist/msic-codes-CPWVNnpq.d.cts +0 -26
  259. package/dist/msic-codes-DToUqTI6.d.ts +0 -25
  260. package/dist/payment-modes-DA7uBIGb.d.ts +0 -43
  261. package/dist/payment-modes-FX88uyhP.d.cts +0 -44
  262. package/dist/platformLogin-PGzMhw1X.cjs +0 -37
  263. package/dist/platformLogin-PGzMhw1X.cjs.map +0 -1
  264. package/dist/platformLogin-f0bNAoZI.js +0 -30
  265. package/dist/signatures-BKi9DP2K.d.cts +0 -173
  266. package/dist/signatures-CG175mpg.d.ts +0 -172
  267. package/dist/state-codes-CNp_6051.d.cts +0 -62
  268. package/dist/state-codes-dvoTe5pC.d.ts +0 -61
  269. package/dist/tax-types-CgwxONDS.d.cts +0 -42
  270. package/dist/tax-types-tosH5I0q.d.ts +0 -41
  271. package/dist/types/classification-codes.d.ts +0 -2
  272. package/dist/types/country-code.d.ts +0 -2
  273. package/dist/types/currencies.d.ts +0 -2
  274. package/dist/types/documents.d.ts +0 -7
  275. package/dist/types/e-invoice.d.ts +0 -2
  276. package/dist/types/index.d.ts +0 -58
  277. package/dist/types/msic/0X.d.ts +0 -2
  278. package/dist/types/msic/1X.d.ts +0 -2
  279. package/dist/types/msic/2X.d.ts +0 -2
  280. package/dist/types/msic/3X.d.ts +0 -2
  281. package/dist/types/msic/4X.d.ts +0 -2
  282. package/dist/types/msic/5X.d.ts +0 -2
  283. package/dist/types/msic/6X.d.ts +0 -2
  284. package/dist/types/msic/7X.d.ts +0 -2
  285. package/dist/types/msic/8X.d.ts +0 -2
  286. package/dist/types/msic/9X.d.ts +0 -2
  287. package/dist/types/msic-codes.d.ts +0 -12
  288. package/dist/types/payment-modes.d.ts +0 -2
  289. package/dist/types/signatures.d.ts +0 -2
  290. package/dist/types/state-codes.d.ts +0 -2
  291. package/dist/types/tax-types.d.ts +0 -2
  292. package/dist/types/unit/1X.d.ts +0 -2
  293. package/dist/types/unit/2X.d.ts +0 -2
  294. package/dist/types/unit/3X.d.ts +0 -2
  295. package/dist/types/unit/4X.d.ts +0 -2
  296. package/dist/types/unit/5X.d.ts +0 -2
  297. package/dist/types/unit/6X.d.ts +0 -2
  298. package/dist/types/unit/7X.d.ts +0 -2
  299. package/dist/types/unit/8X.d.ts +0 -2
  300. package/dist/types/unit/9X.d.ts +0 -2
  301. package/dist/types/unit/AX.d.ts +0 -2
  302. package/dist/types/unit/BX.d.ts +0 -2
  303. package/dist/types/unit/CX.d.ts +0 -2
  304. package/dist/types/unit/DX.d.ts +0 -2
  305. package/dist/types/unit/EX.d.ts +0 -2
  306. package/dist/types/unit/FX.d.ts +0 -2
  307. package/dist/types/unit/GX.d.ts +0 -2
  308. package/dist/types/unit/HX.d.ts +0 -2
  309. package/dist/types/unit/IX.d.ts +0 -2
  310. package/dist/types/unit/JX.d.ts +0 -2
  311. package/dist/types/unit/KX.d.ts +0 -2
  312. package/dist/types/unit/LX.d.ts +0 -2
  313. package/dist/types/unit/MX.d.ts +0 -2
  314. package/dist/types/unit/NX.d.ts +0 -2
  315. package/dist/types/unit/OX.d.ts +0 -2
  316. package/dist/types/unit/PX.d.ts +0 -2
  317. package/dist/types/unit/QX.d.ts +0 -2
  318. package/dist/types/unit/RX.d.ts +0 -2
  319. package/dist/types/unit/SX.d.ts +0 -2
  320. package/dist/types/unit/TX.d.ts +0 -2
  321. package/dist/types/unit/UX.d.ts +0 -2
  322. package/dist/types/unit/VX.d.ts +0 -2
  323. package/dist/types/unit/WX.d.ts +0 -2
  324. package/dist/types/unit/XX.d.ts +0 -2
  325. package/dist/types/unit/YX.d.ts +0 -2
  326. package/dist/types/unit/ZX.d.ts +0 -2
  327. package/dist/types/unit-types.d.ts +0 -37
  328. package/dist/unit-types-BKZxwVYQ.d.ts +0 -55
  329. package/dist/unit-types-CaOA5ZDG.d.cts +0 -56
  330. package/dist/utils/base64.d.ts +0 -5
  331. package/dist/utils/base64.js +0 -10
  332. package/dist/utils/certificate.d.ts +0 -22
  333. package/dist/utils/certificate.js +0 -3
  334. package/dist/utils/document.d.ts +0 -135
  335. package/dist/utils/document.js +0 -3
  336. package/dist/utils/getBaseUrl.d.ts +0 -4
  337. package/dist/utils/getBaseUrl.js +0 -3
  338. package/dist/utils/helpers.d.ts +0 -271
  339. package/dist/utils/helpers.js +0 -330
  340. package/dist/utils/signature-diagnostics.d.ts +0 -93
  341. package/dist/utils/signature-diagnostics.js +0 -326
  342. package/dist/utils/validation.d.ts +0 -46
  343. package/dist/utils/validation.js +0 -134
@@ -1,848 +0,0 @@
1
- import { ClassificationCode } from "./classification-codes-B15PbWxz.cjs";
2
- import { CurrencyCode } from "./currencies-S5g1gzBU.cjs";
3
- import { EInvoiceTypeCode } from "./e-invoice-BuwtFnlI.cjs";
4
- import { IssuerDigitalSignature } from "./signatures-BKi9DP2K.cjs";
5
- import { TaxTypeCode } from "./tax-types-CgwxONDS.cjs";
6
-
7
- //#region src/types/documents.d.ts
8
-
9
- type RegistrationType = 'BRN' | 'NRIC' | 'PASSPORT';
10
-
11
- // Based on https://sdk.myinvois.hasil.gov.my/documents/invoice-v1-1/
12
-
13
- /**
14
- * Represents a physical address.
15
- * Based on the Address section of the documentation.
16
- */
17
- interface Address {
18
- /** Main address line. Max 150 chars.
19
- * @example Lot 66
20
- */
21
- addressLine0: string;
22
- /** City name. Max 50 chars. */
23
- cityName: string;
24
- /** State code. Refer to /codes/state-codes/. Max 50 chars. */
25
- state: string;
26
- /** Country code (ISO 3166-1). Refer to /codes/countries/. Max 3 chars. */
27
- country: string; // MYS
28
- }
29
-
30
- /**
31
- * Represents the supplier information.
32
- * Based on the Supplier section of the documentation.
33
- */
34
- interface Supplier {
35
- /** Supplier's name. Max 300 chars.
36
- * @example Test Supplier Sdn Bhd
37
- */
38
- name: string;
39
- /** Supplier's Tax Identification Number (TIN). Max 14 chars.
40
- * @example 1234567890
41
- */
42
- tin: string;
43
- /**
44
- * Supplier's Registration Type. NRIC, BRN, PASSPORT
45
- * @example NRIC
46
- */
47
- registrationType: RegistrationType;
48
- /**
49
- * Supplier's Registration / Identification Number / Passport Number.
50
- * Format depends on schemeID: NRIC (12), BRN (20), PASSPORT (12), ARMY (12).
51
- * @example BRN: 202001234567
52
- */
53
- registrationNumber: string;
54
- /** Supplier's address. */
55
- address: Address;
56
- /** Supplier's contact number (E.164 standard). Max 20 chars.
57
- * @example +60123456789
58
- */
59
- contactNumber: string;
60
- }
61
-
62
- /**
63
- * Represents the buyer information.
64
- * Based on the Buyer section of the documentation.
65
- */
66
- interface Buyer {
67
- /** Buyer's name. Max 300 chars.
68
- * @example Hebat Group
69
- */
70
- name: string;
71
- /** Buyer's Tax Identification Number (TIN). Max 14 chars.
72
- * @example C12345678901
73
- */
74
- tin: string;
75
- /**
76
- * Buyer's Registration Type. NRIC, BRN, PASSPORT, ARMY
77
- * @example BRN
78
- */
79
- registrationType: RegistrationType;
80
- /**
81
- * Buyer's Registration / Identification Number / Passport Number.
82
- * Format depends on schemeID: NRIC (12), BRN (20), PASSPORT (12), ARMY (12).
83
- * @example BRN: 202001234567
84
- */
85
- registrationNumber: string;
86
- /**
87
- * Buyer's SST registration number. Max 35 chars.
88
- * Mandatory for SST-registrants.
89
- * Allows up to two numbers separated by ';'.
90
- * @example W10-1909-32000060
91
- */
92
- sstRegistrationNumber: string;
93
- /** Buyer's address. */
94
- address: Address;
95
- /** Buyer's contact number (E.164 standard). Max 20 chars.
96
- * @example +60123456789
97
- */
98
- contactNumber: string;
99
- }
100
-
101
- /**
102
- * Represents a single line item in an invoice.
103
- * Based on the Invoice Line Item section of the documentation.
104
- * https://sdk.myinvois.hasil.gov.my/documents/invoice-v1-1/#invoice-line-item
105
- */
106
- interface InvoiceLineItem {
107
- /**
108
- * Item classification code. Refer to /codes/item-classifications/. Max 50 chars.
109
- * @example 001
110
- */
111
- itemClassificationCode: ClassificationCode;
112
- /**
113
- * Item description. Max 300 chars.
114
- * @example Laptop
115
- */
116
- itemDescription: string;
117
- /**
118
- * Unit price before tax. Max 18 digits, 6 decimal places.
119
- * @example 1500.00
120
- */
121
- unitPrice: number;
122
- /**
123
- * Tax type code. Refer to /codes/tax-types/. Max 2 chars.
124
- * @example 01
125
- */
126
- taxType: TaxTypeCode;
127
- /**
128
- * Tax rate. Max 18 digits, 2 decimal places.
129
- * @example 6.00
130
- */
131
- taxRate: number;
132
- /**
133
- * Tax amount. Max 18 digits, 2 decimal places.
134
- * @example 90.00
135
- */
136
- taxAmount: number;
137
- /**
138
- * Tax exemption reason code. Refer to /codes/tax-exemption-reasons/. Max 2 chars.
139
- * Mandatory if tax rate is 0%.
140
- * @example 02
141
- */
142
- taxExemptionReasonCode?: string;
143
- /**
144
- * Tax exemption reason amount. Max 18 digits, 2 decimal places.
145
- * Mandatory if tax rate is 0%.
146
- * @example 1500.00
147
- */
148
- taxExemptionReasonAmount?: number;
149
- /**
150
- * Total taxable amount per line (Quantity * Unit Price - Discount Amount). Max 18 digits, 2 decimal places.
151
- * @example 1500.00
152
- */
153
- totalTaxableAmountPerLine: number;
154
- /**
155
- * Total amount per line including tax (Total Taxable Amount Per Line + Tax Amount). Max 18 digits, 2 decimal places.
156
- * @example 1590.00
157
- */
158
- totalAmountPerLine: number;
159
- }
160
-
161
- /** Represents monetary totals for the invoice. Based on UBL cac:LegalMonetaryTotal. */
162
- interface LegalMonetaryTotal {
163
- /** Total amount exclusive of taxes. Max 18 digits, 2 decimal places. */
164
- taxExclusiveAmount: number;
165
- /** Total amount inclusive of taxes. Max 18 digits, 2 decimal places. */
166
- taxInclusiveAmount: number;
167
- /** The final payable amount. Max 18 digits, 2 decimal places. */
168
- payableAmount: number;
169
- }
170
-
171
- /** Represents tax category information. Based on UBL cac:TaxCategory. */
172
- interface TaxCategory {
173
- /** Tax type code. Refer to /codes/tax-types/. Max 2 chars. */
174
- taxTypeCode: TaxTypeCode;
175
- /** Tax rate percentage. Max 18 digits, 2 decimal places. */
176
- taxRate: number;
177
- }
178
-
179
- /** Represents a subtotal for a specific tax category. Based on UBL cac:TaxSubtotal. */
180
- interface TaxSubtotal {
181
- /** Taxable amount for this category. Max 18 digits, 2 decimal places. */
182
- taxableAmount: number;
183
- /** Tax amount for this category. Max 18 digits, 2 decimal places. */
184
- taxAmount: number;
185
- /** Tax category details. */
186
- taxCategory: TaxCategory;
187
- }
188
-
189
- /** Represents the total tax amount for the invoice. Based on UBL cac:TaxTotal. */
190
- interface TaxTotal {
191
- /** Total tax amount for the entire invoice. Max 18 digits, 2 decimal places. */
192
- taxAmount: number;
193
- }
194
-
195
- /**
196
- * Represents the core Invoice v1.1 document structure.
197
- * Based on the Core section of the documentation.
198
- */
199
- interface InvoiceV1_1 {
200
- /** Supplier information. */
201
- supplier: Supplier;
202
- /** Buyer information. */
203
- buyer: Buyer;
204
- /** e-Invoice version. Fixed value '1.1'. */
205
- eInvoiceVersion: '1.1';
206
- /** e-Invoice type code. Refer to /codes/e-invoice-types/. Max 2 chars. */
207
- eInvoiceTypeCode: EInvoiceTypeCode; // e.g., '01'
208
- /** Document reference number used by Supplier. Max 50 chars. */
209
- eInvoiceCodeOrNumber: string; // e.g., 'INV12345'
210
- /** Date of issuance (YYYY-MM-DD) in UTC. Max 10 chars. */
211
- eInvoiceDate: string; // e.g., '2017-11-26'
212
- /** Time of issuance (HH:mm:ssZ) in UTC. Max 9 chars. */
213
- eInvoiceTime: string; // e.g., '15:30:00Z'
214
- /** Issuer's digital signature. Refer to /signature/ documentation. */
215
- issuerDigitalSignature: IssuerDigitalSignature;
216
- /** Invoice currency code. Refer to /codes/currencies/. Max 3 chars. */
217
- invoiceCurrencyCode: CurrencyCode; // e.g., 'MYR'
218
- /** Invoice line items. */
219
- invoiceLineItems: InvoiceLineItem[];
220
- /**
221
- * Currency exchange rate to MYR. Max 15 decimal places.
222
- * Mandatory if InvoiceCurrencyCode is not MYR.
223
- */
224
- currencyExchangeRate?: number; // e.g., 1.0 or 4.75
225
-
226
- /** Overall monetary totals for the invoice. */
227
- legalMonetaryTotal: LegalMonetaryTotal;
228
- /** Total tax amounts and subtotals. */
229
- taxTotal: TaxTotal;
230
- }
231
- type SubmissionStatus = 'InProgress' | 'Valid' | 'PartiallyValid' | 'Invalid';
232
- type DocumentStatus = 'Valid' | 'Invalid' | 'Cancelled' | 'Submitted';
233
- type StandardError = {
234
- code: string;
235
- message: string;
236
- target: string;
237
- details: {
238
- code: string;
239
- message: string;
240
- target: string;
241
- }[];
242
- };
243
- type DocumentValidationResult = 'Valid' | 'Invalid' | 'Pending';
244
- interface DocumentValidationStepResult {
245
- name: string;
246
- status: DocumentValidationResult;
247
- error?: StandardError;
248
- }
249
- interface DocumentSummary {
250
- uuid: string;
251
- submissionUid: string;
252
- longId: string;
253
- internalId: string;
254
- typeName: string;
255
- typeVersionName: string;
256
- issuerTin: string;
257
- issuerName: string;
258
- receiverId: string;
259
- receiverName: string;
260
- dateTimeIssued: string;
261
- dateTimeReceived: string;
262
- dateTimeValidated: string;
263
- totalPayableAmount: number;
264
- totalExcludingTax: number;
265
- totalDiscount: number;
266
- totalNetAmount: number;
267
- status: DocumentStatus;
268
- cancelDateTime: string | null;
269
- rejectRequestDateTime: string | null;
270
- documentStatusReason: string | null;
271
- createdByUserId: string;
272
- }
273
- interface GetSubmissionResponse {
274
- submissionUid?: string;
275
- documentCount?: number;
276
- dateTimeReceived?: string;
277
- overallStatus?: SubmissionStatus;
278
- documentSummary?: DocumentSummary[];
279
- error?: StandardError;
280
- }
281
- interface ResponseDocument {
282
- invoiceCodeNumber: string;
283
- error?: StandardError;
284
- }
285
- interface SubmissionResponse {
286
- submissionUid: string;
287
- acceptedDocuments: ResponseDocument[];
288
- rejectedDocuments: ResponseDocument[];
289
- }
290
- interface SigningCredentials {
291
- /** Private key in PEM format for signing */
292
- privateKeyPem: string;
293
- /** Certificate in PEM format */
294
- certificatePem: string;
295
- /** Certificate issuer name (e.g., "CN=Trial LHDNM Sub CA V1, OU=Terms of use at https://www.posdigicert.com.my, O=LHDNM, C=MY") */
296
- issuerName: string;
297
- /** Certificate serial number as string */
298
- serialNumber: string;
299
- }
300
- interface FinalDocumentData {
301
- signatureValue: string; // Base64 encoded RSA signature (Sig from Step 4)
302
- propsDigest: string; // Base64 encoded hash of SignedProperties (PropsDigest from Step 7)
303
- docDigest: string; // Base64 encoded hash of Canonicalized Document (DocDigest from Step 3)
304
- certificatePem: string; // Signing certificate in PEM format
305
- }
306
- interface SignedPropertiesData {
307
- certDigest: string; // Base64 encoded SHA-256 hash of certificate (Step 5)
308
- signingTime: string; // ISO 8601 UTC timestamp string (e.g., 2023-10-26T10:30:00Z)
309
- issuerName: string; // Certificate Issuer Name
310
- serialNumber: string; // Certificate Serial Number
311
- }
312
- interface InvoiceSubmission {
313
- /** Invoice ID */
314
- ID: {
315
- _: string;
316
- }[];
317
-
318
- /** Issue date in YYYY-MM-DD format */
319
- IssueDate: {
320
- _: string;
321
- }[];
322
-
323
- /** Issue time in HH:mm:ssZ format */
324
- IssueTime: {
325
- _: string;
326
- }[];
327
-
328
- /** Invoice type code with version */
329
- InvoiceTypeCode: {
330
- _: string;
331
- listVersionID: string;
332
- }[];
333
-
334
- /** Document currency code */
335
- DocumentCurrencyCode: {
336
- _: string;
337
- }[];
338
-
339
- /** Supplier party information */
340
- AccountingSupplierParty: {
341
- Party: {
342
- IndustryClassificationCode: {
343
- _: string;
344
- name: string;
345
- }[];
346
- PartyIdentification: {
347
- ID: {
348
- _: string;
349
- schemeID: string;
350
- }[];
351
- }[];
352
- PostalAddress: {
353
- CityName: {
354
- _: string;
355
- }[];
356
- CountrySubentityCode: {
357
- _: string;
358
- }[];
359
- AddressLine: {
360
- Line: {
361
- _: string;
362
- }[];
363
- }[];
364
- Country: {
365
- IdentificationCode: {
366
- _: string;
367
- listID: string;
368
- listAgencyID: string;
369
- }[];
370
- }[];
371
- }[];
372
- PartyLegalEntity: {
373
- RegistrationName: {
374
- _: string;
375
- }[];
376
- }[];
377
- Contact: {
378
- Telephone: {
379
- _: string;
380
- }[];
381
- }[];
382
- }[];
383
- }[];
384
-
385
- /** Customer party information */
386
- AccountingCustomerParty: {
387
- Party: {
388
- PartyIdentification: {
389
- ID: {
390
- _: string;
391
- schemeID: string;
392
- }[];
393
- }[];
394
- PostalAddress: {
395
- CityName: {
396
- _: string;
397
- }[];
398
- CountrySubentityCode: {
399
- _: string;
400
- }[];
401
- AddressLine: {
402
- Line: {
403
- _: string;
404
- }[];
405
- }[];
406
- Country: {
407
- IdentificationCode: {
408
- _: string;
409
- listID: string;
410
- listAgencyID: string;
411
- }[];
412
- }[];
413
- }[];
414
- PartyLegalEntity: {
415
- RegistrationName: {
416
- _: string;
417
- }[];
418
- }[];
419
- Contact: {
420
- Telephone: {
421
- _: string;
422
- }[];
423
- }[];
424
- }[];
425
- }[];
426
-
427
- /** Tax total */
428
- TaxTotal: {
429
- TaxAmount: {
430
- _: number;
431
- currencyID: string;
432
- }[];
433
- TaxSubtotal: {
434
- TaxableAmount: {
435
- _: number;
436
- currencyID: string;
437
- }[];
438
- TaxAmount: {
439
- _: number;
440
- currencyID: string;
441
- }[];
442
- TaxCategory: {
443
- ID: {
444
- _: string;
445
- }[];
446
- TaxScheme: {
447
- ID: {
448
- _: string;
449
- schemeAgencyID: string;
450
- schemeID: string;
451
- }[];
452
- }[];
453
- }[];
454
- }[];
455
- }[];
456
-
457
- /** Legal monetary total */
458
- LegalMonetaryTotal: {
459
- LineExtensionAmount: {
460
- _: number;
461
- currencyID: string;
462
- }[];
463
- TaxExclusiveAmount: {
464
- _: number;
465
- currencyID: string;
466
- }[];
467
- TaxInclusiveAmount: {
468
- _: number;
469
- currencyID: string;
470
- }[];
471
- PayableAmount: {
472
- _: number;
473
- currencyID: string;
474
- }[];
475
- }[];
476
-
477
- /** Invoice line items */
478
- InvoiceLine: {
479
- ID: {
480
- _: string;
481
- }[];
482
- Item: {
483
- CommodityClassification: {
484
- ItemClassificationCode: {
485
- _: string;
486
- listID: string;
487
- }[];
488
- }[];
489
- Description: {
490
- _: string;
491
- }[];
492
- }[];
493
- ItemPriceExtension: {
494
- Amount: {
495
- _: number;
496
- currencyID: string;
497
- }[];
498
- }[];
499
- LineExtensionAmount: {
500
- _: number;
501
- currencyID: string;
502
- }[];
503
- Price: {
504
- PriceAmount: {
505
- _: number;
506
- currencyID: string;
507
- }[];
508
- }[];
509
- TaxTotal: {
510
- TaxAmount: {
511
- _: number;
512
- currencyID: string;
513
- }[];
514
- TaxSubtotal: {
515
- TaxableAmount: {
516
- _: number;
517
- currencyID: string;
518
- }[];
519
- TaxAmount: {
520
- _: number;
521
- currencyID: string;
522
- }[];
523
- TaxCategory: {
524
- ID: {
525
- _: string;
526
- }[];
527
- TaxScheme: {
528
- ID: {
529
- _: string;
530
- schemeAgencyID: string;
531
- schemeID: string;
532
- }[];
533
- }[];
534
- }[];
535
- }[];
536
- }[];
537
- }[];
538
-
539
- /** Tax exchange rate - Mandatory where applicable */
540
- TaxExchangeRate?: {
541
- SourceCurrencyCode: {
542
- _: string;
543
- }[];
544
- TargetCurrencyCode: {
545
- _: string;
546
- }[];
547
- CalculationRate: {
548
- _: number;
549
- }[];
550
- }[];
551
-
552
- /** UBL Extensions for signatures (optional - only present in signed documents) */
553
- UBLExtensions?: {
554
- UBLExtension: {
555
- ExtensionURI: {
556
- _: string;
557
- }[];
558
- ExtensionContent: {
559
- UBLDocumentSignatures: {
560
- SignatureInformation: {
561
- ID: {
562
- _: string;
563
- }[];
564
- ReferencedSignatureID: {
565
- _: string;
566
- }[];
567
- Signature: {
568
- Id: string;
569
- Object: {
570
- QualifyingProperties: {
571
- Target: string;
572
- SignedProperties: {
573
- Id: string;
574
- SignedSignatureProperties: {
575
- SigningTime: {
576
- _: string;
577
- }[];
578
- SigningCertificate: {
579
- Cert: {
580
- CertDigest: {
581
- DigestMethod: {
582
- Algorithm: string;
583
- }[];
584
- DigestValue: {
585
- _: string;
586
- }[];
587
- }[];
588
- IssuerSerial: {
589
- X509IssuerName: {
590
- _: string;
591
- }[];
592
- X509SerialNumber: {
593
- _: string;
594
- }[];
595
- }[];
596
- }[];
597
- }[];
598
- }[];
599
- }[];
600
- }[];
601
- }[];
602
- KeyInfo: {
603
- X509Data: {
604
- X509Certificate: {
605
- _: string;
606
- }[];
607
- X509SubjectName: {
608
- _: string;
609
- }[];
610
- X509IssuerSerial: {
611
- X509IssuerName: {
612
- _: string;
613
- }[];
614
- X509SerialNumber: {
615
- _: string;
616
- }[];
617
- }[];
618
- }[];
619
- }[];
620
- SignatureValue: {
621
- _: string;
622
- }[];
623
- SignedInfo: {
624
- CanonicalizationMethod: {
625
- _: string;
626
- Algorithm: string;
627
- }[];
628
- SignatureMethod: {
629
- _: string;
630
- Algorithm: string;
631
- }[];
632
- Reference: {
633
- Id: string;
634
- Type: string;
635
- URI: string;
636
- DigestMethod: {
637
- _: string;
638
- Algorithm: string;
639
- }[];
640
- DigestValue: {
641
- _: string;
642
- }[];
643
- }[];
644
- }[];
645
- }[];
646
- }[];
647
- }[];
648
- }[];
649
- }[];
650
- }[];
651
-
652
- /** Signature reference (optional - only present in signed documents) */
653
- Signature?: {
654
- ID: {
655
- _: string;
656
- }[];
657
- SignatureMethod: {
658
- _: string;
659
- }[];
660
- }[];
661
- }
662
-
663
- /** Represents the complete UBL document structure with namespace declarations */
664
- interface UBLDocument {
665
- /** UBL Invoice namespace */
666
- _D: string;
667
- /** UBL CommonAggregateComponents namespace */
668
- _A: string;
669
- /** UBL CommonBasicComponents namespace */
670
- _B: string;
671
- /** Array of invoice submissions */
672
- Invoice: InvoiceSubmission[];
673
- }
674
-
675
- /** Represents the signed properties structure for digital signatures */
676
- interface SignedPropertiesObject {
677
- SignedProperties: {
678
- /** Unique identifier for the signed properties */
679
- Id: string;
680
- /** Signed signature properties containing signing details */
681
- SignedSignatureProperties: {
682
- /** Signing timestamp */
683
- SigningTime: {
684
- _: string;
685
- }[];
686
- /** Signing certificate information */
687
- SigningCertificate: {
688
- /** Certificate details */
689
- Cert: {
690
- /** Certificate digest information */
691
- CertDigest: {
692
- /** Digest method algorithm */
693
- DigestMethod: {
694
- Algorithm: string;
695
- }[];
696
- /** Base64 encoded digest value */
697
- DigestValue: {
698
- _: string;
699
- }[];
700
- }[];
701
- /** Certificate issuer and serial information */
702
- IssuerSerial: {
703
- /** X.509 issuer distinguished name */
704
- X509IssuerName: {
705
- _: string;
706
- }[];
707
- /** X.509 certificate serial number */
708
- X509SerialNumber: {
709
- _: string;
710
- }[];
711
- }[];
712
- }[];
713
- }[];
714
- }[];
715
- }[];
716
- }
717
-
718
- /** Represents the signed info structure for digital signatures */
719
- interface SignedInfoObject {
720
- /** Canonicalization method */
721
- CanonicalizationMethod: {
722
- _: string;
723
- Algorithm: string;
724
- }[];
725
- /** Signature method */
726
- SignatureMethod: {
727
- _: string;
728
- Algorithm: string;
729
- }[];
730
- /** References being signed */
731
- Reference: {
732
- Id: string;
733
- Type: string;
734
- URI: string;
735
- DigestMethod: {
736
- _: string;
737
- Algorithm: string;
738
- }[];
739
- DigestValue: {
740
- _: string;
741
- }[];
742
- }[];
743
- }
744
-
745
- /** Represents a complete signed invoice with all signature elements */
746
- interface SignedInvoiceSubmission extends InvoiceSubmission {
747
- /** UBL Extensions for signatures - required for signed documents */
748
- UBLExtensions: {
749
- UBLExtension: {
750
- ExtensionURI: {
751
- _: string;
752
- }[];
753
- ExtensionContent: {
754
- UBLDocumentSignatures: {
755
- SignatureInformation: {
756
- ID: {
757
- _: string;
758
- }[];
759
- ReferencedSignatureID: {
760
- _: string;
761
- }[];
762
- Signature: {
763
- Id: string;
764
- Object: {
765
- QualifyingProperties: {
766
- Target: string;
767
- SignedProperties: {
768
- Id: string;
769
- SignedSignatureProperties: {
770
- SigningTime: {
771
- _: string;
772
- }[];
773
- SigningCertificate: {
774
- Cert: {
775
- CertDigest: {
776
- DigestMethod: {
777
- Algorithm: string;
778
- }[];
779
- DigestValue: {
780
- _: string;
781
- }[];
782
- }[];
783
- IssuerSerial: {
784
- X509IssuerName: {
785
- _: string;
786
- }[];
787
- X509SerialNumber: {
788
- _: string;
789
- }[];
790
- }[];
791
- }[];
792
- }[];
793
- }[];
794
- }[];
795
- }[];
796
- }[];
797
- KeyInfo: {
798
- X509Data: {
799
- X509Certificate: {
800
- _: string;
801
- }[];
802
- X509SubjectName: {
803
- _: string;
804
- }[];
805
- X509IssuerSerial: {
806
- X509IssuerName: {
807
- _: string;
808
- }[];
809
- X509SerialNumber: {
810
- _: string;
811
- }[];
812
- }[];
813
- }[];
814
- }[];
815
- SignatureValue: {
816
- _: string;
817
- }[];
818
- SignedInfo: SignedInfoObject[];
819
- }[];
820
- }[];
821
- }[];
822
- }[];
823
- }[];
824
- }[];
825
-
826
- /** Signature reference - required for signed documents */
827
- Signature: {
828
- ID: {
829
- _: string;
830
- }[];
831
- SignatureMethod: {
832
- _: string;
833
- }[];
834
- }[];
835
- }
836
- interface CompleteInvoice {
837
- /** UBL Invoice namespace */
838
- _D: string;
839
- /** UBL CommonAggregateComponents namespace */
840
- _A: string;
841
- /** UBL CommonBasicComponents namespace */
842
- _B: string;
843
- /** Array of signed invoice submissions */
844
- Invoice: SignedInvoiceSubmission[];
845
- }
846
- //#endregion
847
- export { Address, Buyer, CompleteInvoice, DocumentStatus, DocumentSummary, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RegistrationType, ResponseDocument, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument };
848
- //# sourceMappingURL=documents-C066EC9m.d.cts.map