@commercelayer/sdk 7.0.0-rc.10 → 7.0.0-rc.12

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 (652) hide show
  1. package/lib/{api-DF66S5Gh.d.ts → api-BIiVfx1G.d.ts} +66 -47
  2. package/lib/{api-2OqdnITp.d.cts → api-xIgvzFhW.d.cts} +66 -47
  3. package/lib/api.cjs +24 -24
  4. package/lib/api.d.cts +1 -1
  5. package/lib/api.d.ts +1 -1
  6. package/lib/api.js +12 -12
  7. package/lib/bundle.cjs +26 -26
  8. package/lib/bundle.cjs.map +1 -1
  9. package/lib/bundle.d.cts +1 -1
  10. package/lib/bundle.d.ts +1 -1
  11. package/lib/bundle.js +13 -13
  12. package/lib/bundle.js.map +1 -1
  13. package/lib/chunk-2AFNQJXP.cjs.map +1 -1
  14. package/lib/chunk-2AMKJ6V7.cjs.map +1 -1
  15. package/lib/chunk-2HLQW5MF.cjs.map +1 -1
  16. package/lib/chunk-2HPO4UZA.cjs.map +1 -1
  17. package/lib/chunk-2JOYLKTP.cjs.map +1 -1
  18. package/lib/chunk-2KKHO6QF.js.map +1 -1
  19. package/lib/chunk-2L2ZM3VD.js.map +1 -1
  20. package/lib/chunk-2P6AFRJL.js.map +1 -1
  21. package/lib/chunk-2PYM3QGA.js.map +1 -1
  22. package/lib/chunk-2THU5NEW.cjs.map +1 -1
  23. package/lib/{chunk-BF7OPORP.js → chunk-2UUZHL2R.js} +2 -2
  24. package/lib/{chunk-BF7OPORP.js.map → chunk-2UUZHL2R.js.map} +1 -1
  25. package/lib/chunk-2XGMKMF5.cjs.map +1 -1
  26. package/lib/chunk-34H2NFDA.js.map +1 -1
  27. package/lib/chunk-35OHXDG3.cjs.map +1 -1
  28. package/lib/chunk-3ADITMLN.cjs.map +1 -1
  29. package/lib/chunk-3ANXNJ6U.cjs.map +1 -1
  30. package/lib/chunk-3AOPII3W.js.map +1 -1
  31. package/lib/chunk-3DFZ5QLR.js.map +1 -1
  32. package/lib/chunk-3I5BJF3J.js.map +1 -1
  33. package/lib/chunk-3N2MNKA3.js.map +1 -1
  34. package/lib/chunk-3NWQH32A.js.map +1 -1
  35. package/lib/chunk-3OBFBFUV.js.map +1 -1
  36. package/lib/chunk-3PVKJIA3.js.map +1 -1
  37. package/lib/chunk-3RR27O3T.js.map +1 -1
  38. package/lib/chunk-3TGZNMLP.cjs.map +1 -1
  39. package/lib/chunk-3URHH3S6.js.map +1 -1
  40. package/lib/chunk-3WKN5OCU.cjs.map +1 -1
  41. package/lib/chunk-3XWE56FL.cjs.map +1 -1
  42. package/lib/chunk-42DT6ZET.cjs.map +1 -1
  43. package/lib/chunk-432EXURP.js.map +1 -1
  44. package/lib/chunk-4IH4EHXT.cjs.map +1 -1
  45. package/lib/chunk-4KFJUIFD.js.map +1 -1
  46. package/lib/chunk-4KO5LZ7F.js.map +1 -1
  47. package/lib/chunk-4L4MGCUZ.js.map +1 -1
  48. package/lib/chunk-4L73LJKG.js.map +1 -1
  49. package/lib/{chunk-RWPFE3LF.cjs → chunk-4NI5SICY.cjs} +2 -2
  50. package/lib/chunk-4NI5SICY.cjs.map +1 -0
  51. package/lib/chunk-4SCFKFIM.cjs.map +1 -1
  52. package/lib/chunk-57XXD3GQ.cjs.map +1 -1
  53. package/lib/chunk-5EXCGVF2.cjs.map +1 -1
  54. package/lib/chunk-5FZNBGAF.cjs.map +1 -1
  55. package/lib/{chunk-NMVACSMG.js → chunk-5NMDIVXH.js} +2 -2
  56. package/lib/chunk-5NMDIVXH.js.map +1 -0
  57. package/lib/chunk-5OQQBNVB.js.map +1 -1
  58. package/lib/chunk-5P5Z7NXC.js.map +1 -1
  59. package/lib/chunk-5R76TU4I.cjs.map +1 -1
  60. package/lib/chunk-627I2FYX.cjs.map +1 -1
  61. package/lib/chunk-66JDSPFD.cjs.map +1 -1
  62. package/lib/chunk-67QVA2J3.cjs.map +1 -1
  63. package/lib/chunk-6AJSOS56.cjs.map +1 -1
  64. package/lib/chunk-6B66AQKB.cjs.map +1 -1
  65. package/lib/chunk-6OHA2TO3.cjs.map +1 -1
  66. package/lib/chunk-6PWK52UZ.cjs.map +1 -1
  67. package/lib/chunk-6SCAIB4K.cjs.map +1 -1
  68. package/lib/chunk-6SOWFGBP.cjs.map +1 -1
  69. package/lib/chunk-7CQTUOR4.cjs.map +1 -1
  70. package/lib/chunk-7ISS2FDY.js.map +1 -1
  71. package/lib/chunk-7JLRB7QH.js.map +1 -1
  72. package/lib/chunk-7SG4WU7W.js.map +1 -1
  73. package/lib/chunk-7SZY5BWE.js.map +1 -1
  74. package/lib/chunk-7VSYXEXL.js.map +1 -1
  75. package/lib/chunk-7Z2U4MHU.cjs.map +1 -1
  76. package/lib/chunk-A6BT5FSV.cjs.map +1 -1
  77. package/lib/chunk-A7BEMDVP.cjs.map +1 -1
  78. package/lib/chunk-AD73LDFJ.cjs.map +1 -1
  79. package/lib/{chunk-P3NADEGE.cjs → chunk-AGNIOGQC.cjs} +2 -2
  80. package/lib/chunk-AGNIOGQC.cjs.map +1 -0
  81. package/lib/chunk-AIGQRBCY.cjs.map +1 -1
  82. package/lib/chunk-ANCLAYJV.cjs.map +1 -1
  83. package/lib/chunk-AQFAND5D.cjs.map +1 -1
  84. package/lib/chunk-ARIBIRKF.cjs.map +1 -1
  85. package/lib/{chunk-EJSNNH47.js → chunk-AVJX4OEZ.js} +3 -3
  86. package/lib/{chunk-EJSNNH47.js.map → chunk-AVJX4OEZ.js.map} +1 -1
  87. package/lib/chunk-AW3TRBZ7.js.map +1 -1
  88. package/lib/chunk-AYTBSAHY.js.map +1 -1
  89. package/lib/chunk-B72FREUL.cjs.map +1 -1
  90. package/lib/chunk-BBEMCANC.cjs.map +1 -1
  91. package/lib/{chunk-JN4JL4WT.cjs → chunk-BJYOKKGX.cjs} +2 -2
  92. package/lib/{chunk-JN4JL4WT.cjs.map → chunk-BJYOKKGX.cjs.map} +1 -1
  93. package/lib/chunk-BN6XJAZH.cjs.map +1 -1
  94. package/lib/chunk-BTAKU6V5.cjs.map +1 -1
  95. package/lib/chunk-CG2ACHGS.js.map +1 -1
  96. package/lib/chunk-CHYP5F26.js.map +1 -1
  97. package/lib/chunk-CK6RZLVM.cjs.map +1 -1
  98. package/lib/chunk-CNCZCBI3.js.map +1 -1
  99. package/lib/chunk-CRRYP7ZN.js.map +1 -1
  100. package/lib/chunk-CTXBUDGO.cjs.map +1 -1
  101. package/lib/chunk-CUNOMS5N.js.map +1 -1
  102. package/lib/chunk-D26KDUDM.cjs.map +1 -1
  103. package/lib/chunk-D5E4OGXU.js.map +1 -1
  104. package/lib/chunk-D7KNSKNJ.js.map +1 -1
  105. package/lib/chunk-DAXKXBA3.js.map +1 -1
  106. package/lib/{chunk-465K3KVE.js → chunk-DGW3ZSW6.js} +2 -2
  107. package/lib/chunk-DGW3ZSW6.js.map +1 -0
  108. package/lib/chunk-DJ572MZB.cjs.map +1 -1
  109. package/lib/chunk-DOFPDQMJ.cjs.map +1 -1
  110. package/lib/chunk-DOGEZ6XX.cjs.map +1 -1
  111. package/lib/chunk-DSKZRVXS.js.map +1 -1
  112. package/lib/chunk-DTGODPCN.js.map +1 -1
  113. package/lib/chunk-DYZGWPZ6.js.map +1 -1
  114. package/lib/chunk-E3FDHGI7.js.map +1 -1
  115. package/lib/chunk-E4DYW6HB.cjs.map +1 -1
  116. package/lib/{chunk-ZFG533LP.js → chunk-E65GENXB.js} +2 -2
  117. package/lib/{chunk-ZFG533LP.js.map → chunk-E65GENXB.js.map} +1 -1
  118. package/lib/chunk-E6TBQVLK.cjs.map +1 -1
  119. package/lib/chunk-EADFDBOR.cjs.map +1 -1
  120. package/lib/chunk-ECMCBU3N.js.map +1 -1
  121. package/lib/chunk-EEFOL62K.js.map +1 -1
  122. package/lib/chunk-EHWAGYNX.js.map +1 -1
  123. package/lib/chunk-ELBOXOTA.js.map +1 -1
  124. package/lib/chunk-EP22KKHR.js.map +1 -1
  125. package/lib/chunk-EP7MAEQH.cjs.map +1 -1
  126. package/lib/chunk-EQD223JW.cjs.map +1 -1
  127. package/lib/{chunk-LCLXLB2R.cjs → chunk-ESMKOP42.cjs} +5 -2
  128. package/lib/chunk-ESMKOP42.cjs.map +1 -0
  129. package/lib/chunk-F6MSHDB7.cjs.map +1 -1
  130. package/lib/chunk-FAU5EILL.js.map +1 -1
  131. package/lib/{chunk-HLCGKY7R.js → chunk-FO7WBEPF.js} +2 -2
  132. package/lib/chunk-FO7WBEPF.js.map +1 -0
  133. package/lib/chunk-FSFXOZ35.cjs.map +1 -1
  134. package/lib/chunk-FTAZDUH6.js.map +1 -1
  135. package/lib/chunk-FVJDRHG7.js.map +1 -1
  136. package/lib/chunk-FXE62CPP.cjs.map +1 -1
  137. package/lib/chunk-FYKIHWAM.cjs.map +1 -1
  138. package/lib/chunk-G74OZ4M6.js.map +1 -1
  139. package/lib/chunk-GD4WRDF2.js.map +1 -1
  140. package/lib/chunk-GE6OHQR6.cjs.map +1 -1
  141. package/lib/chunk-GHLCA7BX.js.map +1 -1
  142. package/lib/chunk-GLSPCG3M.cjs.map +1 -1
  143. package/lib/chunk-H2USYPU6.js.map +1 -1
  144. package/lib/chunk-H4PUXGNI.cjs.map +1 -1
  145. package/lib/chunk-H4SVEI6E.js.map +1 -1
  146. package/lib/chunk-HAAE23MQ.js.map +1 -1
  147. package/lib/chunk-HBUDZOK7.cjs.map +1 -1
  148. package/lib/chunk-HCBXRHD7.js.map +1 -1
  149. package/lib/chunk-HDYENVKD.js.map +1 -1
  150. package/lib/{chunk-LEWK7QET.cjs → chunk-HERQULAV.cjs} +2 -2
  151. package/lib/chunk-HERQULAV.cjs.map +1 -0
  152. package/lib/chunk-HNHF6T2I.cjs.map +1 -1
  153. package/lib/{chunk-HQ35KQFG.cjs → chunk-HNONYIDO.cjs} +2 -2
  154. package/lib/chunk-HNONYIDO.cjs.map +1 -0
  155. package/lib/chunk-HQ5STEMD.js.map +1 -1
  156. package/lib/chunk-HQ6TJSB7.cjs.map +1 -1
  157. package/lib/chunk-HSILJQCD.js.map +1 -1
  158. package/lib/chunk-I3SKGXTB.cjs.map +1 -1
  159. package/lib/chunk-IDAOX5RB.cjs.map +1 -1
  160. package/lib/chunk-IITNQS6D.js.map +1 -1
  161. package/lib/chunk-IKENWSRH.cjs.map +1 -1
  162. package/lib/chunk-IKHD5UQP.cjs.map +1 -1
  163. package/lib/chunk-INJ7FRDA.cjs.map +1 -1
  164. package/lib/chunk-INZD34YD.cjs.map +1 -1
  165. package/lib/chunk-J4CTOHX6.cjs.map +1 -1
  166. package/lib/chunk-J6NBJHWL.cjs.map +1 -1
  167. package/lib/chunk-J6PTNG3D.js.map +1 -1
  168. package/lib/chunk-J7ZSBB35.js.map +1 -1
  169. package/lib/chunk-JAQECLCE.js.map +1 -1
  170. package/lib/chunk-JECYKPCC.cjs.map +1 -1
  171. package/lib/chunk-JPUF5YXX.js.map +1 -1
  172. package/lib/chunk-JRTJ6LWK.js.map +1 -1
  173. package/lib/chunk-JT7HVLLW.cjs.map +1 -1
  174. package/lib/chunk-JVF5KY2J.cjs.map +1 -1
  175. package/lib/chunk-JWC2GSYH.cjs.map +1 -1
  176. package/lib/chunk-JYOFP6BM.js.map +1 -1
  177. package/lib/chunk-JYXAF775.js.map +1 -1
  178. package/lib/chunk-K2CU5HIV.js.map +1 -1
  179. package/lib/chunk-K6WSCQKS.cjs.map +1 -1
  180. package/lib/chunk-KH5OQRQL.js.map +1 -1
  181. package/lib/{chunk-7X36B7N6.js → chunk-KITKWF6F.js} +2 -2
  182. package/lib/chunk-KITKWF6F.js.map +1 -0
  183. package/lib/{chunk-KBN3FFXD.cjs → chunk-KPRWSW6P.cjs} +2 -2
  184. package/lib/chunk-KPRWSW6P.cjs.map +1 -0
  185. package/lib/{chunk-7GVHCOUC.js → chunk-KU5U6DTU.js} +2 -2
  186. package/lib/{chunk-7GVHCOUC.js.map → chunk-KU5U6DTU.js.map} +1 -1
  187. package/lib/chunk-KWRDUU7K.js.map +1 -1
  188. package/lib/chunk-L4LPS3DV.cjs.map +1 -1
  189. package/lib/chunk-L4TDKOAC.js.map +1 -1
  190. package/lib/chunk-L5NEDGXK.js.map +1 -1
  191. package/lib/chunk-L6IGO47T.js.map +1 -1
  192. package/lib/chunk-LCNT6GY3.js.map +1 -1
  193. package/lib/chunk-LIT4FEIU.cjs.map +1 -1
  194. package/lib/chunk-LJ2EP6AL.cjs.map +1 -1
  195. package/lib/chunk-LNMY5BDT.js.map +1 -1
  196. package/lib/chunk-LTLMRGB7.js.map +1 -1
  197. package/lib/chunk-M2ZERG2X.cjs.map +1 -1
  198. package/lib/chunk-MADGMICB.js.map +1 -1
  199. package/lib/{chunk-VDZUWCIN.cjs → chunk-MCGX2ZDC.cjs} +2 -2
  200. package/lib/{chunk-VDZUWCIN.cjs.map → chunk-MCGX2ZDC.cjs.map} +1 -1
  201. package/lib/chunk-MJRMRWP3.js.map +1 -1
  202. package/lib/chunk-MPSHBMZS.js.map +1 -1
  203. package/lib/chunk-MQZSDICO.cjs.map +1 -1
  204. package/lib/chunk-MUPRLXGP.js.map +1 -1
  205. package/lib/chunk-MWYBER5I.cjs.map +1 -1
  206. package/lib/chunk-MZNHRIXE.js.map +1 -1
  207. package/lib/chunk-N4P7A3RY.js.map +1 -1
  208. package/lib/chunk-N6MHUHGE.cjs.map +1 -1
  209. package/lib/chunk-N753UD4K.cjs.map +1 -1
  210. package/lib/chunk-NAWKHFBZ.js.map +1 -1
  211. package/lib/chunk-NBYV35R4.cjs.map +1 -1
  212. package/lib/chunk-NDPDO54G.js.map +1 -1
  213. package/lib/chunk-NEC22ZSI.cjs.map +1 -1
  214. package/lib/{chunk-OPQJPXLM.cjs → chunk-NIHOABAW.cjs} +2 -2
  215. package/lib/chunk-NIHOABAW.cjs.map +1 -0
  216. package/lib/chunk-NJYMO7FP.cjs.map +1 -1
  217. package/lib/chunk-NODKE6P4.js.map +1 -1
  218. package/lib/chunk-OGLS27LJ.js.map +1 -1
  219. package/lib/chunk-OYFNK2SE.cjs.map +1 -1
  220. package/lib/chunk-PEU5GGGE.js.map +1 -1
  221. package/lib/chunk-PNSVP3KP.cjs.map +1 -1
  222. package/lib/chunk-PQS6KXZ2.cjs.map +1 -1
  223. package/lib/chunk-PV7MUP5Z.js.map +1 -1
  224. package/lib/chunk-PZZLLHJP.js.map +1 -1
  225. package/lib/chunk-Q2ZSQM7I.js.map +1 -1
  226. package/lib/chunk-Q66HILUF.js.map +1 -1
  227. package/lib/chunk-Q66JEOCJ.cjs.map +1 -1
  228. package/lib/chunk-Q7YHSPJL.js.map +1 -1
  229. package/lib/chunk-QGE4ELJO.cjs.map +1 -1
  230. package/lib/chunk-QK5MFD4L.js.map +1 -1
  231. package/lib/chunk-QK7D6L3W.js.map +1 -1
  232. package/lib/chunk-QYDOENWU.cjs.map +1 -1
  233. package/lib/chunk-QZTNLPOD.cjs.map +1 -1
  234. package/lib/chunk-QZWQNPKC.js.map +1 -1
  235. package/lib/chunk-R2LRLUUY.js.map +1 -1
  236. package/lib/chunk-R755X3AG.cjs.map +1 -1
  237. package/lib/chunk-RHARO4TQ.cjs.map +1 -1
  238. package/lib/{chunk-QHRQCFDB.js → chunk-RL7Y22OT.js} +2 -2
  239. package/lib/chunk-RL7Y22OT.js.map +1 -0
  240. package/lib/chunk-ROPOLXIV.js.map +1 -1
  241. package/lib/chunk-RT7XLEV6.js.map +1 -1
  242. package/lib/chunk-RTDD2NRL.cjs.map +1 -1
  243. package/lib/chunk-RTGW34KX.cjs.map +1 -1
  244. package/lib/{chunk-RTLW5O74.cjs → chunk-S3MCPCGR.cjs} +4 -4
  245. package/lib/{chunk-RTLW5O74.cjs.map → chunk-S3MCPCGR.cjs.map} +1 -1
  246. package/lib/chunk-SGOUEVJ3.cjs.map +1 -1
  247. package/lib/chunk-SGWRNEJB.cjs.map +1 -1
  248. package/lib/chunk-SKFA2ZIK.js.map +1 -1
  249. package/lib/chunk-SN6BP777.js.map +1 -1
  250. package/lib/chunk-SOXJJRL2.js.map +1 -1
  251. package/lib/chunk-SPLHKBWG.cjs.map +1 -1
  252. package/lib/chunk-SRW7OWVS.cjs.map +1 -1
  253. package/lib/chunk-SUJCEUOZ.cjs.map +1 -1
  254. package/lib/chunk-SWWPX4V4.cjs.map +1 -1
  255. package/lib/chunk-THO6KQJZ.js.map +1 -1
  256. package/lib/chunk-THVPSJTK.cjs.map +1 -1
  257. package/lib/chunk-TIJIXGNJ.cjs.map +1 -1
  258. package/lib/chunk-TM5OCFYV.cjs.map +1 -1
  259. package/lib/{chunk-VLLLEX5J.js → chunk-TOV6ECTA.js} +2 -2
  260. package/lib/chunk-TOV6ECTA.js.map +1 -0
  261. package/lib/chunk-TQFODT4D.cjs.map +1 -1
  262. package/lib/chunk-TSD2PK6H.js.map +1 -1
  263. package/lib/chunk-TSLXKI72.js.map +1 -1
  264. package/lib/chunk-U5FTZYJJ.js.map +1 -1
  265. package/lib/chunk-U6PW4AZV.js.map +1 -1
  266. package/lib/chunk-UB6JC3W7.js.map +1 -1
  267. package/lib/chunk-UBXNH6J3.js.map +1 -1
  268. package/lib/chunk-UP7FR6HD.cjs.map +1 -1
  269. package/lib/chunk-VNWOCO65.cjs.map +1 -1
  270. package/lib/chunk-VPXMI42G.cjs.map +1 -1
  271. package/lib/chunk-VRFSITD3.js.map +1 -1
  272. package/lib/chunk-VUCYIRSC.cjs.map +1 -1
  273. package/lib/{chunk-NJQDJCFB.cjs → chunk-W6AL2GJ4.cjs} +2 -2
  274. package/lib/{chunk-NJQDJCFB.cjs.map → chunk-W6AL2GJ4.cjs.map} +1 -1
  275. package/lib/{chunk-EKGR3EB3.js → chunk-W6YJDUYD.js} +2 -2
  276. package/lib/chunk-W6YJDUYD.js.map +1 -0
  277. package/lib/chunk-WAL76UPE.cjs.map +1 -1
  278. package/lib/chunk-WBPEFNL7.cjs.map +1 -1
  279. package/lib/{chunk-NKJBVNTV.cjs → chunk-WC4Z7ENS.cjs} +2 -2
  280. package/lib/chunk-WC4Z7ENS.cjs.map +1 -0
  281. package/lib/{chunk-BOPK7T5K.js → chunk-WI5IVLYL.js} +2 -2
  282. package/lib/chunk-WI5IVLYL.js.map +1 -0
  283. package/lib/chunk-WKN5RLNR.js.map +1 -1
  284. package/lib/chunk-WP3L72CW.js.map +1 -1
  285. package/lib/chunk-WTHX574O.js.map +1 -1
  286. package/lib/{chunk-IIR3UVU2.js → chunk-WVAW33XQ.js} +3 -3
  287. package/lib/chunk-WVAW33XQ.js.map +1 -0
  288. package/lib/{chunk-JENLN6VJ.js → chunk-WVKEXOIY.js} +5 -2
  289. package/lib/chunk-WVKEXOIY.js.map +1 -0
  290. package/lib/chunk-WXD4O4UY.js.map +1 -1
  291. package/lib/{chunk-RIMDGLIA.cjs → chunk-WXE5KXJC.cjs} +3 -3
  292. package/lib/chunk-WXE5KXJC.cjs.map +1 -0
  293. package/lib/chunk-X2D47UM7.cjs.map +1 -1
  294. package/lib/chunk-X6PHZA6P.cjs.map +1 -1
  295. package/lib/chunk-XD7GS4QW.js.map +1 -1
  296. package/lib/chunk-XMDDYWH5.js.map +1 -1
  297. package/lib/chunk-XPF5Z2WY.js.map +1 -1
  298. package/lib/chunk-XR3KEV7U.js.map +1 -1
  299. package/lib/chunk-XUC3BYL2.cjs.map +1 -1
  300. package/lib/chunk-Y2IGLW5N.js.map +1 -1
  301. package/lib/chunk-Y3BFYVWA.js.map +1 -1
  302. package/lib/{chunk-VMJUXZ67.cjs → chunk-Y5BP4C42.cjs} +2 -2
  303. package/lib/chunk-Y5BP4C42.cjs.map +1 -0
  304. package/lib/chunk-YAKNUPNE.cjs.map +1 -1
  305. package/lib/chunk-YAVHAWTZ.js.map +1 -1
  306. package/lib/chunk-YBXRC6MC.js.map +1 -1
  307. package/lib/chunk-YHYBOXVX.cjs.map +1 -1
  308. package/lib/chunk-YIDX7HVR.cjs.map +1 -1
  309. package/lib/chunk-YN4M5CNJ.js.map +1 -1
  310. package/lib/chunk-YOHBJHTH.cjs.map +1 -1
  311. package/lib/chunk-YUGZUUAU.js.map +1 -1
  312. package/lib/chunk-YY5ENJSH.cjs.map +1 -1
  313. package/lib/chunk-Z2QVXW6T.cjs.map +1 -1
  314. package/lib/chunk-Z667GAZJ.js.map +1 -1
  315. package/lib/chunk-Z7DKPFKZ.js.map +1 -1
  316. package/lib/chunk-ZAISVVBE.cjs.map +1 -1
  317. package/lib/chunk-ZASD6IUL.js.map +1 -1
  318. package/lib/chunk-ZEEB5YAU.js.map +1 -1
  319. package/lib/chunk-ZQSCFH5J.cjs.map +1 -1
  320. package/lib/chunk-ZTVQSWSD.cjs.map +1 -1
  321. package/lib/chunk-ZU7GFVQ6.js.map +1 -1
  322. package/lib/chunk-ZZF34M2E.cjs.map +1 -1
  323. package/lib/client.d.cts +3 -1
  324. package/lib/commercelayer.cjs +5 -5
  325. package/lib/commercelayer.d.cts +6 -4
  326. package/lib/commercelayer.d.ts +3 -3
  327. package/lib/commercelayer.js +1 -1
  328. package/lib/enum.d.cts +1 -1
  329. package/lib/enum.d.ts +1 -1
  330. package/lib/index.cjs +29 -29
  331. package/lib/index.d.cts +5 -2
  332. package/lib/index.d.ts +1 -1
  333. package/lib/index.js +14 -14
  334. package/lib/jsonapi.d.cts +1 -1
  335. package/lib/jsonapi.d.ts +1 -1
  336. package/lib/model.d.cts +1 -1
  337. package/lib/model.d.ts +1 -1
  338. package/lib/query.d.cts +1 -1
  339. package/lib/query.d.ts +1 -1
  340. package/lib/resource.d.cts +1 -1
  341. package/lib/resource.d.ts +1 -1
  342. package/lib/resources/addresses.d.cts +4 -1
  343. package/lib/resources/addresses.d.ts +1 -1
  344. package/lib/resources/adjustments.d.cts +4 -1
  345. package/lib/resources/adjustments.d.ts +1 -1
  346. package/lib/resources/adyen_gateways.d.cts +4 -1
  347. package/lib/resources/adyen_gateways.d.ts +1 -1
  348. package/lib/resources/adyen_payments.cjs +2 -2
  349. package/lib/resources/adyen_payments.d.cts +4 -1
  350. package/lib/resources/adyen_payments.d.ts +1 -1
  351. package/lib/resources/adyen_payments.js +1 -1
  352. package/lib/resources/applications.cjs +2 -2
  353. package/lib/resources/applications.d.cts +4 -1
  354. package/lib/resources/applications.d.ts +1 -1
  355. package/lib/resources/applications.js +1 -1
  356. package/lib/resources/attachments.d.cts +4 -1
  357. package/lib/resources/attachments.d.ts +1 -1
  358. package/lib/resources/authorizations.d.cts +4 -1
  359. package/lib/resources/authorizations.d.ts +1 -1
  360. package/lib/resources/avalara_accounts.d.cts +4 -1
  361. package/lib/resources/avalara_accounts.d.ts +1 -1
  362. package/lib/resources/axerve_gateways.d.cts +4 -1
  363. package/lib/resources/axerve_gateways.d.ts +1 -1
  364. package/lib/resources/axerve_payments.d.cts +4 -1
  365. package/lib/resources/axerve_payments.d.ts +1 -1
  366. package/lib/resources/bing_geocoders.d.cts +4 -1
  367. package/lib/resources/bing_geocoders.d.ts +1 -1
  368. package/lib/resources/braintree_gateways.d.cts +4 -1
  369. package/lib/resources/braintree_gateways.d.ts +1 -1
  370. package/lib/resources/braintree_payments.d.cts +4 -1
  371. package/lib/resources/braintree_payments.d.ts +1 -1
  372. package/lib/resources/bundles.d.cts +4 -1
  373. package/lib/resources/bundles.d.ts +1 -1
  374. package/lib/resources/buy_x_pay_y_promotions.d.cts +4 -1
  375. package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
  376. package/lib/resources/captures.d.cts +4 -1
  377. package/lib/resources/captures.d.ts +1 -1
  378. package/lib/resources/carrier_accounts.d.cts +4 -1
  379. package/lib/resources/carrier_accounts.d.ts +1 -1
  380. package/lib/resources/checkout_com_gateways.d.cts +4 -1
  381. package/lib/resources/checkout_com_gateways.d.ts +1 -1
  382. package/lib/resources/checkout_com_payments.cjs +2 -2
  383. package/lib/resources/checkout_com_payments.d.cts +4 -1
  384. package/lib/resources/checkout_com_payments.d.ts +1 -1
  385. package/lib/resources/checkout_com_payments.js +1 -1
  386. package/lib/resources/cleanups.d.cts +4 -1
  387. package/lib/resources/cleanups.d.ts +1 -1
  388. package/lib/resources/coupon_codes_promotion_rules.d.cts +4 -1
  389. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
  390. package/lib/resources/coupon_recipients.d.cts +4 -1
  391. package/lib/resources/coupon_recipients.d.ts +1 -1
  392. package/lib/resources/coupons.d.cts +4 -1
  393. package/lib/resources/coupons.d.ts +1 -1
  394. package/lib/resources/custom_promotion_rules.d.cts +4 -1
  395. package/lib/resources/custom_promotion_rules.d.ts +1 -1
  396. package/lib/resources/customer_addresses.d.cts +4 -1
  397. package/lib/resources/customer_addresses.d.ts +1 -1
  398. package/lib/resources/customer_groups.d.cts +4 -1
  399. package/lib/resources/customer_groups.d.ts +1 -1
  400. package/lib/resources/customer_password_resets.d.cts +4 -1
  401. package/lib/resources/customer_password_resets.d.ts +1 -1
  402. package/lib/resources/customer_payment_sources.d.cts +4 -1
  403. package/lib/resources/customer_payment_sources.d.ts +1 -1
  404. package/lib/resources/customer_subscriptions.d.cts +4 -1
  405. package/lib/resources/customer_subscriptions.d.ts +1 -1
  406. package/lib/resources/customers.cjs +2 -2
  407. package/lib/resources/customers.d.cts +4 -1
  408. package/lib/resources/customers.d.ts +1 -1
  409. package/lib/resources/customers.js +1 -1
  410. package/lib/resources/delivery_lead_times.d.cts +4 -1
  411. package/lib/resources/delivery_lead_times.d.ts +1 -1
  412. package/lib/resources/discount_engine_items.d.cts +4 -1
  413. package/lib/resources/discount_engine_items.d.ts +1 -1
  414. package/lib/resources/discount_engines.d.cts +4 -1
  415. package/lib/resources/discount_engines.d.ts +1 -1
  416. package/lib/resources/easypost_pickups.d.cts +4 -1
  417. package/lib/resources/easypost_pickups.d.ts +1 -1
  418. package/lib/resources/event_callbacks.d.cts +4 -1
  419. package/lib/resources/event_callbacks.d.ts +1 -1
  420. package/lib/resources/events.d.cts +4 -1
  421. package/lib/resources/events.d.ts +1 -1
  422. package/lib/resources/exports.d.cts +4 -1
  423. package/lib/resources/exports.d.ts +1 -1
  424. package/lib/resources/external_gateways.d.cts +4 -1
  425. package/lib/resources/external_gateways.d.ts +1 -1
  426. package/lib/resources/external_payments.d.cts +4 -1
  427. package/lib/resources/external_payments.d.ts +1 -1
  428. package/lib/resources/external_promotions.d.cts +4 -1
  429. package/lib/resources/external_promotions.d.ts +1 -1
  430. package/lib/resources/external_tax_calculators.d.cts +4 -1
  431. package/lib/resources/external_tax_calculators.d.ts +1 -1
  432. package/lib/resources/fixed_amount_promotions.d.cts +4 -1
  433. package/lib/resources/fixed_amount_promotions.d.ts +1 -1
  434. package/lib/resources/fixed_price_promotions.d.cts +4 -1
  435. package/lib/resources/fixed_price_promotions.d.ts +1 -1
  436. package/lib/resources/flex_promotions.cjs +2 -2
  437. package/lib/resources/flex_promotions.d.cts +4 -1
  438. package/lib/resources/flex_promotions.d.ts +1 -1
  439. package/lib/resources/flex_promotions.js +1 -1
  440. package/lib/resources/free_gift_promotions.d.cts +4 -1
  441. package/lib/resources/free_gift_promotions.d.ts +1 -1
  442. package/lib/resources/free_shipping_promotions.d.cts +4 -1
  443. package/lib/resources/free_shipping_promotions.d.ts +1 -1
  444. package/lib/resources/geocoders.d.cts +4 -1
  445. package/lib/resources/geocoders.d.ts +1 -1
  446. package/lib/resources/gift_card_recipients.d.cts +4 -1
  447. package/lib/resources/gift_card_recipients.d.ts +1 -1
  448. package/lib/resources/gift_cards.d.cts +4 -1
  449. package/lib/resources/gift_cards.d.ts +1 -1
  450. package/lib/resources/google_geocoders.d.cts +4 -1
  451. package/lib/resources/google_geocoders.d.ts +1 -1
  452. package/lib/resources/imports.d.cts +4 -1
  453. package/lib/resources/imports.d.ts +1 -1
  454. package/lib/resources/in_stock_subscriptions.d.cts +4 -1
  455. package/lib/resources/in_stock_subscriptions.d.ts +1 -1
  456. package/lib/resources/inventory_models.d.cts +4 -1
  457. package/lib/resources/inventory_models.d.ts +1 -1
  458. package/lib/resources/inventory_return_locations.d.cts +4 -1
  459. package/lib/resources/inventory_return_locations.d.ts +1 -1
  460. package/lib/resources/inventory_stock_locations.d.cts +4 -1
  461. package/lib/resources/inventory_stock_locations.d.ts +1 -1
  462. package/lib/resources/klarna_gateways.d.cts +4 -1
  463. package/lib/resources/klarna_gateways.d.ts +1 -1
  464. package/lib/resources/klarna_payments.d.cts +4 -1
  465. package/lib/resources/klarna_payments.d.ts +1 -1
  466. package/lib/resources/line_item_options.d.cts +4 -1
  467. package/lib/resources/line_item_options.d.ts +1 -1
  468. package/lib/resources/line_items.cjs +2 -2
  469. package/lib/resources/line_items.d.cts +4 -1
  470. package/lib/resources/line_items.d.ts +1 -1
  471. package/lib/resources/line_items.js +1 -1
  472. package/lib/resources/links.d.cts +4 -1
  473. package/lib/resources/links.d.ts +1 -1
  474. package/lib/resources/manual_gateways.d.cts +4 -1
  475. package/lib/resources/manual_gateways.d.ts +1 -1
  476. package/lib/resources/manual_tax_calculators.d.cts +4 -1
  477. package/lib/resources/manual_tax_calculators.d.ts +1 -1
  478. package/lib/resources/markets.d.cts +4 -1
  479. package/lib/resources/markets.d.ts +1 -1
  480. package/lib/resources/merchants.d.cts +4 -1
  481. package/lib/resources/merchants.d.ts +1 -1
  482. package/lib/resources/notifications.d.cts +4 -1
  483. package/lib/resources/notifications.d.ts +1 -1
  484. package/lib/resources/order_amount_promotion_rules.d.cts +4 -1
  485. package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
  486. package/lib/resources/order_copies.d.cts +4 -1
  487. package/lib/resources/order_copies.d.ts +1 -1
  488. package/lib/resources/order_factories.d.cts +4 -1
  489. package/lib/resources/order_factories.d.ts +1 -1
  490. package/lib/resources/order_subscription_items.d.cts +4 -1
  491. package/lib/resources/order_subscription_items.d.ts +1 -1
  492. package/lib/resources/order_subscriptions.d.cts +4 -1
  493. package/lib/resources/order_subscriptions.d.ts +1 -1
  494. package/lib/resources/orders.d.cts +4 -1
  495. package/lib/resources/orders.d.ts +1 -1
  496. package/lib/resources/organizations.d.cts +4 -1
  497. package/lib/resources/organizations.d.ts +1 -1
  498. package/lib/resources/packages.d.cts +4 -1
  499. package/lib/resources/packages.d.ts +1 -1
  500. package/lib/resources/parcel_line_items.d.cts +4 -1
  501. package/lib/resources/parcel_line_items.d.ts +1 -1
  502. package/lib/resources/parcels.d.cts +4 -1
  503. package/lib/resources/parcels.d.ts +1 -1
  504. package/lib/resources/payment_gateways.d.cts +4 -1
  505. package/lib/resources/payment_gateways.d.ts +1 -1
  506. package/lib/resources/payment_methods.cjs +2 -2
  507. package/lib/resources/payment_methods.d.cts +4 -1
  508. package/lib/resources/payment_methods.d.ts +1 -1
  509. package/lib/resources/payment_methods.js +1 -1
  510. package/lib/resources/payment_options.cjs +2 -2
  511. package/lib/resources/payment_options.d.cts +4 -1
  512. package/lib/resources/payment_options.d.ts +1 -1
  513. package/lib/resources/payment_options.js +1 -1
  514. package/lib/resources/paypal_gateways.d.cts +4 -1
  515. package/lib/resources/paypal_gateways.d.ts +1 -1
  516. package/lib/resources/paypal_payments.d.cts +4 -1
  517. package/lib/resources/paypal_payments.d.ts +1 -1
  518. package/lib/resources/percentage_discount_promotions.d.cts +4 -1
  519. package/lib/resources/percentage_discount_promotions.d.ts +1 -1
  520. package/lib/resources/pickups.d.cts +4 -1
  521. package/lib/resources/pickups.d.ts +1 -1
  522. package/lib/resources/price_frequency_tiers.d.cts +4 -1
  523. package/lib/resources/price_frequency_tiers.d.ts +1 -1
  524. package/lib/resources/price_list_schedulers.d.cts +4 -1
  525. package/lib/resources/price_list_schedulers.d.ts +1 -1
  526. package/lib/resources/price_lists.cjs +2 -2
  527. package/lib/resources/price_lists.d.cts +4 -1
  528. package/lib/resources/price_lists.d.ts +1 -1
  529. package/lib/resources/price_lists.js +1 -1
  530. package/lib/resources/price_tiers.d.cts +4 -1
  531. package/lib/resources/price_tiers.d.ts +1 -1
  532. package/lib/resources/price_volume_tiers.d.cts +4 -1
  533. package/lib/resources/price_volume_tiers.d.ts +1 -1
  534. package/lib/resources/prices.cjs +2 -2
  535. package/lib/resources/prices.d.cts +4 -1
  536. package/lib/resources/prices.d.ts +1 -1
  537. package/lib/resources/prices.js +1 -1
  538. package/lib/resources/promotion_rules.d.cts +4 -1
  539. package/lib/resources/promotion_rules.d.ts +1 -1
  540. package/lib/resources/promotions.d.cts +4 -1
  541. package/lib/resources/promotions.d.ts +1 -1
  542. package/lib/resources/recurring_order_copies.d.cts +4 -1
  543. package/lib/resources/recurring_order_copies.d.ts +1 -1
  544. package/lib/resources/refunds.d.cts +4 -1
  545. package/lib/resources/refunds.d.ts +1 -1
  546. package/lib/resources/reserved_stocks.d.cts +4 -1
  547. package/lib/resources/reserved_stocks.d.ts +1 -1
  548. package/lib/resources/resource_errors.d.cts +4 -1
  549. package/lib/resources/resource_errors.d.ts +1 -1
  550. package/lib/resources/return_line_items.d.cts +4 -1
  551. package/lib/resources/return_line_items.d.ts +1 -1
  552. package/lib/resources/returns.d.cts +4 -1
  553. package/lib/resources/returns.d.ts +1 -1
  554. package/lib/resources/satispay_gateways.d.cts +4 -1
  555. package/lib/resources/satispay_gateways.d.ts +1 -1
  556. package/lib/resources/satispay_payments.d.cts +4 -1
  557. package/lib/resources/satispay_payments.d.ts +1 -1
  558. package/lib/resources/shipments.d.cts +4 -1
  559. package/lib/resources/shipments.d.ts +1 -1
  560. package/lib/resources/shipping_categories.d.cts +4 -1
  561. package/lib/resources/shipping_categories.d.ts +1 -1
  562. package/lib/resources/shipping_method_tiers.d.cts +4 -1
  563. package/lib/resources/shipping_method_tiers.d.ts +1 -1
  564. package/lib/resources/shipping_methods.cjs +2 -2
  565. package/lib/resources/shipping_methods.d.cts +4 -1
  566. package/lib/resources/shipping_methods.d.ts +1 -1
  567. package/lib/resources/shipping_methods.js +1 -1
  568. package/lib/resources/shipping_weight_tiers.d.cts +4 -1
  569. package/lib/resources/shipping_weight_tiers.d.ts +1 -1
  570. package/lib/resources/shipping_zones.d.cts +4 -1
  571. package/lib/resources/shipping_zones.d.ts +1 -1
  572. package/lib/resources/sku_list_items.d.cts +4 -1
  573. package/lib/resources/sku_list_items.d.ts +1 -1
  574. package/lib/resources/sku_list_promotion_rules.d.cts +4 -1
  575. package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
  576. package/lib/resources/sku_lists.d.cts +4 -1
  577. package/lib/resources/sku_lists.d.ts +1 -1
  578. package/lib/resources/sku_options.d.cts +4 -1
  579. package/lib/resources/sku_options.d.ts +1 -1
  580. package/lib/resources/skus.d.cts +4 -1
  581. package/lib/resources/skus.d.ts +1 -1
  582. package/lib/resources/stock_items.d.cts +4 -1
  583. package/lib/resources/stock_items.d.ts +1 -1
  584. package/lib/resources/stock_line_items.d.cts +4 -1
  585. package/lib/resources/stock_line_items.d.ts +1 -1
  586. package/lib/resources/stock_locations.d.cts +4 -1
  587. package/lib/resources/stock_locations.d.ts +1 -1
  588. package/lib/resources/stock_reservations.d.cts +4 -1
  589. package/lib/resources/stock_reservations.d.ts +1 -1
  590. package/lib/resources/stock_transfers.d.cts +4 -1
  591. package/lib/resources/stock_transfers.d.ts +1 -1
  592. package/lib/resources/stores.d.cts +4 -1
  593. package/lib/resources/stores.d.ts +1 -1
  594. package/lib/resources/stripe_gateways.d.cts +4 -1
  595. package/lib/resources/stripe_gateways.d.ts +1 -1
  596. package/lib/resources/stripe_payments.d.cts +4 -1
  597. package/lib/resources/stripe_payments.d.ts +1 -1
  598. package/lib/resources/stripe_tax_accounts.d.cts +4 -1
  599. package/lib/resources/stripe_tax_accounts.d.ts +1 -1
  600. package/lib/resources/subscription_models.d.cts +4 -1
  601. package/lib/resources/subscription_models.d.ts +1 -1
  602. package/lib/resources/tags.d.cts +4 -1
  603. package/lib/resources/tags.d.ts +1 -1
  604. package/lib/resources/talon_one_accounts.cjs +2 -2
  605. package/lib/resources/talon_one_accounts.d.cts +4 -1
  606. package/lib/resources/talon_one_accounts.d.ts +1 -1
  607. package/lib/resources/talon_one_accounts.js +1 -1
  608. package/lib/resources/tax_calculators.d.cts +4 -1
  609. package/lib/resources/tax_calculators.d.ts +1 -1
  610. package/lib/resources/tax_categories.d.cts +4 -1
  611. package/lib/resources/tax_categories.d.ts +1 -1
  612. package/lib/resources/tax_rules.d.cts +4 -1
  613. package/lib/resources/tax_rules.d.ts +1 -1
  614. package/lib/resources/taxjar_accounts.d.cts +4 -1
  615. package/lib/resources/taxjar_accounts.d.ts +1 -1
  616. package/lib/resources/transactions.d.cts +4 -1
  617. package/lib/resources/transactions.d.ts +1 -1
  618. package/lib/resources/versions.d.cts +4 -1
  619. package/lib/resources/versions.d.ts +1 -1
  620. package/lib/resources/vertex_accounts.d.cts +4 -1
  621. package/lib/resources/vertex_accounts.d.ts +1 -1
  622. package/lib/resources/voids.d.cts +4 -1
  623. package/lib/resources/voids.d.ts +1 -1
  624. package/lib/resources/webhooks.d.cts +4 -1
  625. package/lib/resources/webhooks.d.ts +1 -1
  626. package/lib/resources/wire_transfers.d.cts +4 -1
  627. package/lib/resources/wire_transfers.d.ts +1 -1
  628. package/lib/static.cjs +3 -3
  629. package/lib/static.d.cts +1 -1
  630. package/lib/static.d.ts +1 -1
  631. package/lib/static.js +2 -2
  632. package/package.json +8 -8
  633. package/lib/chunk-465K3KVE.js.map +0 -1
  634. package/lib/chunk-7X36B7N6.js.map +0 -1
  635. package/lib/chunk-BOPK7T5K.js.map +0 -1
  636. package/lib/chunk-EKGR3EB3.js.map +0 -1
  637. package/lib/chunk-HLCGKY7R.js.map +0 -1
  638. package/lib/chunk-HQ35KQFG.cjs.map +0 -1
  639. package/lib/chunk-IIR3UVU2.js.map +0 -1
  640. package/lib/chunk-JENLN6VJ.js.map +0 -1
  641. package/lib/chunk-KBN3FFXD.cjs.map +0 -1
  642. package/lib/chunk-LCLXLB2R.cjs.map +0 -1
  643. package/lib/chunk-LEWK7QET.cjs.map +0 -1
  644. package/lib/chunk-NKJBVNTV.cjs.map +0 -1
  645. package/lib/chunk-NMVACSMG.js.map +0 -1
  646. package/lib/chunk-OPQJPXLM.cjs.map +0 -1
  647. package/lib/chunk-P3NADEGE.cjs.map +0 -1
  648. package/lib/chunk-QHRQCFDB.js.map +0 -1
  649. package/lib/chunk-RIMDGLIA.cjs.map +0 -1
  650. package/lib/chunk-RWPFE3LF.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;AACtJ,EAEA,MAAM,QAAA,CAAS,SAA6B,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACzI,IAAM,MAAA,UAAA,GAAc,UAAsB,EAAM,IAAA,SAAA;AAChD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAa,UAAA,EAAA,UAAU,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/G,EAGA,UAAU,QAAoC,EAAA;AAC7C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,SAAS,CAAA,IAAA;AAAA;AACrD,EAGA,aAAa,EAA4C,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAA6B,EAAA;AAClD,IAAO,OAAA,KAAA,CAAM,qBAAkC,CAAA,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAoB,GAAA;AACnB,IAAA,OAAO,SAAS,CAAA,IAAA;AAAA;AAGlB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,QAAS,EAAA;AAC9B,IAAO,iBAAQ,GAAA","file":"chunk-PZZLLHJP.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ManualTaxCalculator, ManualTaxCalculatorType } from './manual_tax_calculators'\nimport type { Version } from './versions'\n\n\ntype TaxRuleType = 'tax_rules'\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\n\n\nexport type TaxRuleSort = Pick<TaxRule, 'id' | 'name' | 'tax_rate'> & ResourceSort\n// export type TaxRuleFilter = Pick<TaxRule, 'id' | 'name' | 'tax_rate' | 'freight_taxable' | 'payment_method_taxable' | 'gift_card_taxable' | 'adjustment_taxable'> & ResourceFilter\n\n\ninterface TaxRule extends Resource {\n\t\n\treadonly type: TaxRuleType\n\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The breakdown for this tax rule (if calculated).\n\t * @example ```{\"41\":{\"tax_rate\":0.22}}```\n\t */\n\tbreakdown?: Record<string, any> | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculator | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface TaxRuleCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator: ManualTaxCalculatorRel\n\n}\n\n\ninterface TaxRuleUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculatorRel | null\n\n}\n\n\nclass TaxRules extends ApiResource<TaxRule> {\n\n\tstatic readonly TYPE: TaxRuleType = 'tax_rules' as const\n\n\tasync create(resource: TaxRuleCreate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.create<TaxRuleCreate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.update<TaxRuleUpdate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: TaxRules.TYPE } : id, options)\n\t}\n\n\tasync manual_tax_calculator(taxRuleId: string | TaxRule, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<ManualTaxCalculator>({ type: 'manual_tax_calculators' }, `tax_rules/${_taxRuleId}/manual_tax_calculator`, params, options) as unknown as ManualTaxCalculator\n\t}\n\n\tasync versions(taxRuleId: string | TaxRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `tax_rules/${_taxRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisTaxRule(resource: any): resource is TaxRule {\n\t\treturn resource.type && (resource.type === TaxRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxRuleRel {\n\t\treturn super.relationshipOneToOne<TaxRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxRuleRel[] {\n\t\treturn super.relationshipOneToMany<TaxRuleRel>(...ids)\n\t}\n\n\n\ttype(): TaxRuleType {\n\t\treturn TaxRules.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxRules()\nexport default instance\n\nexport type { TaxRules, TaxRule, TaxRuleCreate, TaxRuleUpdate, TaxRuleType }\n"]}
