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