1
+ {"version":3,"sources":["../src/resources/tax_rules.ts"],"names":[],"mappings":";;;AAyNA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,WAAA,CAAqB;AAAA,EAE3C,OAAgB,IAAA,GAAoB,WAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AAChG,EAEA,MAAM,qBAAA,CAAsB,SAAA,EAA6B,MAAA,EAAmD,OAAA,EAAyD;AACpK,IAAA,MAAM,UAAA,GAAc,UAAsB,EAAA,IAAM,SAAA;AAChD,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAA2B,EAAE,IAAA,EAAM,wBAAA,EAAyB,EAAG,CAAA,UAAA,EAAa,UAAU,CAAA,sBAAA,CAAA,EAA0B,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtJ,EAEA,MAAM,QAAA,CAAS,SAAA,EAA6B,MAAA,EAAmC,OAAA,EAA2D;AACzI,IAAA,MAAM,UAAA,GAAc,UAAsB,EAAA,IAAM,SAAA;AAChD,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAe,EAAE,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,UAAA,EAAa,UAAU,CAAA,SAAA,CAAA,EAAa,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/G,EAGA,UAAU,QAAA,EAAoC;AAC7C,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,SAAA,CAAS,IAAA;AAAA;AACrD,EAGA,aAAa,EAAA,EAA4C;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAAA,EAA6B;AAClD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAkC,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAA,GAAoB;AACnB,IAAA,OAAO,SAAA,CAAS,IAAA;AAAA;AAGlB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,QAAA,EAAS;AAC9B,IAAO,iBAAA,GAAQ","file":"chunk-PZZLLHJP.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ManualTaxCalculator, ManualTaxCalculatorType } from './manual_tax_calculators'\nimport type { Version } from './versions'\n\n\ntype TaxRuleType = 'tax_rules'\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\n\n\nexport type TaxRuleSort = Pick<TaxRule, 'id' | 'name' | 'tax_rate'> & ResourceSort\n// export type TaxRuleFilter = Pick<TaxRule, 'id' | 'name' | 'tax_rate' | 'freight_taxable' | 'payment_method_taxable' | 'gift_card_taxable' | 'adjustment_taxable'> & ResourceFilter\n\n\ninterface TaxRule extends Resource {\n\t\n\treadonly type: TaxRuleType\n\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The breakdown for this tax rule (if calculated).\n\t * @example ```{\"41\":{\"tax_rate\":0.22}}```\n\t */\n\tbreakdown?: Record<string, any> | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculator | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface TaxRuleCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator: ManualTaxCalculatorRel\n\n}\n\n\ninterface TaxRuleUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculatorRel | null\n\n}\n\n\nclass TaxRules extends ApiResource<TaxRule> {\n\n\tstatic readonly TYPE: TaxRuleType = 'tax_rules' as const\n\n\tasync create(resource: TaxRuleCreate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.create<TaxRuleCreate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.update<TaxRuleUpdate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: TaxRules.TYPE } : id, options)\n\t}\n\n\tasync manual_tax_calculator(taxRuleId: string | TaxRule, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<ManualTaxCalculator>({ type: 'manual_tax_calculators' }, `tax_rules/${_taxRuleId}/manual_tax_calculator`, params, options) as unknown as ManualTaxCalculator\n\t}\n\n\tasync versions(taxRuleId: string | TaxRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `tax_rules/${_taxRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisTaxRule(resource: any): resource is TaxRule {\n\t\treturn resource.type && (resource.type === TaxRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxRuleRel {\n\t\treturn super.relationshipOneToOne<TaxRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxRuleRel[] {\n\t\treturn super.relationshipOneToMany<TaxRuleRel>(...ids)\n\t}\n\n\n\ttype(): TaxRuleType {\n\t\treturn TaxRules.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxRules()\nexport default instance\n\nexport type { TaxRules, TaxRule, TaxRuleCreate, TaxRuleUpdate, TaxRuleType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/merchants.ts"],"names":[],"mappings":";;;AA6DA,IAAM,SAAA,GAAN,MAAM,UAAA,SAAkB,WAAsB,CAAA;AAAA,EAE7C,OAAgB,IAAqB,GAAA,WAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,UAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,MAAA,CAAO,QAA0B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AAC5H,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAiC,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,UAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,UAAA,CAAU,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACjG,EAEA,MAAM,OAAA,CAAQ,UAA+B,EAAA,MAAA,EAAuC,OAA6C,EAAA;AAChI,IAAM,MAAA,WAAA,GAAe,WAAwB,EAAM,IAAA,UAAA;AACnD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,WAAY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, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Address, AddressType } from './addresses'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype MerchantType = 'merchants'\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype AddressRel = ResourceRel & { type: AddressType }\n\n\nexport type MerchantSort = Pick<Merchant, 'id' | 'name'> & ResourceSort\n// export type MerchantFilter = Pick<Merchant, 'id' | 'name'> & ResourceFilter\n\n\ninterface Merchant extends Resource {\n\t\n\treadonly type: MerchantType\n\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname: string\n\n\taddress?: Address | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface MerchantCreate extends ResourceCreate {\n\t\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname: string\n\n\taddress: AddressRel\n\n}\n\n\ninterface MerchantUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname?: string | null\n\n\taddress?: AddressRel | null\n\n}\n\n\nclass Merchants extends ApiResource<Merchant> {\n\n\tstatic readonly TYPE: MerchantType = 'merchants' as const\n\n\tasync create(resource: MerchantCreate, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\treturn this.resources.create<MerchantCreate, Merchant>({ ...resource, type: Merchants.TYPE }, params, options)\n\t}\n\n\tasync update(resource: MerchantUpdate, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\treturn this.resources.update<MerchantUpdate, Merchant>({ ...resource, type: Merchants.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Merchants.TYPE } : id, options)\n\t}\n\n\tasync address(merchantId: string | Merchant, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `merchants/${_merchantId}/address`, params, options) as unknown as Address\n\t}\n\n\tasync attachments(merchantId: string | Merchant, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `merchants/${_merchantId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(merchantId: string | Merchant, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `merchants/${_merchantId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisMerchant(resource: any): resource is Merchant {\n\t\treturn resource.type && (resource.type === Merchants.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): MerchantRel {\n\t\treturn super.relationshipOneToOne<MerchantRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): MerchantRel[] {\n\t\treturn super.relationshipOneToMany<MerchantRel>(...ids)\n\t}\n\n\n\ttype(): MerchantType {\n\t\treturn Merchants.TYPE\n\t}\n\n}\n\n\nconst instance = new Merchants()\nexport default instance\n\nexport type { Merchants, Merchant, MerchantCreate, MerchantUpdate, MerchantType }\n"]}
1
+ {"version":3,"sources":["../src/resources/merchants.ts"],"names":[],"mappings":";;;AA6DA,IAAM,SAAA,GAAN,MAAM,UAAA,SAAkB,WAAA,CAAsB;AAAA,EAE7C,OAAgB,IAAA,GAAqB,WAAA;AAAA,EAErC,MAAM,MAAA,CAAO,QAAA,EAA0B,MAAA,EAAwC,OAAA,EAA8C;AAC5H,IA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+B,MAAA,EAAmC,OAAA,EAA2D;AAC3I,IAAA,MAAM,WAAA,GAAe,WAAwB,EAAA,IAAM,UAAA;AACnD,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAe,EAAE,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,UAAA,EAAa,WAAW,CAAA,SAAA,CAAA,EAAa,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChH,EAGA,WAAW,QAAA,EAAqC;AAC/C,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,UAAA,CAAU,IAAA;AAAA;AACtD,EAGA,aAAa,EAAA,EAA6C;AACzD,IAAA,OAAO,KAAA,CAAM,qBAAkC,EAAE,CAAA;AAAA;AAClD,EAEA,sBAAsB,GAAA,EAA8B;AACnD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAmC,GAAG,GAAG,CAAA;AAAA;AACvD,EAGA,IAAA,GAAqB;AACpB,IAAA,OAAO,UAAA,CAAU,IAAA;AAAA;AAGnB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,SAAA,EAAU;AAC/B,IAAO,iBAAA,GAAQ","file":"chunk-Q2ZSQM7I.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Address, AddressType } from './addresses'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype MerchantType = 'merchants'\ntype MerchantRel = ResourceRel & { type: MerchantType }\ntype AddressRel = ResourceRel & { type: AddressType }\n\n\nexport type MerchantSort = Pick<Merchant, 'id' | 'name'> & ResourceSort\n// export type MerchantFilter = Pick<Merchant, 'id' | 'name'> & ResourceFilter\n\n\ninterface Merchant extends Resource {\n\t\n\treadonly type: MerchantType\n\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname: string\n\n\taddress?: Address | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface MerchantCreate extends ResourceCreate {\n\t\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname: string\n\n\taddress: AddressRel\n\n}\n\n\ninterface MerchantUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The merchant's internal name.\n\t * @example ```\"The Brand Inc.\"```\n\t */\n\tname?: string | null\n\n\taddress?: AddressRel | null\n\n}\n\n\nclass Merchants extends ApiResource<Merchant> {\n\n\tstatic readonly TYPE: MerchantType = 'merchants' as const\n\n\tasync create(resource: MerchantCreate, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\treturn this.resources.create<MerchantCreate, Merchant>({ ...resource, type: Merchants.TYPE }, params, options)\n\t}\n\n\tasync update(resource: MerchantUpdate, params?: QueryParamsRetrieve<Merchant>, options?: ResourcesConfig): Promise<Merchant> {\n\t\treturn this.resources.update<MerchantUpdate, Merchant>({ ...resource, type: Merchants.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Merchants.TYPE } : id, options)\n\t}\n\n\tasync address(merchantId: string | Merchant, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `merchants/${_merchantId}/address`, params, options) as unknown as Address\n\t}\n\n\tasync attachments(merchantId: string | Merchant, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `merchants/${_merchantId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(merchantId: string | Merchant, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _merchantId = (merchantId as Merchant).id || merchantId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `merchants/${_merchantId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisMerchant(resource: any): resource is Merchant {\n\t\treturn resource.type && (resource.type === Merchants.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): MerchantRel {\n\t\treturn super.relationshipOneToOne<MerchantRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): MerchantRel[] {\n\t\treturn super.relationshipOneToMany<MerchantRel>(...ids)\n\t}\n\n\n\ttype(): MerchantType {\n\t\treturn Merchants.TYPE\n\t}\n\n}\n\n\nconst instance = new Merchants()\nexport default instance\n\nexport type { Merchants, Merchant, MerchantCreate, MerchantUpdate, MerchantType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/reserved_stocks.ts"],"names":[],"mappings":";;;AAoCA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAyC,EAAA,MAAA,EAAyC,OAA+C,EAAA;AACjJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAc,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAe,WAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA,MAAM,GAAA,CAAI,eAAyC,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC9H,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAW,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esContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStocks, ReservedStock, ReservedStockType }\n"]}
1
+ {"version":3,"sources":["../src/resources/reserved_stocks.ts"],"names":[],"mappings":";;;AAoCA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,UAAA,CAAW,eAAA,EAAyC,MAAA,EAAyC,OAAA,EAA+C;AACjJ,IAAA,MAAM,gBAAA,GAAoB,gBAAkC,EAAA,IAAM,eAAA;AAClE,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAiB,EAAE,IAAA,EAAM,aAAA,EAAc,EAAG,CAAA,gBAAA,EAAmB,gBAAgB,CAAA,WAAA,CAAA,EAAe,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClI,EAEA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AC5D,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-Q66HILUF.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { StockItem } from './stock_items'\nimport type { Sku } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype ReservedStockType = 'reserved_stocks'\ntype ReservedStockRel = ResourceRel & { type: ReservedStockType }\n\n\nexport type ReservedStockSort = Pick<ReservedStock, 'id' | 'quantity'> & ResourceSort\n// export type ReservedStockFilter = Pick<ReservedStock, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ReservedStock extends Resource {\n\t\n\treadonly type: ReservedStockType\n\n\t/** \n\t * The stock item reserved quantity.\n\t * @example ```100```\n\t */\n\tquantity: number\n\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservations?: StockReservation[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass ReservedStocks extends ApiResource<ReservedStock> {\n\n\tstatic readonly TYPE: ReservedStockType = 'reserved_stocks' as const\n\n\tasync stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync versions(reservedStockId: string | ReservedStock, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _reservedStockId = (reservedStockId as ReservedStock).id || reservedStockId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `reserved_stocks/${_reservedStockId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisReservedStock(resource: any): resource is ReservedStock {\n\t\treturn resource.type && (resource.type === ReservedStocks.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReservedStockRel {\n\t\treturn super.relationshipOneToOne<ReservedStockRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReservedStockRel[] {\n\t\treturn super.relationshipOneToMany<ReservedStockRel>(...ids)\n\t}\n\n\n\ttype(): ReservedStockType {\n\t\treturn ReservedStocks.TYPE\n\t}\n\n}\n\n\nconst instance = new ReservedStocks()\nexport default instance\n\nexport type { ReservedStocks, ReservedStock, ReservedStockType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/klarna_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AAoFA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,6BAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,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OAA2D,EAAA;AACrJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3H,EAEA,MAAM,OAAA,CAAQ,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AACzI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,eAAe,CAAA,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"chunk-Q66JEOCJ.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype KlarnaPaymentType = 'klarna_payments'\ntype KlarnaPaymentRel = ResourceRel & { type: KlarnaPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type KlarnaPaymentSort = Pick<KlarnaPayment, 'id'> & ResourceSort\n// export type KlarnaPaymentFilter = Pick<KlarnaPayment, 'id' | 'mismatched_amounts'> & ResourceFilter\n\n\ninterface KlarnaPayment extends Resource {\n\t\n\treadonly type: KlarnaPaymentType\n\n\t/** \n\t * The identifier of the payment session.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tsession_id?: string | null\n\t/** \n\t * The public token linked to your API credential. Available upon session creation.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_token?: string | null\n\t/** \n\t * The merchant available payment methods for the assoiated order. Available upon session creation.\n\t * @example ```[{\"foo\":\"bar\"}]```\n\t */\n\tpayment_methods: Array<Record<string, any>>\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface KlarnaPaymentCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\n}\n\n\ninterface KlarnaPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Send this attribute if you want to update the payment session with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass KlarnaPayments extends ApiResource<KlarnaPayment> {\n\n\tstatic readonly TYPE: KlarnaPaymentType = 'klarna_payments' as const\n\n\tasync create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.create<KlarnaPaymentCreate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: KlarnaPayments.TYPE } : id, options)\n\t}\n\n\tasync order(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `klarna_payments/${_klarnaPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `klarna_payments/${_klarnaPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `klarna_payments/${_klarnaPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | KlarnaPayment, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ id: (typeof id === 'string')? id: id.id, type: KlarnaPayments.TYPE, _update: true }, params, options)\n\t}\n\n\n\tisKlarnaPayment(resource: any): resource is KlarnaPayment {\n\t\treturn resource.type && (resource.type === KlarnaPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): KlarnaPaymentRel {\n\t\treturn super.relationshipOneToOne<KlarnaPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): KlarnaPaymentRel[] {\n\t\treturn super.relationshipOneToMany<KlarnaPaymentRel>(...ids)\n\t}\n\n\n\ttype(): KlarnaPaymentType {\n\t\treturn KlarnaPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new KlarnaPayments()\nexport default instance\n\nexport type { KlarnaPayments, KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate, KlarnaPaymentType }\n"]}
1
+ {"version":3,"sources":["../src/resources/klarna_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AAoFA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,6BAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU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A,EAAQ,OAAO,CAAA;AAAA;AAC3H,EAEA,MAAM,OAAA,CAAQ,EAAA,EAA4B,MAAA,EAA6C,OAAA,EAAmD;AACzI,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,EAAA,EAAK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,eAAA,CAAe,IAAA,EAAM,SAAS,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAGA,gBAAgB,QAAA,EAA0C;AACzD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-Q66JEOCJ.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype KlarnaPaymentType = 'klarna_payments'\ntype KlarnaPaymentRel = ResourceRel & { type: KlarnaPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type KlarnaPaymentSort = Pick<KlarnaPayment, 'id'> & ResourceSort\n// export type KlarnaPaymentFilter = Pick<KlarnaPayment, 'id' | 'mismatched_amounts'> & ResourceFilter\n\n\ninterface KlarnaPayment extends Resource {\n\t\n\treadonly type: KlarnaPaymentType\n\n\t/** \n\t * The identifier of the payment session.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tsession_id?: string | null\n\t/** \n\t * The public token linked to your API credential. Available upon session creation.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tclient_token?: string | null\n\t/** \n\t * The merchant available payment methods for the assoiated order. Available upon session creation.\n\t * @example ```[{\"foo\":\"bar\"}]```\n\t */\n\tpayment_methods: Array<Record<string, any>>\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface KlarnaPaymentCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\n}\n\n\ninterface KlarnaPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The token returned by a successful client authorization, mandatory to place the order.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tauth_token?: string | null\n\t/** \n\t * Send this attribute if you want to update the payment session with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass KlarnaPayments extends ApiResource<KlarnaPayment> {\n\n\tstatic readonly TYPE: KlarnaPaymentType = 'klarna_payments' as const\n\n\tasync create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.create<KlarnaPaymentCreate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ ...resource, type: KlarnaPayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: KlarnaPayments.TYPE } : id, options)\n\t}\n\n\tasync order(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `klarna_payments/${_klarnaPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `klarna_payments/${_klarnaPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _klarnaPaymentId = (klarnaPaymentId as KlarnaPayment).id || klarnaPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `klarna_payments/${_klarnaPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | KlarnaPayment, params?: QueryParamsRetrieve<KlarnaPayment>, options?: ResourcesConfig): Promise<KlarnaPayment> {\n\t\treturn this.resources.update<KlarnaPaymentUpdate, KlarnaPayment>({ id: (typeof id === 'string')? id: id.id, type: KlarnaPayments.TYPE, _update: true }, params, options)\n\t}\n\n\n\tisKlarnaPayment(resource: any): resource is KlarnaPayment {\n\t\treturn resource.type && (resource.type === KlarnaPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): KlarnaPaymentRel {\n\t\treturn super.relationshipOneToOne<KlarnaPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): KlarnaPaymentRel[] {\n\t\treturn super.relationshipOneToMany<KlarnaPaymentRel>(...ids)\n\t}\n\n\n\ttype(): KlarnaPaymentType {\n\t\treturn KlarnaPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new KlarnaPayments()\nexport default instance\n\nexport type { KlarnaPayments, KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate, KlarnaPaymentType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/manual_tax_calculators.ts"],"names":[],"mappings":";;;AAiEA,IAAM,oBAAA,GAAN,MAAM,qBAAA,SAA6B,WAAiC,CAAA;AAAA,EAEnE,OAAgB,IAAgC,GAAA,wBAAA;AAAA,EAEhD,MAAM,MAAA,CAAO,QAAqC,EAAA,MAAA,EAAmD,OAAyD,EAAA;AAC7J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAuD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,qBAAqB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/I,EAEA,MAAM,MAAA,CAAO,QAAqC,EAAA,MAAA,EAAmD,OAAyD,EAAA;AAC7J,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAuD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,qBAAqB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/I,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA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AAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAA0B,uBAAA,EAAA,sBAAsB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxI,EAEA,MAAM,SAAA,CAAU,qBAAqD,EAAA,MAAA,EAAmC,OAA2D,EAAA;AAClK,IAAM,MAAA,sBAAA,GAA0B,sBAA8C,EAAM,IAAA,qBAAA;AACpF,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,WAAY,EAAA,EAAG,CAA0B,uBAAA,EAAA,sBAAsB,CAAc,UAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1I,EAGA,sBAAsB,QAAgD,EAAA;AACrE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,qBAAqB,CAAA,IAAA;AAAA;AACjE,EAGA,aAAa,EAAwD,EAAA;AACpE,IAAO,OAAA,KAAA,CAAM,qBAA6C,EAAE,CAAA;AAAA;AAC7D,EAEA,sBAAsB,GAAyC,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAA8C,CAAA,GAAG,GAAG,CAAA;AAAA;AAClE,EAGA,IAAgC,GAAA;AAC/B,IAAA,OAAO,qBAAqB,CAAA,IAAA;AAAA;AAG9B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,oBAAqB,EAAA;AAC1C,IAAO,8BAAQ,GAAA","file":"chunk-Q7YHSPJL.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { TaxRule, TaxRuleType } from './tax_rules'\n\n\ntype ManualTaxCalculatorType = 'manual_tax_calculators'\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\n\n\nexport type ManualTaxCalculatorSort = Pick<ManualTaxCalculator, 'id' | 'name'> & ResourceSort\n// export type ManualTaxCalculatorFilter = Pick<ManualTaxCalculator, 'id' | 'name'> & ResourceFilter\n\n\ninterface ManualTaxCalculator extends Resource {\n\t\n\treadonly type: ManualTaxCalculatorType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\ttax_rules?: TaxRule[] | null\n\n}\n\n\ninterface ManualTaxCalculatorCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\ttax_rules?: TaxRuleRel[] | null\n\n}\n\n\ninterface ManualTaxCalculatorUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname?: string | null\n\n\ttax_rules?: TaxRuleRel[] | null\n\n}\n\n\nclass ManualTaxCalculators extends ApiResource<ManualTaxCalculator> {\n\n\tstatic readonly TYPE: ManualTaxCalculatorType = 'manual_tax_calculators' as const\n\n\tasync create(resource: ManualTaxCalculatorCreate, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\treturn this.resources.create<ManualTaxCalculatorCreate, ManualTaxCalculator>({ ...resource, type: ManualTaxCalculators.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ManualTaxCalculatorUpdate, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\treturn this.resources.update<ManualTaxCalculatorUpdate, ManualTaxCalculator>({ ...resource, type: ManualTaxCalculators.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: ManualTaxCalculators.TYPE } : id, options)\n\t}\n\n\tasync markets(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `manual_tax_calculators/${_manualTaxCalculatorId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `manual_tax_calculators/${_manualTaxCalculatorId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `manual_tax_calculators/${_manualTaxCalculatorId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `manual_tax_calculators/${_manualTaxCalculatorId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync tax_rules(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<TaxRule>, options?: ResourcesConfig): Promise<ListResponse<TaxRule>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<TaxRule>({ type: 'tax_rules' }, `manual_tax_calculators/${_manualTaxCalculatorId}/tax_rules`, params, options) as unknown as ListResponse<TaxRule>\n\t}\n\n\n\tisManualTaxCalculator(resource: any): resource is ManualTaxCalculator {\n\t\treturn resource.type && (resource.type === ManualTaxCalculators.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ManualTaxCalculatorRel {\n\t\treturn super.relationshipOneToOne<ManualTaxCalculatorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ManualTaxCalculatorRel[] {\n\t\treturn super.relationshipOneToMany<ManualTaxCalculatorRel>(...ids)\n\t}\n\n\n\ttype(): ManualTaxCalculatorType {\n\t\treturn ManualTaxCalculators.TYPE\n\t}\n\n}\n\n\nconst instance = new ManualTaxCalculators()\nexport default instance\n\nexport type { ManualTaxCalculators, ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate, ManualTaxCalculatorType }\n"]}
1
+ {"version":3,"sources":["../src/resources/manual_tax_calculators.ts"],"names":[],"mappings":";;;AAiEA,IAAM,oBAAA,GAAN,MAAM,qBAAA,SAA6B,WAAA,CAAiC;AAAA,EAEnE,OAAgB,IAAA,GAAgC,wBAAA;AAAA,EAEhD,MAAM,MAAA,CAAO,QAAA,EAAqC,MAAA,EAAmD,OAAA,EAAyD;AAC7J,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAuD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,qBAAA,CAAqB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/I,EAEA,MAAM,MAAA,CAAO,QAAA,EAAqC,MAAA,EAAmD,OAAA,EAAyD;AAC7J,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, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { TaxRule, TaxRuleType } from './tax_rules'\n\n\ntype ManualTaxCalculatorType = 'manual_tax_calculators'\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\n\n\nexport type ManualTaxCalculatorSort = Pick<ManualTaxCalculator, 'id' | 'name'> & ResourceSort\n// export type ManualTaxCalculatorFilter = Pick<ManualTaxCalculator, 'id' | 'name'> & ResourceFilter\n\n\ninterface ManualTaxCalculator extends Resource {\n\t\n\treadonly type: ManualTaxCalculatorType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\ttax_rules?: TaxRule[] | null\n\n}\n\n\ninterface ManualTaxCalculatorCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\ttax_rules?: TaxRuleRel[] | null\n\n}\n\n\ninterface ManualTaxCalculatorUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname?: string | null\n\n\ttax_rules?: TaxRuleRel[] | null\n\n}\n\n\nclass ManualTaxCalculators extends ApiResource<ManualTaxCalculator> {\n\n\tstatic readonly TYPE: ManualTaxCalculatorType = 'manual_tax_calculators' as const\n\n\tasync create(resource: ManualTaxCalculatorCreate, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\treturn this.resources.create<ManualTaxCalculatorCreate, ManualTaxCalculator>({ ...resource, type: ManualTaxCalculators.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ManualTaxCalculatorUpdate, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\treturn this.resources.update<ManualTaxCalculatorUpdate, ManualTaxCalculator>({ ...resource, type: ManualTaxCalculators.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: ManualTaxCalculators.TYPE } : id, options)\n\t}\n\n\tasync markets(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `manual_tax_calculators/${_manualTaxCalculatorId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `manual_tax_calculators/${_manualTaxCalculatorId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `manual_tax_calculators/${_manualTaxCalculatorId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `manual_tax_calculators/${_manualTaxCalculatorId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync tax_rules(manualTaxCalculatorId: string | ManualTaxCalculator, params?: QueryParamsList<TaxRule>, options?: ResourcesConfig): Promise<ListResponse<TaxRule>> {\n\t\tconst _manualTaxCalculatorId = (manualTaxCalculatorId as ManualTaxCalculator).id || manualTaxCalculatorId as string\n\t\treturn this.resources.fetch<TaxRule>({ type: 'tax_rules' }, `manual_tax_calculators/${_manualTaxCalculatorId}/tax_rules`, params, options) as unknown as ListResponse<TaxRule>\n\t}\n\n\n\tisManualTaxCalculator(resource: any): resource is ManualTaxCalculator {\n\t\treturn resource.type && (resource.type === ManualTaxCalculators.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ManualTaxCalculatorRel {\n\t\treturn super.relationshipOneToOne<ManualTaxCalculatorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ManualTaxCalculatorRel[] {\n\t\treturn super.relationshipOneToMany<ManualTaxCalculatorRel>(...ids)\n\t}\n\n\n\ttype(): ManualTaxCalculatorType {\n\t\treturn ManualTaxCalculators.TYPE\n\t}\n\n}\n\n\nconst instance = new ManualTaxCalculators()\nexport default instance\n\nexport type { ManualTaxCalculators, ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate, ManualTaxCalculatorType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/braintree_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AA+GA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAA8B,CAAA;AAAA,EAE7D,OAAgB,IAA6B,GAAA,oBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAkC,EA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AAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACvJ,EAEA,MAAM,QAAA,CAAS,kBAA+C,EAAA,MAAA,EAAmC,OAA2D,EAAA;AAC3J,IAAM,MAAA,mBAAA,GAAuB,mBAAwC,EAAM,IAAA,kBAAA;AAC3E,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAsB,mBAAA,EAAA,mBAAmB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjI,EAGA,mBAAmB,QAA6C,EAAA;AAC/D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,kBAAkB,CAAA,IAAA;AAAA;AAC9D,EAGA,aAAa,EAAqD,EAAA;AACjE,IAAO,OAAA,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA;AAC1D,EAEA,sBAAsB,GAAsC,EAAA;AAC3D,IAAO,OAAA,KAAA,CAAM,qBAA2C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC/D,EAGA,IAA6B,GAAA;AAC5B,IAAA,OAAO,kBAAkB,CAAA,IAAA;AAAA;AAG3B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,iBAAkB,EAAA;AACvC,IAAO,0BAAQ,GAAA","file":"chunk-QGE4ELJO.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype BraintreePaymentType = 'braintree_payments'\ntype BraintreePaymentRel = ResourceRel & { type: BraintreePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type BraintreePaymentSort = Pick<BraintreePayment, 'id'> & ResourceSort\n// export type BraintreePaymentFilter = Pick<BraintreePayment, 'id'> & ResourceFilter\n\n\ninterface BraintreePayment extends Resource {\n\t\n\treadonly type: BraintreePaymentType\n\n\t/** \n\t * The Braintree payment client token. Required by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tclient_token: string\n\t/** \n\t * The Braintree payment method nonce. Sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_method_nonce?: string | null\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface BraintreePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\n\torder: OrderRel\n\n}\n\n\ninterface BraintreePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The Braintree payment method nonce. Sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_method_nonce?: string | null\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass BraintreePayments extends ApiResource<BraintreePayment> {\n\n\tstatic readonly TYPE: BraintreePaymentType = 'braintree_payments' as const\n\n\tasync create(resource: BraintreePaymentCreate, params?: QueryParamsRetrieve<BraintreePayment>, options?: ResourcesConfig): Promise<BraintreePayment> {\n\t\treturn this.resources.create<BraintreePaymentCreate, BraintreePayment>({ ...resource, type: BraintreePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: BraintreePaymentUpdate, params?: QueryParamsRetrieve<BraintreePayment>, options?: ResourcesConfig): Promise<BraintreePayment> {\n\t\treturn this.resources.update<BraintreePaymentUpdate, BraintreePayment>({ ...resource, type: BraintreePayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: BraintreePayments.TYPE } : id, options)\n\t}\n\n\tasync order(braintreePaymentId: string | BraintreePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `braintree_payments/${_braintreePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(braintreePaymentId: string | BraintreePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `braintree_payments/${_braintreePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(braintreePaymentId: string | BraintreePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `braintree_payments/${_braintreePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisBraintreePayment(resource: any): resource is BraintreePayment {\n\t\treturn resource.type && (resource.type === BraintreePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): BraintreePaymentRel {\n\t\treturn super.relationshipOneToOne<BraintreePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): BraintreePaymentRel[] {\n\t\treturn super.relationshipOneToMany<BraintreePaymentRel>(...ids)\n\t}\n\n\n\ttype(): BraintreePaymentType {\n\t\treturn BraintreePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new BraintreePayments()\nexport default instance\n\nexport type { BraintreePayments, BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate, BraintreePaymentType }\n"]}
1
+ {"version":3,"sources":["../src/resources/braintree_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AA+GA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,oBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,S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S,kBAAA,EAA+C,MAAA,EAAmC,OAAA,EAA2D;AAC3J,IAAA,MAAM,mBAAA,GAAuB,mBAAwC,EAAA,IAAM,kBAAA;AAC3E,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAe,EAAE,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,mBAAA,EAAsB,mBAAmB,CAAA,SAAA,CAAA,EAAa,MAAA,EAAQ,OAAO,CAAA;AAAA;AACjI,EAGA,mBAAmB,QAAA,EAA6C;AAC/D,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,kBAAA,CAAkB,IAAA;AAAA;AAC9D,EAGA,aAAa,EAAA,EAAqD;AACjE,IAAA,OAAO,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA;AAC1D,EAEA,sBAAsB,GAAA,EAAsC;AAC3D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA2C,GAAG,GAAG,CAAA;AAAA;AAC/D,EAGA,IAAA,GAA6B;AAC5B,IAAA,OAAO,kBAAA,CAAkB,IAAA;AAAA;AAG3B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,iBAAA,EAAkB;AACvC,IAAO,0BAAA,GAAQ","file":"chunk-QGE4ELJO.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype BraintreePaymentType = 'braintree_payments'\ntype BraintreePaymentRel = ResourceRel & { type: BraintreePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type BraintreePaymentSort = Pick<BraintreePayment, 'id'> & ResourceSort\n// export type BraintreePaymentFilter = Pick<BraintreePayment, 'id'> & ResourceFilter\n\n\ninterface BraintreePayment extends Resource {\n\t\n\treadonly type: BraintreePaymentType\n\n\t/** \n\t * The Braintree payment client token. Required by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tclient_token: string\n\t/** \n\t * The Braintree payment method nonce. Sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_method_nonce?: string | null\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface BraintreePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\n\torder: OrderRel\n\n}\n\n\ninterface BraintreePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The Braintree payment method nonce. Sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_method_nonce?: string | null\n\t/** \n\t * The Braintree payment ID used by local payment and sent by the Braintree JS SDK.\n\t * @example ```\"xxxx.yyyy.zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * Indicates if the payment is local, in such case Braintree will trigger a webhook call passing the \"payment_id\" and \"payment_method_nonce\" in order to complete the transaction.\n\t * @example ```true```\n\t */\n\tlocal?: boolean | null\n\t/** \n\t * Braintree payment options, 'customer_id' and 'payment_method_token'.\n\t * @example ```{\"customer_id\":\"1234567890\"}```\n\t */\n\toptions?: Record<string, any> | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass BraintreePayments extends ApiResource<BraintreePayment> {\n\n\tstatic readonly TYPE: BraintreePaymentType = 'braintree_payments' as const\n\n\tasync create(resource: BraintreePaymentCreate, params?: QueryParamsRetrieve<BraintreePayment>, options?: ResourcesConfig): Promise<BraintreePayment> {\n\t\treturn this.resources.create<BraintreePaymentCreate, BraintreePayment>({ ...resource, type: BraintreePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: BraintreePaymentUpdate, params?: QueryParamsRetrieve<BraintreePayment>, options?: ResourcesConfig): Promise<BraintreePayment> {\n\t\treturn this.resources.update<BraintreePaymentUpdate, BraintreePayment>({ ...resource, type: BraintreePayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: BraintreePayments.TYPE } : id, options)\n\t}\n\n\tasync order(braintreePaymentId: string | BraintreePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `braintree_payments/${_braintreePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(braintreePaymentId: string | BraintreePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `braintree_payments/${_braintreePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(braintreePaymentId: string | BraintreePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _braintreePaymentId = (braintreePaymentId as BraintreePayment).id || braintreePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `braintree_payments/${_braintreePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisBraintreePayment(resource: any): resource is BraintreePayment {\n\t\treturn resource.type && (resource.type === BraintreePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): BraintreePaymentRel {\n\t\treturn super.relationshipOneToOne<BraintreePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): BraintreePaymentRel[] {\n\t\treturn super.relationshipOneToMany<BraintreePaymentRel>(...ids)\n\t}\n\n\n\ttype(): BraintreePaymentType {\n\t\treturn BraintreePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new BraintreePayments()\nexport default instance\n\nexport type { BraintreePayments, BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate, BraintreePaymentType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/carrier_accounts.ts"],"names":[],"mappings":";;;AAgGA,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,WAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,kBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBA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AqB,iBAAoC,EAAM,IAAA,gBAAA;AACrE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAoB,iBAAA,EAAA,iBAAiB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAGA,iBAAiB,QAA2C,EAAA;AAC3D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,gBAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,gBAAgB,CAAA,IAAA;AAAA;AAGzB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,wBAAQ,GAAA","file":"chunk-QK5MFD4L.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype CarrierAccountType = 'carrier_accounts'\ntype CarrierAccountRel = ResourceRel & { type: CarrierAccountType }\ntype MarketRel = ResourceRel & { type: MarketType }\n\n\nexport type CarrierAccountSort = Pick<CarrierAccount, 'id' | 'name'> & ResourceSort\n// export type CarrierAccountFilter = Pick<CarrierAccount, 'id' | 'name' | 'easypost_type'> & ResourceFilter\n\n\ninterface CarrierAccount extends Resource {\n\t\n\treadonly type: CarrierAccountType\n\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname: string\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type: string\n\t/** \n\t * The Easypost internal reference ID.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\teasypost_id?: string | null\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials: Record<string, any>\n\n\tmarket?: Market | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface CarrierAccountCreate extends ResourceCreate {\n\t\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname: string\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type: string\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials: Record<string, any>\n\n\tmarket?: MarketRel | null\n\n}\n\n\ninterface CarrierAccountUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type?: string | null\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials?: Record<string, any> | null\n\n\tmarket?: MarketRel | null\n\n}\n\n\nclass CarrierAccounts extends ApiResource<CarrierAccount> {\n\n\tstatic readonly TYPE: CarrierAccountType = 'carrier_accounts' as const\n\n\tasync create(resource: CarrierAccountCreate, params?: QueryParamsRetrieve<CarrierAccount>, options?: ResourcesConfig): Promise<CarrierAccount> {\n\t\treturn this.resources.create<CarrierAccountCreate, CarrierAccount>({ ...resource, type: CarrierAccounts.TYPE }, params, options)\n\t}\n\n\tasync update(resource: CarrierAccountUpdate, params?: QueryParamsRetrieve<CarrierAccount>, options?: ResourcesConfig): Promise<CarrierAccount> {\n\t\treturn this.resources.update<CarrierAccountUpdate, CarrierAccount>({ ...resource, type: CarrierAccounts.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: CarrierAccounts.TYPE } : id, options)\n\t}\n\n\tasync market(carrierAccountId: string | CarrierAccount, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `carrier_accounts/${_carrierAccountId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync attachments(carrierAccountId: string | CarrierAccount, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `carrier_accounts/${_carrierAccountId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(carrierAccountId: string | CarrierAccount, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `carrier_accounts/${_carrierAccountId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisCarrierAccount(resource: any): resource is CarrierAccount {\n\t\treturn resource.type && (resource.type === CarrierAccounts.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): CarrierAccountRel {\n\t\treturn super.relationshipOneToOne<CarrierAccountRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): CarrierAccountRel[] {\n\t\treturn super.relationshipOneToMany<CarrierAccountRel>(...ids)\n\t}\n\n\n\ttype(): CarrierAccountType {\n\t\treturn CarrierAccounts.TYPE\n\t}\n\n}\n\n\nconst instance = new CarrierAccounts()\nexport default instance\n\nexport type { CarrierAccounts, CarrierAccount, CarrierAccountCreate, CarrierAccountUpdate, CarrierAccountType }\n"]}
1
+ {"version":3,"sources":["../src/resources/carrier_accounts.ts"],"names":[],"mappings":";;;AAgGA,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,WAAA,CAA4B;AAAA,EAEzD,OAAgB,IAAA,GAA2B,kBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAA,EAAgC,MAAA,EAA8C,OAAA,EAAoD;AAC9I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAA,EAAgC,MAAA,EAA8C,OAAA,EAAoD;AAC9I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AACvG,EAEA,MAAM,MAAA,CAAO,gBAAA,EAA2C,MAAA,EAAsC,OAAA,EAA4C;AACzI,IAAA,MAAM,iBAAA,GAAqB,iBAAoC,EAAA,IAAM,gBAAA;AACrE,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAc,EAAE,IAAA,EAAM,SAAA,EAAU,E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port type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype CarrierAccountType = 'carrier_accounts'\ntype CarrierAccountRel = ResourceRel & { type: CarrierAccountType }\ntype MarketRel = ResourceRel & { type: MarketType }\n\n\nexport type CarrierAccountSort = Pick<CarrierAccount, 'id' | 'name'> & ResourceSort\n// export type CarrierAccountFilter = Pick<CarrierAccount, 'id' | 'name' | 'easypost_type'> & ResourceFilter\n\n\ninterface CarrierAccount extends Resource {\n\t\n\treadonly type: CarrierAccountType\n\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname: string\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type: string\n\t/** \n\t * The Easypost internal reference ID.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\teasypost_id?: string | null\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials: Record<string, any>\n\n\tmarket?: Market | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface CarrierAccountCreate extends ResourceCreate {\n\t\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname: string\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type: string\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials: Record<string, any>\n\n\tmarket?: MarketRel | null\n\n}\n\n\ninterface CarrierAccountUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The carrier account internal name.\n\t * @example ```\"Accurate\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The Easypost service carrier type.\n\t * @example ```\"AccurateAccount\"```\n\t */\n\teasypost_type?: string | null\n\t/** \n\t * The Easypost carrier accounts credentials fields.\n\t * @example ```{\"username\":\"xxxx\",\"password\":\"secret\"}```\n\t */\n\tcredentials?: Record<string, any> | null\n\n\tmarket?: MarketRel | null\n\n}\n\n\nclass CarrierAccounts extends ApiResource<CarrierAccount> {\n\n\tstatic readonly TYPE: CarrierAccountType = 'carrier_accounts' as const\n\n\tasync create(resource: CarrierAccountCreate, params?: QueryParamsRetrieve<CarrierAccount>, options?: ResourcesConfig): Promise<CarrierAccount> {\n\t\treturn this.resources.create<CarrierAccountCreate, CarrierAccount>({ ...resource, type: CarrierAccounts.TYPE }, params, options)\n\t}\n\n\tasync update(resource: CarrierAccountUpdate, params?: QueryParamsRetrieve<CarrierAccount>, options?: ResourcesConfig): Promise<CarrierAccount> {\n\t\treturn this.resources.update<CarrierAccountUpdate, CarrierAccount>({ ...resource, type: CarrierAccounts.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: CarrierAccounts.TYPE } : id, options)\n\t}\n\n\tasync market(carrierAccountId: string | CarrierAccount, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `carrier_accounts/${_carrierAccountId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync attachments(carrierAccountId: string | CarrierAccount, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `carrier_accounts/${_carrierAccountId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(carrierAccountId: string | CarrierAccount, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _carrierAccountId = (carrierAccountId as CarrierAccount).id || carrierAccountId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `carrier_accounts/${_carrierAccountId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisCarrierAccount(resource: any): resource is CarrierAccount {\n\t\treturn resource.type && (resource.type === CarrierAccounts.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): CarrierAccountRel {\n\t\treturn super.relationshipOneToOne<CarrierAccountRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): CarrierAccountRel[] {\n\t\treturn super.relationshipOneToMany<CarrierAccountRel>(...ids)\n\t}\n\n\n\ttype(): CarrierAccountType {\n\t\treturn CarrierAccounts.TYPE\n\t}\n\n}\n\n\nconst instance = new CarrierAccounts()\nexport default instance\n\nexport type { CarrierAccounts, CarrierAccount, CarrierAccountCreate, CarrierAccountUpdate, CarrierAccountType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/stripe_payments.ts"],"names":[],"mappings":";;;AA2JA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eA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,CAAQ,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AACzI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAe,CAAA,IAAA,EAAM,SAAS,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAEA,MAAM,QAAA,CAAS,EAA4B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC1I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,eAAe,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACzK,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,eAAe,CAAA,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"chunk-QK7D6L3W.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype StripePaymentType = 'stripe_payments'\ntype StripePaymentRel = ResourceRel & { type: StripePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type StripePaymentSort = Pick<StripePayment, 'id'> & ResourceSort\n// export type StripePaymentFilter = Pick<StripePayment, 'id'> & ResourceFilter\n\n\ninterface StripePayment extends Resource {\n\t\n\treadonly type: StripePaymentType\n\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * The Stripe charge ID. Identifies money movement upon the payment intent confirmation.\n\t * @example ```\"ch_1234XXX\"```\n\t */\n\tcharge_id?: string | null\n\t/** \n\t * The Stripe publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The Stripe account ID that these funds are intended for.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ton_behalf_of?: string | null\n\t/** \n\t * A string that identifies the resulting payment as part of a group.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttransfer_group?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Stripe 'payment_method', set by webhook.\n\t * @example ```{\"id\":\"pm_xxx\"}```\n\t */\n\tpayment_method?: Record<string, any> | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StripePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface StripePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * Send this attribute if you want to update the created payment intent with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\t/** \n\t * Send this attribute if you want to refresh the payment status, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass StripePayments extends ApiResource<StripePayment> {\n\n\tstatic readonly TYPE: StripePaymentType = 'stripe_payments' as const\n\n\tasync create(resource: StripePaymentCreate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.create<StripePaymentCreate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: StripePayments.TYPE } : id, options)\n\t}\n\n\tasync order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(stripePaymentId: string | StripePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _update: true }, params, options)\n\t}\n\n\tasync _refresh(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisStripePayment(resource: any): resource is StripePayment {\n\t\treturn resource.type && (resource.type === StripePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripePaymentRel {\n\t\treturn super.relationshipOneToOne<StripePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripePaymentRel[] {\n\t\treturn super.relationshipOneToMany<StripePaymentRel>(...ids)\n\t}\n\n\n\ttype(): StripePaymentType {\n\t\treturn StripePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new StripePayments()\nexport default instance\n\nexport type { StripePayments, StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType }\n"]}
1
+ {"version":3,"sources":["../src/resources/stripe_payments.ts"],"names":[],"mappings":";;;AA2JA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,EA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{ ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype StripePaymentType = 'stripe_payments'\ntype StripePaymentRel = ResourceRel & { type: StripePaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type StripePaymentSort = Pick<StripePayment, 'id'> & ResourceSort\n// export type StripePaymentFilter = Pick<StripePayment, 'id'> & ResourceFilter\n\n\ninterface StripePayment extends Resource {\n\t\n\treadonly type: StripePaymentType\n\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * The account (if any) for which the funds of the PaymentIntent are intended.\n\t * @example ```\"acct_xxxx-yyyy-zzzz\"```\n\t */\n\tconnected_account?: string | null\n\t/** \n\t * The Stripe charge ID. Identifies money movement upon the payment intent confirmation.\n\t * @example ```\"ch_1234XXX\"```\n\t */\n\tcharge_id?: string | null\n\t/** \n\t * The Stripe publishable API key.\n\t * @example ```\"pk_live_xxxx-yyyy-zzzz\"```\n\t */\n\tpublishable_key?: string | null\n\t/** \n\t * The Stripe account ID that these funds are intended for.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ton_behalf_of?: string | null\n\t/** \n\t * A string that identifies the resulting payment as part of a group.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\ttransfer_group?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * Stripe 'payment_method', set by webhook.\n\t * @example ```{\"id\":\"pm_xxx\"}```\n\t */\n\tpayment_method?: Record<string, any> | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StripePaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Stripe payment intent ID. Required to identify a payment session on stripe.\n\t * @example ```\"pi_1234XXX\"```\n\t */\n\tstripe_id?: string | null\n\t/** \n\t * The Stripe payment intent client secret. Required to create a charge through Stripe.js.\n\t * @example ```\"pi_1234XXX_secret_5678YYY\"```\n\t */\n\tclient_secret?: string | null\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * The email address to send the receipt to.\n\t * @example ```\"john@example.com\"```\n\t */\n\treceipt_email?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface StripePaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Stripe payment options: 'customer', 'payment_method', 'return_url', etc. Check Stripe payment intent API for more details.\n\t * @example ```{\"customer\":\"cus_xxx\",\"payment_method\":\"pm_xxx\"}```\n\t */\n\toptions?: Record<string, any> | null\n\t/** \n\t * The URL to return to when a redirect payment is completed.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url?: string | null\n\t/** \n\t * Send this attribute if you want to update the created payment intent with fresh order data.\n\t * @example ```true```\n\t */\n\t_update?: boolean | null\n\t/** \n\t * Send this attribute if you want to refresh the payment status, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass StripePayments extends ApiResource<StripePayment> {\n\n\tstatic readonly TYPE: StripePaymentType = 'stripe_payments' as const\n\n\tasync create(resource: StripePaymentCreate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.create<StripePaymentCreate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ ...resource, type: StripePayments.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: StripePayments.TYPE } : id, options)\n\t}\n\n\tasync order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(stripePaymentId: string | StripePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripePaymentId = (stripePaymentId as StripePayment).id || stripePaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _update(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _update: true }, params, options)\n\t}\n\n\tasync _refresh(id: string | StripePayment, params?: QueryParamsRetrieve<StripePayment>, options?: ResourcesConfig): Promise<StripePayment> {\n\t\treturn this.resources.update<StripePaymentUpdate, StripePayment>({ id: (typeof id === 'string')? id: id.id, type: StripePayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisStripePayment(resource: any): resource is StripePayment {\n\t\treturn resource.type && (resource.type === StripePayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripePaymentRel {\n\t\treturn super.relationshipOneToOne<StripePaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripePaymentRel[] {\n\t\treturn super.relationshipOneToMany<StripePaymentRel>(...ids)\n\t}\n\n\n\ttype(): StripePaymentType {\n\t\treturn StripePayments.TYPE\n\t}\n\n}\n\n\nconst instance = new StripePayments()\nexport default instance\n\nexport type { StripePayments, StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resource.ts","../src/jsonapi.ts"],"names":["debug_default","SdkError","client_default","generateQueryStringParams","config_default","isParamsList","resourceList","debug","inc"],"mappings":";;;;;;;;;;AAYA,I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AAA,MAAM,UAA4B,GAAA;AAAA,IACjC,MAAM,QAAS,CAAA,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAa,CAAA,QAAQ,CAAG,EAAA,UAAA,CAAW,KAAK,QAAS,CAAA,EAAA;AAErD,EAAAA,MAAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAO,OAAA,UAAA;AAER","file":"chunk-QYDOENWU.cjs","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\nimport type { ObjectType } from './types'\n\n\nimport Debug from './debug'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\tApiResourceAdapter.adapter = new ResourceAdapter(config)\n\t\tdebug('resource adapter initialized')\n\t\treturn ApiResourceAdapter.get()\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\tObject.assign(this.#config, config)\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t#resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\tif (adapter) this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn this.#resources || ApiResourceAdapter.get()\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton, type ResourceAdapter }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n","\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
1
+ {"version":3,"sources":["../src/resource.ts","../src/jsonapi.ts"],"names":["debug_default","SdkError","client_default","generateQueryStringParams","config_default","isParamsList","resourceList","debug","inc"],"mappings":";;;;;;;;;;AAYA,IAAM,KAAA,GAAQA,gCAAM,UAAU,CAAA;AAoD9B,IAAM,YAAA,GAAN,cAA0D,KAAA,CAAS;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAA,EAAW;AACtC,IAAA,KAAA,CAAM,GAAI,IAAA,IAAQ,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA;AACb,EAEA,KAAA,GAAuB;AAAE,IAAA,OAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,CAAC,CAAA,GAAI,MAAA;AAAA;AAAU,EAClE,IAAA,GAAsB;AAAE,IAAA,OAAO,KAAK,MAAA,GAAS,IAAA,CAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAA,GAAI,MAAA;AAAA;AAAU,EAC/E,I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D,CAAA;AACvE,IAAA,IAAI,MAAM,OAAA,CAAQ,KAAK,CAAA,IAAM,KAAA,CAAM,WAAW,CAAA,IAAM,cAAA,CAAe,KAAA,CAAM,CAAC,CAAC,CAAA,IAAO,KAAA,CAAM,CAAC,CAAA,CAAkB,OAAO,IAAA,EAAO;AACxH,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,eAG/B,KAAA,IAAS,cAAA,CAAe,KAAK,CAAA,IAAO,KAAA,CAAsB,OAAO,IAAA,EAAO;AAC3E,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,KACrC,MAAA,IAEI,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAM,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,IAAK,YAAA,CAAa,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA,EAAK;AACvF,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAA,EAAkC;AAAA,KAClE,MACK,UAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AAAA;AAG1B,EAAA,MAAM,UAAA,GAA4B;AAAA,IACjC,MAAM,QAAA,CAAS,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAA,CAAa,QAAQ,CAAA,EAAG,UAAA,CAAW,KAAK,QAAA,CAAS,EAAA;AAErD,EAAAA,MAAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAA,OAAO,UAAA;AAER","file":"chunk-QYDOENWU.cjs","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\nimport type { ObjectType } from './types'\n\n\nimport Debug from './debug'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\tApiResourceAdapter.adapter = new ResourceAdapter(config)\n\t\tdebug('resource adapter initialized')\n\t\treturn ApiResourceAdapter.get()\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\tObject.assign(this.#config, config)\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t#resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\tif (adapter) this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn this.#resources || ApiResourceAdapter.get()\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton, type ResourceAdapter }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n","\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/packages.ts"],"names":["ApiResource"],"mappings":";;;;;AA0IA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAqB,CAAA;AAAA,EAE3C,OAAgB,IAAoB,GAAA,UAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,SAAA,CAAS,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAChG,EAEA,MAAM,cAAA,CAAe,SAA6B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AACjJ,IAAM,MAAA,UAAA,GAAc,UAAsB,EAAM,IAAA,SAAA;AAChD,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAkB,EAAA,EAAG,CAAY,SAAA,EAAA,UAAU,CAAmB,eAAA,CAAA,EAAA,MAAA,EAAQ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GA,IAAoB,GAAA;AACnB,IAAA,OAAO,SAAS,CAAA,IAAA;AAAA;AAGlB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,QAAS,EAAA;AAC9B,IAAO,gBAAQ,GAAA","file":"chunk-QZTNLPOD.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Parcel } from './parcels'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype PackageType = 'packages'\ntype PackageRel = ResourceRel & { type: PackageType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type PackageSort = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceSort\n// export type PackageFilter = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceFilter\n\n\ninterface Package extends Resource {\n\t\n\treadonly type: PackageType\n\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location?: StockLocation | null\n\tparcels?: Parcel[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface PackageCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location: StockLocationRel\n\n}\n\n\ninterface PackageUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength?: number | null\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth?: number | null\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight?: number | null\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length?: string | null\n\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Packages extends ApiResource<Package> {\n\n\tstatic readonly TYPE: PackageType = 'packages' as const\n\n\tasync create(resource: PackageCreate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.create<PackageCreate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PackageUpdate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.update<PackageUpdate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Packages.TYPE } : id, options)\n\t}\n\n\tasync stock_location(packageId: string | Package, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync parcels(packageId: string | Package, params?: QueryParamsList<Parcel>, options?: ResourcesConfig): Promise<ListResponse<Parcel>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options) as unknown as ListResponse<Parcel>\n\t}\n\n\tasync attachments(packageId: string | Package, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(packageId: string | Package, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `packages/${_packageId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPackage(resource: any): resource is Package {\n\t\treturn resource.type && (resource.type === Packages.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PackageRel {\n\t\treturn super.relationshipOneToOne<PackageRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PackageRel[] {\n\t\treturn super.relationshipOneToMany<PackageRel>(...ids)\n\t}\n\n\n\ttype(): PackageType {\n\t\treturn Packages.TYPE\n\t}\n\n}\n\n\nconst instance = new Packages()\nexport default instance\n\nexport type { Packages, Package, PackageCreate, PackageUpdate, PackageType }\n"]}
1
+ {"version":3,"sources":["../src/resources/packages.ts"],"names":["ApiResource"],"mappings":";;;;;AA0IA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAA,CAAqB;AAAA,EAE3C,OAAgB,IAAA,GAAoB,UAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AAChG,EAEA,MAAM,cAAA,CAAe,SAAA,EAA6B,MAAA,EAA6C,OAAA,EAAmD;AACjJ,IAAA,MAAM,UAAA,GAAc,UAAsB,EAAA,IAAM,SAAA;AAChD,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAqB,EAAE,IAAA,EAAM,iBAAA,EAAkB,EAAG,CAAA,SAAA,EAAY,UAAU,CA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C,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAA,GAAoB;AACnB,IAAA,OAAO,SAAA,CAAS,IAAA;AAAA;AAGlB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,QAAA,EAAS;AAC9B,IAAO,gBAAA,GAAQ","file":"chunk-QZTNLPOD.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Parcel } from './parcels'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype PackageType = 'packages'\ntype PackageRel = ResourceRel & { type: PackageType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\n\n\nexport type PackageSort = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceSort\n// export type PackageFilter = Pick<Package, 'id' | 'name' | 'code' | 'length' | 'width' | 'height' | 'unit_of_length'> & ResourceFilter\n\n\ninterface Package extends Resource {\n\t\n\treadonly type: PackageType\n\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location?: StockLocation | null\n\tparcels?: Parcel[] | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface PackageCreate extends ResourceCreate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname: string\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength: number\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth: number\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight: number\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length: string\n\n\tstock_location: StockLocationRel\n\n}\n\n\ninterface PackageUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Unique name for the package.\n\t * @example ```\"Large (60x40x30)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The package identifying code.\n\t * @example ```\"YYYY 2000\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The package length, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\tlength?: number | null\n\t/** \n\t * The package width, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```40```\n\t */\n\twidth?: number | null\n\t/** \n\t * The package height, used to automatically calculate the tax rates from the available carrier accounts.\n\t * @example ```25```\n\t */\n\theight?: number | null\n\t/** \n\t * The unit of length. Can be one of 'cm', or 'in'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_length?: string | null\n\n\tstock_location?: StockLocationRel | null\n\n}\n\n\nclass Packages extends ApiResource<Package> {\n\n\tstatic readonly TYPE: PackageType = 'packages' as const\n\n\tasync create(resource: PackageCreate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.create<PackageCreate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PackageUpdate, params?: QueryParamsRetrieve<Package>, options?: ResourcesConfig): Promise<Package> {\n\t\treturn this.resources.update<PackageUpdate, Package>({ ...resource, type: Packages.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Packages.TYPE } : id, options)\n\t}\n\n\tasync stock_location(packageId: string | Package, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync parcels(packageId: string | Package, params?: QueryParamsList<Parcel>, options?: ResourcesConfig): Promise<ListResponse<Parcel>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options) as unknown as ListResponse<Parcel>\n\t}\n\n\tasync attachments(packageId: string | Package, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(packageId: string | Package, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _packageId = (packageId as Package).id || packageId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `packages/${_packageId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPackage(resource: any): resource is Package {\n\t\treturn resource.type && (resource.type === Packages.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PackageRel {\n\t\treturn super.relationshipOneToOne<PackageRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PackageRel[] {\n\t\treturn super.relationshipOneToMany<PackageRel>(...ids)\n\t}\n\n\n\ttype(): PackageType {\n\t\treturn Packages.TYPE\n\t}\n\n}\n\n\nconst instance = new Packages()\nexport default instance\n\nexport type { Packages, Package, PackageCreate, PackageUpdate, PackageType }\n"]}