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

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 (641) hide show
  1. package/lib/{api-BIiVfx1G.d.ts → api-C7ddKOtt.d.ts} +59 -1
  2. package/lib/{api-xIgvzFhW.d.cts → api-DuTbl3z_.d.cts} +59 -1
  3. package/lib/api.cjs +20 -20
  4. package/lib/api.d.cts +1 -1
  5. package/lib/api.d.ts +1 -1
  6. package/lib/api.js +10 -10
  7. package/lib/bundle.cjs +22 -22
  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 +11 -11
  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-WXE5KXJC.cjs → chunk-2VPJZZIF.cjs} +3 -3
  24. package/lib/chunk-2VPJZZIF.cjs.map +1 -0
  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-4NI5SICY.cjs.map +1 -1
  50. package/lib/chunk-4SCFKFIM.cjs.map +1 -1
  51. package/lib/chunk-57XXD3GQ.cjs.map +1 -1
  52. package/lib/chunk-5EXCGVF2.cjs.map +1 -1
  53. package/lib/chunk-5FZNBGAF.cjs.map +1 -1
  54. package/lib/chunk-5NMDIVXH.js.map +1 -1
  55. package/lib/chunk-5OQQBNVB.js.map +1 -1
  56. package/lib/chunk-5P5Z7NXC.js.map +1 -1
  57. package/lib/chunk-5R76TU4I.cjs.map +1 -1
  58. package/lib/chunk-627I2FYX.cjs.map +1 -1
  59. package/lib/chunk-66JDSPFD.cjs.map +1 -1
  60. package/lib/{chunk-AVJX4OEZ.js → chunk-67KNILG6.js} +3 -3
  61. package/lib/chunk-67KNILG6.js.map +1 -0
  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-6SCAIB4K.cjs.map +1 -1
  67. package/lib/chunk-6SOWFGBP.cjs.map +1 -1
  68. package/lib/{chunk-EQD223JW.cjs → chunk-73PUROZG.cjs} +2 -2
  69. package/lib/chunk-73PUROZG.cjs.map +1 -0
  70. package/lib/chunk-7CQTUOR4.cjs.map +1 -1
  71. package/lib/chunk-7JLRB7QH.js.map +1 -1
  72. package/lib/{chunk-ANCLAYJV.cjs → chunk-7KY7C5RC.cjs} +2 -2
  73. package/lib/chunk-7KY7C5RC.cjs.map +1 -0
  74. package/lib/chunk-7SG4WU7W.js.map +1 -1
  75. package/lib/chunk-7SZY5BWE.js.map +1 -1
  76. package/lib/chunk-7VSYXEXL.js.map +1 -1
  77. package/lib/chunk-7Z2U4MHU.cjs.map +1 -1
  78. package/lib/chunk-A6BT5FSV.cjs.map +1 -1
  79. package/lib/chunk-A7BEMDVP.cjs.map +1 -1
  80. package/lib/chunk-AD73LDFJ.cjs.map +1 -1
  81. package/lib/chunk-AGNIOGQC.cjs.map +1 -1
  82. package/lib/chunk-AIGQRBCY.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-AW3TRBZ7.js.map +1 -1
  86. package/lib/{chunk-2UUZHL2R.js → chunk-AWP3PHRS.js} +2 -2
  87. package/lib/chunk-AWP3PHRS.js.map +1 -0
  88. package/lib/chunk-B72FREUL.cjs.map +1 -1
  89. package/lib/chunk-BJYOKKGX.cjs.map +1 -1
  90. package/lib/chunk-BN6XJAZH.cjs.map +1 -1
  91. package/lib/chunk-BTAKU6V5.cjs.map +1 -1
  92. package/lib/chunk-CG2ACHGS.js.map +1 -1
  93. package/lib/chunk-CHYP5F26.js.map +1 -1
  94. package/lib/chunk-CK6RZLVM.cjs.map +1 -1
  95. package/lib/chunk-CNCZCBI3.js.map +1 -1
  96. package/lib/chunk-CRRYP7ZN.js.map +1 -1
  97. package/lib/chunk-CTXBUDGO.cjs.map +1 -1
  98. package/lib/chunk-CUNOMS5N.js.map +1 -1
  99. package/lib/chunk-D26KDUDM.cjs.map +1 -1
  100. package/lib/chunk-D5E4OGXU.js.map +1 -1
  101. package/lib/chunk-D7KNSKNJ.js.map +1 -1
  102. package/lib/chunk-DAXKXBA3.js.map +1 -1
  103. package/lib/chunk-DGW3ZSW6.js.map +1 -1
  104. package/lib/chunk-DJ572MZB.cjs.map +1 -1
  105. package/lib/chunk-DOFPDQMJ.cjs.map +1 -1
  106. package/lib/chunk-DOGEZ6XX.cjs.map +1 -1
  107. package/lib/chunk-DSKZRVXS.js.map +1 -1
  108. package/lib/chunk-DYZGWPZ6.js.map +1 -1
  109. package/lib/{chunk-7ISS2FDY.js → chunk-DZLNYX4L.js} +2 -2
  110. package/lib/chunk-DZLNYX4L.js.map +1 -0
  111. package/lib/chunk-E3FDHGI7.js.map +1 -1
  112. package/lib/chunk-E4DYW6HB.cjs.map +1 -1
  113. package/lib/chunk-E65GENXB.js.map +1 -1
  114. package/lib/chunk-E6TBQVLK.cjs.map +1 -1
  115. package/lib/chunk-EADFDBOR.cjs.map +1 -1
  116. package/lib/chunk-ECMCBU3N.js.map +1 -1
  117. package/lib/chunk-EEFOL62K.js.map +1 -1
  118. package/lib/chunk-ELBOXOTA.js.map +1 -1
  119. package/lib/chunk-EP22KKHR.js.map +1 -1
  120. package/lib/chunk-EP7MAEQH.cjs.map +1 -1
  121. package/lib/chunk-ESMKOP42.cjs.map +1 -1
  122. package/lib/chunk-F6MSHDB7.cjs.map +1 -1
  123. package/lib/chunk-FAU5EILL.js.map +1 -1
  124. package/lib/chunk-FO7WBEPF.js.map +1 -1
  125. package/lib/{chunk-HAAE23MQ.js → chunk-FRZBCW3D.js} +2 -2
  126. package/lib/chunk-FRZBCW3D.js.map +1 -0
  127. package/lib/chunk-FSFXOZ35.cjs.map +1 -1
  128. package/lib/chunk-FTAZDUH6.js.map +1 -1
  129. package/lib/chunk-FVJDRHG7.js.map +1 -1
  130. package/lib/{chunk-HSILJQCD.js → chunk-FWFGGAKV.js} +2 -2
  131. package/lib/chunk-FWFGGAKV.js.map +1 -0
  132. package/lib/chunk-FXE62CPP.cjs.map +1 -1
  133. package/lib/chunk-FYKIHWAM.cjs.map +1 -1
  134. package/lib/chunk-G74OZ4M6.js.map +1 -1
  135. package/lib/chunk-GE6OHQR6.cjs.map +1 -1
  136. package/lib/chunk-GHLCA7BX.js.map +1 -1
  137. package/lib/chunk-GLSPCG3M.cjs.map +1 -1
  138. package/lib/chunk-H2USYPU6.js.map +1 -1
  139. package/lib/chunk-H4PUXGNI.cjs.map +1 -1
  140. package/lib/chunk-H4SVEI6E.js.map +1 -1
  141. package/lib/chunk-HBUDZOK7.cjs.map +1 -1
  142. package/lib/chunk-HCBXRHD7.js.map +1 -1
  143. package/lib/chunk-HDYENVKD.js.map +1 -1
  144. package/lib/chunk-HERQULAV.cjs.map +1 -1
  145. package/lib/chunk-HNHF6T2I.cjs.map +1 -1
  146. package/lib/chunk-HNONYIDO.cjs.map +1 -1
  147. package/lib/chunk-HQ5STEMD.js.map +1 -1
  148. package/lib/chunk-HQ6TJSB7.cjs.map +1 -1
  149. package/lib/chunk-I3SKGXTB.cjs.map +1 -1
  150. package/lib/{chunk-BBEMCANC.cjs → chunk-I5KTGLTE.cjs} +2 -2
  151. package/lib/chunk-I5KTGLTE.cjs.map +1 -0
  152. package/lib/chunk-IITNQS6D.js.map +1 -1
  153. package/lib/chunk-IKENWSRH.cjs.map +1 -1
  154. package/lib/chunk-IKHD5UQP.cjs.map +1 -1
  155. package/lib/chunk-INJ7FRDA.cjs.map +1 -1
  156. package/lib/chunk-J4CTOHX6.cjs.map +1 -1
  157. package/lib/chunk-J6NBJHWL.cjs.map +1 -1
  158. package/lib/chunk-J6PTNG3D.js.map +1 -1
  159. package/lib/{chunk-ROPOLXIV.js → chunk-J6Z6ZR33.js} +2 -2
  160. package/lib/chunk-J6Z6ZR33.js.map +1 -0
  161. package/lib/chunk-J7ZSBB35.js.map +1 -1
  162. package/lib/chunk-JAQECLCE.js.map +1 -1
  163. package/lib/chunk-JECYKPCC.cjs.map +1 -1
  164. package/lib/chunk-JPUF5YXX.js.map +1 -1
  165. package/lib/chunk-JRTJ6LWK.js.map +1 -1
  166. package/lib/chunk-JT7HVLLW.cjs.map +1 -1
  167. package/lib/chunk-JWC2GSYH.cjs.map +1 -1
  168. package/lib/chunk-JYOFP6BM.js.map +1 -1
  169. package/lib/chunk-JYXAF775.js.map +1 -1
  170. package/lib/chunk-K2CU5HIV.js.map +1 -1
  171. package/lib/chunk-K6WSCQKS.cjs.map +1 -1
  172. package/lib/chunk-KH5OQRQL.js.map +1 -1
  173. package/lib/chunk-KITKWF6F.js.map +1 -1
  174. package/lib/chunk-KPRWSW6P.cjs.map +1 -1
  175. package/lib/chunk-KU5U6DTU.js.map +1 -1
  176. package/lib/chunk-KWRDUU7K.js.map +1 -1
  177. package/lib/{chunk-DTGODPCN.js → chunk-KYZ4CKIR.js} +2 -2
  178. package/lib/chunk-KYZ4CKIR.js.map +1 -0
  179. package/lib/{chunk-EHWAGYNX.js → chunk-KZ75CT2Q.js} +2 -2
  180. package/lib/chunk-KZ75CT2Q.js.map +1 -0
  181. package/lib/chunk-L4LPS3DV.cjs.map +1 -1
  182. package/lib/chunk-L4TDKOAC.js.map +1 -1
  183. package/lib/{chunk-INZD34YD.cjs → chunk-L5FMOT44.cjs} +2 -2
  184. package/lib/chunk-L5FMOT44.cjs.map +1 -0
  185. package/lib/chunk-L5NEDGXK.js.map +1 -1
  186. package/lib/chunk-L6IGO47T.js.map +1 -1
  187. package/lib/chunk-LCNT6GY3.js.map +1 -1
  188. package/lib/chunk-LIT4FEIU.cjs.map +1 -1
  189. package/lib/chunk-LJ2EP6AL.cjs.map +1 -1
  190. package/lib/{chunk-WBPEFNL7.cjs → chunk-LJFBPFPR.cjs} +2 -2
  191. package/lib/chunk-LJFBPFPR.cjs.map +1 -0
  192. package/lib/chunk-LNMY5BDT.js.map +1 -1
  193. package/lib/chunk-LTLMRGB7.js.map +1 -1
  194. package/lib/chunk-MADGMICB.js.map +1 -1
  195. package/lib/chunk-MCGX2ZDC.cjs.map +1 -1
  196. package/lib/chunk-MJRMRWP3.js.map +1 -1
  197. package/lib/chunk-MQZSDICO.cjs.map +1 -1
  198. package/lib/chunk-MUPRLXGP.js.map +1 -1
  199. package/lib/chunk-MWYBER5I.cjs.map +1 -1
  200. package/lib/chunk-MZNHRIXE.js.map +1 -1
  201. package/lib/chunk-N4P7A3RY.js.map +1 -1
  202. package/lib/chunk-NAWKHFBZ.js.map +1 -1
  203. package/lib/chunk-NBYV35R4.cjs.map +1 -1
  204. package/lib/chunk-NDPDO54G.js.map +1 -1
  205. package/lib/chunk-NEC22ZSI.cjs.map +1 -1
  206. package/lib/chunk-NIHOABAW.cjs.map +1 -1
  207. package/lib/chunk-NJYMO7FP.cjs.map +1 -1
  208. package/lib/chunk-NODKE6P4.js.map +1 -1
  209. package/lib/{chunk-6PWK52UZ.cjs → chunk-NYS7N44P.cjs} +2 -2
  210. package/lib/chunk-NYS7N44P.cjs.map +1 -0
  211. package/lib/chunk-OGLS27LJ.js.map +1 -1
  212. package/lib/chunk-OYFNK2SE.cjs.map +1 -1
  213. package/lib/chunk-PEU5GGGE.js.map +1 -1
  214. package/lib/{chunk-M2ZERG2X.cjs → chunk-PGZTQAOR.cjs} +2 -2
  215. package/lib/chunk-PGZTQAOR.cjs.map +1 -0
  216. package/lib/chunk-PNSVP3KP.cjs.map +1 -1
  217. package/lib/chunk-PQS6KXZ2.cjs.map +1 -1
  218. package/lib/chunk-PV7MUP5Z.js.map +1 -1
  219. package/lib/chunk-PZZLLHJP.js.map +1 -1
  220. package/lib/chunk-Q2ZSQM7I.js.map +1 -1
  221. package/lib/chunk-Q66HILUF.js.map +1 -1
  222. package/lib/chunk-Q66JEOCJ.cjs.map +1 -1
  223. package/lib/chunk-Q7YHSPJL.js.map +1 -1
  224. package/lib/chunk-QGE4ELJO.cjs.map +1 -1
  225. package/lib/chunk-QK5MFD4L.js.map +1 -1
  226. package/lib/chunk-QK7D6L3W.js.map +1 -1
  227. package/lib/chunk-QYDOENWU.cjs.map +1 -1
  228. package/lib/chunk-QZTNLPOD.cjs.map +1 -1
  229. package/lib/chunk-QZWQNPKC.js.map +1 -1
  230. package/lib/chunk-R2LRLUUY.js.map +1 -1
  231. package/lib/chunk-R755X3AG.cjs.map +1 -1
  232. package/lib/chunk-RHARO4TQ.cjs.map +1 -1
  233. package/lib/chunk-RL7Y22OT.js.map +1 -1
  234. package/lib/chunk-RT7XLEV6.js.map +1 -1
  235. package/lib/chunk-RTDD2NRL.cjs.map +1 -1
  236. package/lib/chunk-RTGW34KX.cjs.map +1 -1
  237. package/lib/{chunk-WVAW33XQ.js → chunk-S4GBVQLI.js} +3 -3
  238. package/lib/chunk-S4GBVQLI.js.map +1 -0
  239. package/lib/{chunk-MPSHBMZS.js → chunk-SDRMBCHM.js} +2 -2
  240. package/lib/chunk-SDRMBCHM.js.map +1 -0
  241. package/lib/chunk-SGOUEVJ3.cjs.map +1 -1
  242. package/lib/chunk-SGWRNEJB.cjs.map +1 -1
  243. package/lib/chunk-SKFA2ZIK.js.map +1 -1
  244. package/lib/chunk-SOXJJRL2.js.map +1 -1
  245. package/lib/chunk-SPLHKBWG.cjs.map +1 -1
  246. package/lib/chunk-SRW7OWVS.cjs.map +1 -1
  247. package/lib/chunk-SUJCEUOZ.cjs.map +1 -1
  248. package/lib/chunk-SWWPX4V4.cjs.map +1 -1
  249. package/lib/chunk-THO6KQJZ.js.map +1 -1
  250. package/lib/chunk-THVPSJTK.cjs.map +1 -1
  251. package/lib/chunk-TIJIXGNJ.cjs.map +1 -1
  252. package/lib/chunk-TM5OCFYV.cjs.map +1 -1
  253. package/lib/chunk-TOV6ECTA.js.map +1 -1
  254. package/lib/chunk-TQFODT4D.cjs.map +1 -1
  255. package/lib/chunk-TSD2PK6H.js.map +1 -1
  256. package/lib/chunk-TSLXKI72.js.map +1 -1
  257. package/lib/chunk-U5FTZYJJ.js.map +1 -1
  258. package/lib/chunk-U6PW4AZV.js.map +1 -1
  259. package/lib/chunk-UB6JC3W7.js.map +1 -1
  260. package/lib/chunk-UBXNH6J3.js.map +1 -1
  261. package/lib/chunk-UP7FR6HD.cjs.map +1 -1
  262. package/lib/{chunk-W6AL2GJ4.cjs → chunk-UROMLQDG.cjs} +2 -2
  263. package/lib/chunk-UROMLQDG.cjs.map +1 -0
  264. package/lib/chunk-VNWOCO65.cjs.map +1 -1
  265. package/lib/chunk-VPXMI42G.cjs.map +1 -1
  266. package/lib/chunk-VRFSITD3.js.map +1 -1
  267. package/lib/chunk-VUCYIRSC.cjs.map +1 -1
  268. package/lib/chunk-W6YJDUYD.js.map +1 -1
  269. package/lib/chunk-WAL76UPE.cjs.map +1 -1
  270. package/lib/chunk-WC4Z7ENS.cjs.map +1 -1
  271. package/lib/chunk-WI5IVLYL.js.map +1 -1
  272. package/lib/chunk-WKN5RLNR.js.map +1 -1
  273. package/lib/chunk-WP3L72CW.js.map +1 -1
  274. package/lib/chunk-WTHX574O.js.map +1 -1
  275. package/lib/chunk-WVKEXOIY.js.map +1 -1
  276. package/lib/chunk-WXD4O4UY.js.map +1 -1
  277. package/lib/chunk-X2D47UM7.cjs.map +1 -1
  278. package/lib/chunk-XMDDYWH5.js.map +1 -1
  279. package/lib/{chunk-S3MCPCGR.cjs → chunk-XOYVZN2R.cjs} +4 -4
  280. package/lib/chunk-XOYVZN2R.cjs.map +1 -0
  281. package/lib/chunk-XPF5Z2WY.js.map +1 -1
  282. package/lib/chunk-XR3KEV7U.js.map +1 -1
  283. package/lib/chunk-XUC3BYL2.cjs.map +1 -1
  284. package/lib/{chunk-YUGZUUAU.js → chunk-XXKXNBD5.js} +2 -2
  285. package/lib/chunk-XXKXNBD5.js.map +1 -0
  286. package/lib/{chunk-N6MHUHGE.cjs → chunk-Y27X5PYA.cjs} +2 -2
  287. package/lib/chunk-Y27X5PYA.cjs.map +1 -0
  288. package/lib/chunk-Y2IGLW5N.js.map +1 -1
  289. package/lib/chunk-Y3BFYVWA.js.map +1 -1
  290. package/lib/chunk-Y5BP4C42.cjs.map +1 -1
  291. package/lib/chunk-YAKNUPNE.cjs.map +1 -1
  292. package/lib/chunk-YAVHAWTZ.js.map +1 -1
  293. package/lib/chunk-YBXRC6MC.js.map +1 -1
  294. package/lib/chunk-YHYBOXVX.cjs.map +1 -1
  295. package/lib/chunk-YIDX7HVR.cjs.map +1 -1
  296. package/lib/chunk-YN4M5CNJ.js.map +1 -1
  297. package/lib/chunk-YOHBJHTH.cjs.map +1 -1
  298. package/lib/chunk-YY5ENJSH.cjs.map +1 -1
  299. package/lib/{chunk-SN6BP777.js → chunk-YZ57ATOP.js} +2 -2
  300. package/lib/chunk-YZ57ATOP.js.map +1 -0
  301. package/lib/chunk-Z2QVXW6T.cjs.map +1 -1
  302. package/lib/chunk-Z667GAZJ.js.map +1 -1
  303. package/lib/chunk-Z7DKPFKZ.js.map +1 -1
  304. package/lib/chunk-ZAISVVBE.cjs.map +1 -1
  305. package/lib/chunk-ZASD6IUL.js.map +1 -1
  306. package/lib/chunk-ZEEB5YAU.js.map +1 -1
  307. package/lib/{chunk-IDAOX5RB.cjs → chunk-ZLDJ7WAY.cjs} +2 -2
  308. package/lib/chunk-ZLDJ7WAY.cjs.map +1 -0
  309. package/lib/chunk-ZQSCFH5J.cjs.map +1 -1
  310. package/lib/chunk-ZTVQSWSD.cjs.map +1 -1
  311. package/lib/chunk-ZU7GFVQ6.js.map +1 -1
  312. package/lib/chunk-ZZF34M2E.cjs.map +1 -1
  313. package/lib/commercelayer.cjs +5 -5
  314. package/lib/commercelayer.d.cts +3 -3
  315. package/lib/commercelayer.d.ts +3 -3
  316. package/lib/commercelayer.js +1 -1
  317. package/lib/enum.d.cts +1 -1
  318. package/lib/enum.d.ts +1 -1
  319. package/lib/index.cjs +25 -25
  320. package/lib/index.d.cts +1 -1
  321. package/lib/index.d.ts +1 -1
  322. package/lib/index.js +12 -12
  323. package/lib/jsonapi.d.cts +1 -1
  324. package/lib/jsonapi.d.ts +1 -1
  325. package/lib/model.d.cts +1 -1
  326. package/lib/model.d.ts +1 -1
  327. package/lib/query.d.cts +1 -1
  328. package/lib/query.d.ts +1 -1
  329. package/lib/resource.d.cts +1 -1
  330. package/lib/resource.d.ts +1 -1
  331. package/lib/resources/addresses.d.cts +2 -2
  332. package/lib/resources/addresses.d.ts +1 -1
  333. package/lib/resources/adjustments.d.cts +2 -2
  334. package/lib/resources/adjustments.d.ts +1 -1
  335. package/lib/resources/adyen_gateways.d.cts +2 -2
  336. package/lib/resources/adyen_gateways.d.ts +1 -1
  337. package/lib/resources/adyen_payments.d.cts +2 -2
  338. package/lib/resources/adyen_payments.d.ts +1 -1
  339. package/lib/resources/applications.d.cts +2 -2
  340. package/lib/resources/applications.d.ts +1 -1
  341. package/lib/resources/attachments.d.cts +2 -2
  342. package/lib/resources/attachments.d.ts +1 -1
  343. package/lib/resources/authorizations.d.cts +2 -2
  344. package/lib/resources/authorizations.d.ts +1 -1
  345. package/lib/resources/avalara_accounts.d.cts +2 -2
  346. package/lib/resources/avalara_accounts.d.ts +1 -1
  347. package/lib/resources/axerve_gateways.d.cts +2 -2
  348. package/lib/resources/axerve_gateways.d.ts +1 -1
  349. package/lib/resources/axerve_payments.d.cts +2 -2
  350. package/lib/resources/axerve_payments.d.ts +1 -1
  351. package/lib/resources/bing_geocoders.d.cts +2 -2
  352. package/lib/resources/bing_geocoders.d.ts +1 -1
  353. package/lib/resources/braintree_gateways.d.cts +2 -2
  354. package/lib/resources/braintree_gateways.d.ts +1 -1
  355. package/lib/resources/braintree_payments.d.cts +2 -2
  356. package/lib/resources/braintree_payments.d.ts +1 -1
  357. package/lib/resources/bundles.d.cts +2 -2
  358. package/lib/resources/bundles.d.ts +1 -1
  359. package/lib/resources/buy_x_pay_y_promotions.cjs +2 -2
  360. package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
  361. package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
  362. package/lib/resources/buy_x_pay_y_promotions.js +1 -1
  363. package/lib/resources/captures.d.cts +2 -2
  364. package/lib/resources/captures.d.ts +1 -1
  365. package/lib/resources/carrier_accounts.d.cts +2 -2
  366. package/lib/resources/carrier_accounts.d.ts +1 -1
  367. package/lib/resources/checkout_com_gateways.d.cts +2 -2
  368. package/lib/resources/checkout_com_gateways.d.ts +1 -1
  369. package/lib/resources/checkout_com_payments.d.cts +2 -2
  370. package/lib/resources/checkout_com_payments.d.ts +1 -1
  371. package/lib/resources/cleanups.d.cts +2 -2
  372. package/lib/resources/cleanups.d.ts +1 -1
  373. package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
  374. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
  375. package/lib/resources/coupon_recipients.d.cts +2 -2
  376. package/lib/resources/coupon_recipients.d.ts +1 -1
  377. package/lib/resources/coupons.d.cts +2 -2
  378. package/lib/resources/coupons.d.ts +1 -1
  379. package/lib/resources/custom_promotion_rules.d.cts +2 -2
  380. package/lib/resources/custom_promotion_rules.d.ts +1 -1
  381. package/lib/resources/customer_addresses.d.cts +2 -2
  382. package/lib/resources/customer_addresses.d.ts +1 -1
  383. package/lib/resources/customer_groups.d.cts +2 -2
  384. package/lib/resources/customer_groups.d.ts +1 -1
  385. package/lib/resources/customer_password_resets.d.cts +2 -2
  386. package/lib/resources/customer_password_resets.d.ts +1 -1
  387. package/lib/resources/customer_payment_sources.d.cts +2 -2
  388. package/lib/resources/customer_payment_sources.d.ts +1 -1
  389. package/lib/resources/customer_subscriptions.d.cts +2 -2
  390. package/lib/resources/customer_subscriptions.d.ts +1 -1
  391. package/lib/resources/customers.d.cts +2 -2
  392. package/lib/resources/customers.d.ts +1 -1
  393. package/lib/resources/delivery_lead_times.d.cts +2 -2
  394. package/lib/resources/delivery_lead_times.d.ts +1 -1
  395. package/lib/resources/discount_engine_items.d.cts +2 -2
  396. package/lib/resources/discount_engine_items.d.ts +1 -1
  397. package/lib/resources/discount_engines.d.cts +2 -2
  398. package/lib/resources/discount_engines.d.ts +1 -1
  399. package/lib/resources/easypost_pickups.d.cts +2 -2
  400. package/lib/resources/easypost_pickups.d.ts +1 -1
  401. package/lib/resources/event_callbacks.d.cts +2 -2
  402. package/lib/resources/event_callbacks.d.ts +1 -1
  403. package/lib/resources/events.d.cts +2 -2
  404. package/lib/resources/events.d.ts +1 -1
  405. package/lib/resources/exports.d.cts +2 -2
  406. package/lib/resources/exports.d.ts +1 -1
  407. package/lib/resources/external_gateways.d.cts +2 -2
  408. package/lib/resources/external_gateways.d.ts +1 -1
  409. package/lib/resources/external_payments.d.cts +2 -2
  410. package/lib/resources/external_payments.d.ts +1 -1
  411. package/lib/resources/external_promotions.cjs +2 -2
  412. package/lib/resources/external_promotions.d.cts +2 -2
  413. package/lib/resources/external_promotions.d.ts +1 -1
  414. package/lib/resources/external_promotions.js +1 -1
  415. package/lib/resources/external_tax_calculators.d.cts +2 -2
  416. package/lib/resources/external_tax_calculators.d.ts +1 -1
  417. package/lib/resources/fixed_amount_promotions.cjs +2 -2
  418. package/lib/resources/fixed_amount_promotions.d.cts +2 -2
  419. package/lib/resources/fixed_amount_promotions.d.ts +1 -1
  420. package/lib/resources/fixed_amount_promotions.js +1 -1
  421. package/lib/resources/fixed_price_promotions.cjs +2 -2
  422. package/lib/resources/fixed_price_promotions.d.cts +2 -2
  423. package/lib/resources/fixed_price_promotions.d.ts +1 -1
  424. package/lib/resources/fixed_price_promotions.js +1 -1
  425. package/lib/resources/flex_promotions.cjs +2 -2
  426. package/lib/resources/flex_promotions.d.cts +2 -2
  427. package/lib/resources/flex_promotions.d.ts +1 -1
  428. package/lib/resources/flex_promotions.js +1 -1
  429. package/lib/resources/free_gift_promotions.cjs +2 -2
  430. package/lib/resources/free_gift_promotions.d.cts +2 -2
  431. package/lib/resources/free_gift_promotions.d.ts +1 -1
  432. package/lib/resources/free_gift_promotions.js +1 -1
  433. package/lib/resources/free_shipping_promotions.cjs +2 -2
  434. package/lib/resources/free_shipping_promotions.d.cts +2 -2
  435. package/lib/resources/free_shipping_promotions.d.ts +1 -1
  436. package/lib/resources/free_shipping_promotions.js +1 -1
  437. package/lib/resources/geocoders.d.cts +2 -2
  438. package/lib/resources/geocoders.d.ts +1 -1
  439. package/lib/resources/gift_card_recipients.d.cts +2 -2
  440. package/lib/resources/gift_card_recipients.d.ts +1 -1
  441. package/lib/resources/gift_cards.d.cts +2 -2
  442. package/lib/resources/gift_cards.d.ts +1 -1
  443. package/lib/resources/google_geocoders.d.cts +2 -2
  444. package/lib/resources/google_geocoders.d.ts +1 -1
  445. package/lib/resources/imports.d.cts +2 -2
  446. package/lib/resources/imports.d.ts +1 -1
  447. package/lib/resources/in_stock_subscriptions.d.cts +2 -2
  448. package/lib/resources/in_stock_subscriptions.d.ts +1 -1
  449. package/lib/resources/inventory_models.d.cts +2 -2
  450. package/lib/resources/inventory_models.d.ts +1 -1
  451. package/lib/resources/inventory_return_locations.d.cts +2 -2
  452. package/lib/resources/inventory_return_locations.d.ts +1 -1
  453. package/lib/resources/inventory_stock_locations.d.cts +2 -2
  454. package/lib/resources/inventory_stock_locations.d.ts +1 -1
  455. package/lib/resources/klarna_gateways.d.cts +2 -2
  456. package/lib/resources/klarna_gateways.d.ts +1 -1
  457. package/lib/resources/klarna_payments.d.cts +2 -2
  458. package/lib/resources/klarna_payments.d.ts +1 -1
  459. package/lib/resources/line_item_options.d.cts +2 -2
  460. package/lib/resources/line_item_options.d.ts +1 -1
  461. package/lib/resources/line_items.d.cts +2 -2
  462. package/lib/resources/line_items.d.ts +1 -1
  463. package/lib/resources/links.d.cts +2 -2
  464. package/lib/resources/links.d.ts +1 -1
  465. package/lib/resources/manual_gateways.d.cts +2 -2
  466. package/lib/resources/manual_gateways.d.ts +1 -1
  467. package/lib/resources/manual_tax_calculators.d.cts +2 -2
  468. package/lib/resources/manual_tax_calculators.d.ts +1 -1
  469. package/lib/resources/markets.d.cts +2 -2
  470. package/lib/resources/markets.d.ts +1 -1
  471. package/lib/resources/merchants.d.cts +2 -2
  472. package/lib/resources/merchants.d.ts +1 -1
  473. package/lib/resources/notifications.d.cts +2 -2
  474. package/lib/resources/notifications.d.ts +1 -1
  475. package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
  476. package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
  477. package/lib/resources/order_copies.d.cts +2 -2
  478. package/lib/resources/order_copies.d.ts +1 -1
  479. package/lib/resources/order_factories.d.cts +2 -2
  480. package/lib/resources/order_factories.d.ts +1 -1
  481. package/lib/resources/order_subscription_items.d.cts +2 -2
  482. package/lib/resources/order_subscription_items.d.ts +1 -1
  483. package/lib/resources/order_subscriptions.d.cts +2 -2
  484. package/lib/resources/order_subscriptions.d.ts +1 -1
  485. package/lib/resources/orders.d.cts +2 -2
  486. package/lib/resources/orders.d.ts +1 -1
  487. package/lib/resources/organizations.cjs +2 -2
  488. package/lib/resources/organizations.d.cts +2 -2
  489. package/lib/resources/organizations.d.ts +1 -1
  490. package/lib/resources/organizations.js +1 -1
  491. package/lib/resources/packages.d.cts +2 -2
  492. package/lib/resources/packages.d.ts +1 -1
  493. package/lib/resources/parcel_line_items.d.cts +2 -2
  494. package/lib/resources/parcel_line_items.d.ts +1 -1
  495. package/lib/resources/parcels.d.cts +2 -2
  496. package/lib/resources/parcels.d.ts +1 -1
  497. package/lib/resources/payment_gateways.d.cts +2 -2
  498. package/lib/resources/payment_gateways.d.ts +1 -1
  499. package/lib/resources/payment_methods.d.cts +2 -2
  500. package/lib/resources/payment_methods.d.ts +1 -1
  501. package/lib/resources/payment_options.d.cts +2 -2
  502. package/lib/resources/payment_options.d.ts +1 -1
  503. package/lib/resources/paypal_gateways.d.cts +2 -2
  504. package/lib/resources/paypal_gateways.d.ts +1 -1
  505. package/lib/resources/paypal_payments.d.cts +2 -2
  506. package/lib/resources/paypal_payments.d.ts +1 -1
  507. package/lib/resources/percentage_discount_promotions.cjs +2 -2
  508. package/lib/resources/percentage_discount_promotions.d.cts +2 -2
  509. package/lib/resources/percentage_discount_promotions.d.ts +1 -1
  510. package/lib/resources/percentage_discount_promotions.js +1 -1
  511. package/lib/resources/pickups.d.cts +2 -2
  512. package/lib/resources/pickups.d.ts +1 -1
  513. package/lib/resources/price_frequency_tiers.d.cts +2 -2
  514. package/lib/resources/price_frequency_tiers.d.ts +1 -1
  515. package/lib/resources/price_list_schedulers.d.cts +2 -2
  516. package/lib/resources/price_list_schedulers.d.ts +1 -1
  517. package/lib/resources/price_lists.d.cts +2 -2
  518. package/lib/resources/price_lists.d.ts +1 -1
  519. package/lib/resources/price_tiers.d.cts +2 -2
  520. package/lib/resources/price_tiers.d.ts +1 -1
  521. package/lib/resources/price_volume_tiers.d.cts +2 -2
  522. package/lib/resources/price_volume_tiers.d.ts +1 -1
  523. package/lib/resources/prices.d.cts +2 -2
  524. package/lib/resources/prices.d.ts +1 -1
  525. package/lib/resources/promotion_rules.d.cts +2 -2
  526. package/lib/resources/promotion_rules.d.ts +1 -1
  527. package/lib/resources/promotions.cjs +2 -2
  528. package/lib/resources/promotions.d.cts +2 -2
  529. package/lib/resources/promotions.d.ts +1 -1
  530. package/lib/resources/promotions.js +1 -1
  531. package/lib/resources/recurring_order_copies.d.cts +2 -2
  532. package/lib/resources/recurring_order_copies.d.ts +1 -1
  533. package/lib/resources/refunds.d.cts +2 -2
  534. package/lib/resources/refunds.d.ts +1 -1
  535. package/lib/resources/reserved_stocks.d.cts +2 -2
  536. package/lib/resources/reserved_stocks.d.ts +1 -1
  537. package/lib/resources/resource_errors.d.cts +2 -2
  538. package/lib/resources/resource_errors.d.ts +1 -1
  539. package/lib/resources/return_line_items.d.cts +2 -2
  540. package/lib/resources/return_line_items.d.ts +1 -1
  541. package/lib/resources/returns.d.cts +2 -2
  542. package/lib/resources/returns.d.ts +1 -1
  543. package/lib/resources/satispay_gateways.d.cts +2 -2
  544. package/lib/resources/satispay_gateways.d.ts +1 -1
  545. package/lib/resources/satispay_payments.d.cts +2 -2
  546. package/lib/resources/satispay_payments.d.ts +1 -1
  547. package/lib/resources/shipments.d.cts +2 -2
  548. package/lib/resources/shipments.d.ts +1 -1
  549. package/lib/resources/shipping_categories.d.cts +2 -2
  550. package/lib/resources/shipping_categories.d.ts +1 -1
  551. package/lib/resources/shipping_method_tiers.d.cts +2 -2
  552. package/lib/resources/shipping_method_tiers.d.ts +1 -1
  553. package/lib/resources/shipping_methods.d.cts +2 -2
  554. package/lib/resources/shipping_methods.d.ts +1 -1
  555. package/lib/resources/shipping_weight_tiers.d.cts +2 -2
  556. package/lib/resources/shipping_weight_tiers.d.ts +1 -1
  557. package/lib/resources/shipping_zones.d.cts +2 -2
  558. package/lib/resources/shipping_zones.d.ts +1 -1
  559. package/lib/resources/sku_list_items.d.cts +2 -2
  560. package/lib/resources/sku_list_items.d.ts +1 -1
  561. package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
  562. package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
  563. package/lib/resources/sku_lists.d.cts +2 -2
  564. package/lib/resources/sku_lists.d.ts +1 -1
  565. package/lib/resources/sku_options.d.cts +2 -2
  566. package/lib/resources/sku_options.d.ts +1 -1
  567. package/lib/resources/skus.d.cts +2 -2
  568. package/lib/resources/skus.d.ts +1 -1
  569. package/lib/resources/stock_items.d.cts +2 -2
  570. package/lib/resources/stock_items.d.ts +1 -1
  571. package/lib/resources/stock_line_items.d.cts +2 -2
  572. package/lib/resources/stock_line_items.d.ts +1 -1
  573. package/lib/resources/stock_locations.d.cts +2 -2
  574. package/lib/resources/stock_locations.d.ts +1 -1
  575. package/lib/resources/stock_reservations.d.cts +2 -2
  576. package/lib/resources/stock_reservations.d.ts +1 -1
  577. package/lib/resources/stock_transfers.d.cts +2 -2
  578. package/lib/resources/stock_transfers.d.ts +1 -1
  579. package/lib/resources/stores.d.cts +2 -2
  580. package/lib/resources/stores.d.ts +1 -1
  581. package/lib/resources/stripe_gateways.d.cts +2 -2
  582. package/lib/resources/stripe_gateways.d.ts +1 -1
  583. package/lib/resources/stripe_payments.d.cts +2 -2
  584. package/lib/resources/stripe_payments.d.ts +1 -1
  585. package/lib/resources/stripe_tax_accounts.d.cts +2 -2
  586. package/lib/resources/stripe_tax_accounts.d.ts +1 -1
  587. package/lib/resources/subscription_models.d.cts +2 -2
  588. package/lib/resources/subscription_models.d.ts +1 -1
  589. package/lib/resources/tags.d.cts +2 -2
  590. package/lib/resources/tags.d.ts +1 -1
  591. package/lib/resources/talon_one_accounts.d.cts +2 -2
  592. package/lib/resources/talon_one_accounts.d.ts +1 -1
  593. package/lib/resources/tax_calculators.d.cts +2 -2
  594. package/lib/resources/tax_calculators.d.ts +1 -1
  595. package/lib/resources/tax_categories.d.cts +2 -2
  596. package/lib/resources/tax_categories.d.ts +1 -1
  597. package/lib/resources/tax_rules.d.cts +2 -2
  598. package/lib/resources/tax_rules.d.ts +1 -1
  599. package/lib/resources/taxjar_accounts.d.cts +2 -2
  600. package/lib/resources/taxjar_accounts.d.ts +1 -1
  601. package/lib/resources/transactions.d.cts +2 -2
  602. package/lib/resources/transactions.d.ts +1 -1
  603. package/lib/resources/versions.d.cts +2 -2
  604. package/lib/resources/versions.d.ts +1 -1
  605. package/lib/resources/vertex_accounts.d.cts +2 -2
  606. package/lib/resources/vertex_accounts.d.ts +1 -1
  607. package/lib/resources/voids.d.cts +2 -2
  608. package/lib/resources/voids.d.ts +1 -1
  609. package/lib/resources/webhooks.d.cts +2 -2
  610. package/lib/resources/webhooks.d.ts +1 -1
  611. package/lib/resources/wire_transfers.d.cts +2 -2
  612. package/lib/resources/wire_transfers.d.ts +1 -1
  613. package/lib/static.cjs +3 -3
  614. package/lib/static.d.cts +1 -1
  615. package/lib/static.d.ts +1 -1
  616. package/lib/static.js +2 -2
  617. package/package.json +5 -5
  618. package/lib/chunk-2UUZHL2R.js.map +0 -1
  619. package/lib/chunk-6PWK52UZ.cjs.map +0 -1
  620. package/lib/chunk-7ISS2FDY.js.map +0 -1
  621. package/lib/chunk-ANCLAYJV.cjs.map +0 -1
  622. package/lib/chunk-AVJX4OEZ.js.map +0 -1
  623. package/lib/chunk-BBEMCANC.cjs.map +0 -1
  624. package/lib/chunk-DTGODPCN.js.map +0 -1
  625. package/lib/chunk-EHWAGYNX.js.map +0 -1
  626. package/lib/chunk-EQD223JW.cjs.map +0 -1
  627. package/lib/chunk-HAAE23MQ.js.map +0 -1
  628. package/lib/chunk-HSILJQCD.js.map +0 -1
  629. package/lib/chunk-IDAOX5RB.cjs.map +0 -1
  630. package/lib/chunk-INZD34YD.cjs.map +0 -1
  631. package/lib/chunk-M2ZERG2X.cjs.map +0 -1
  632. package/lib/chunk-MPSHBMZS.js.map +0 -1
  633. package/lib/chunk-N6MHUHGE.cjs.map +0 -1
  634. package/lib/chunk-ROPOLXIV.js.map +0 -1
  635. package/lib/chunk-S3MCPCGR.cjs.map +0 -1
  636. package/lib/chunk-SN6BP777.js.map +0 -1
  637. package/lib/chunk-W6AL2GJ4.cjs.map +0 -1
  638. package/lib/chunk-WBPEFNL7.cjs.map +0 -1
  639. package/lib/chunk-WVAW33XQ.js.map +0 -1
  640. package/lib/chunk-WXE5KXJC.cjs.map +0 -1
  641. package/lib/chunk-YUGZUUAU.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/order_copies.ts"],"names":[],"mappings":";;;AAoIA,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoB,WAAA,CAAuB;AAAA,EAEhD,OAAgB,IAAA,GAAsB,cAAA;AAAA,EAEtC,MAAM,MAAA,CAAO,QAAA,EAA2B,MAAA,EAAyC,OAAA,EAA+C;AAC/H,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAmC,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,YAAA,CAAY,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClH,EAEA,MAAM,MAAA,CAAO,QAAA,EAA2B,MAAA,EAAyC,OAAA,EAA+C;A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AAA,EAAW,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,kBAAA,CAAmB,WAAA,EAAiC,MAAA,EAAiD,OAAA,EAAuD;AACjK,IAAA,MAAM,YAAA,GAAgB,YAA0B,EAAA,IAAM,WAAA;AACtD,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAyB,EAAE,IAAA,EAAM,qBAAA,EAAsB,EAAG,CAAA,aAAA,EAAgB,YAAY,CAAA,mBAAA,CAAA,EAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnJ,EAGA,YAAY,QAAA,EAAsC;AACjD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,YAAA,CAAY,IAAA;AAAA;AACxD,EAGA,aAAa,EAAA,EAA8C;AAC1D,IAAA,OAAO,KAAA,CAAM,qBAAmC,EAAE,CAAA;AAAA;AACnD,EAEA,sBAAsB,GAAA,EAA+B;AACpD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAoC,GAAG,GAAG,CAAA;AAAA;AACxD,EAGA,IAAA,GAAsB;AACrB,IAAA,OAAO,YAAA,CAAY,IAAA;AAAA;AAGrB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,WAAA,EAAY;AACjC,IAAO,oBAAA,GAAQ","file":"chunk-IITNQS6D.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 { Event } from './events'\nimport type { OrderSubscription } from './order_subscriptions'\n\n\ntype OrderCopyType = 'order_copies'\ntype OrderCopyRel = ResourceRel & { type: OrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type OrderCopySort = Pick<OrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type OrderCopyFilter = Pick<OrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface OrderCopy extends Resource {\n\t\n\treadonly type: OrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\t/** \n\t * Indicates if the source order must be cancelled upon copy.\n\t * @example ```true```\n\t */\n\tcancel_source_order?: boolean | null\n\t/** \n\t * Indicates if promotions got applied upon copy.\n\t * @example ```true```\n\t */\n\tapply_promotions?: boolean | null\n\t/** \n\t * Indicates to ignore any errors during copy.\n\t * @example ```true```\n\t */\n\tskip_errors?: boolean | null\n\t/** \n\t * Indicates to ignore invalid coupon code during copy.\n\t * @example ```true```\n\t */\n\tignore_invalid_coupon?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface OrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\t/** \n\t * Indicates if the source order must be cancelled upon copy.\n\t * @example ```true```\n\t */\n\tcancel_source_order?: boolean | null\n\t/** \n\t * Indicates if promotions got applied upon copy.\n\t * @example ```true```\n\t */\n\tapply_promotions?: boolean | null\n\t/** \n\t * Indicates to ignore any errors during copy.\n\t * @example ```true```\n\t */\n\tskip_errors?: boolean | null\n\t/** \n\t * Indicates to ignore invalid coupon code during copy.\n\t * @example ```true```\n\t */\n\tignore_invalid_coupon?: boolean | null\n\n\tsource_order: OrderRel\n\n}\n\n\ntype OrderCopyUpdate = ResourceUpdate\n\n\nclass OrderCopies extends ApiResource<OrderCopy> {\n\n\tstatic readonly TYPE: OrderCopyType = 'order_copies' as const\n\n\tasync create(resource: OrderCopyCreate, params?: QueryParamsRetrieve<OrderCopy>, options?: ResourcesConfig): Promise<OrderCopy> {\n\t\treturn this.resources.create<OrderCopyCreate, OrderCopy>({ ...resource, type: OrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: OrderCopyUpdate, params?: QueryParamsRetrieve<OrderCopy>, options?: ResourcesConfig): Promise<OrderCopy> {\n\t\treturn this.resources.update<OrderCopyUpdate, OrderCopy>({ ...resource, type: OrderCopies.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: OrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_copies/${_orderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_copies/${_orderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(orderCopyId: string | OrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `order_copies/${_orderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `order_copies/${_orderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisOrderCopy(resource: any): resource is OrderCopy {\n\t\treturn resource.type && (resource.type === OrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): OrderCopyRel {\n\t\treturn super.relationshipOneToOne<OrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): OrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<OrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): OrderCopyType {\n\t\treturn OrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new OrderCopies()\nexport default instance\n\nexport type { OrderCopies, OrderCopy, OrderCopyCreate, OrderCopyUpdate, OrderCopyType }\n"]}
1
+ {"version":3,"sources":["../src/resources/order_copies.ts"],"names":[],"mappings":";;;AAoIA,IAAM,WAAA,GAA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oBAAA,GAAQ","file":"chunk-IITNQS6D.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 { Event } from './events'\nimport type { OrderSubscription } from './order_subscriptions'\n\n\ntype OrderCopyType = 'order_copies'\ntype OrderCopyRel = ResourceRel & { type: OrderCopyType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type OrderCopySort = Pick<OrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceSort\n// export type OrderCopyFilter = Pick<OrderCopy, 'id' | 'status' | 'started_at' | 'completed_at' | 'failed_at' | 'errors_count'> & ResourceFilter\n\n\ninterface OrderCopy extends Resource {\n\t\n\treadonly type: OrderCopyType\n\n\t/** \n\t * The order factory status. One of 'pending' (default), 'in_progress', 'aborted', 'failed', or 'completed'.\n\t * @example ```\"in_progress\"```\n\t */\n\tstatus: 'pending' | 'in_progress' | 'aborted' | 'failed' | 'completed'\n\t/** \n\t * Time at which the order copy was started.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarted_at?: string | null\n\t/** \n\t * Time at which the order copy was completed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcompleted_at?: string | null\n\t/** \n\t * Time at which the order copy has failed.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tfailed_at?: string | null\n\t/** \n\t * Contains the order copy errors, if any.\n\t * @example ```{\"status\":[\"cannot transition from draft to placed\"]}```\n\t */\n\terrors_log?: Record<string, any> | null\n\t/** \n\t * Indicates the number of copy errors, if any.\n\t * @example ```2```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\t/** \n\t * Indicates if the source order must be cancelled upon copy.\n\t * @example ```true```\n\t */\n\tcancel_source_order?: boolean | null\n\t/** \n\t * Indicates if promotions got applied upon copy.\n\t * @example ```true```\n\t */\n\tapply_promotions?: boolean | null\n\t/** \n\t * Indicates to ignore any errors during copy.\n\t * @example ```true```\n\t */\n\tskip_errors?: boolean | null\n\t/** \n\t * Indicates to ignore invalid coupon code during copy.\n\t * @example ```true```\n\t */\n\tignore_invalid_coupon?: boolean | null\n\n\tsource_order?: Order | null\n\ttarget_order?: Order | null\n\tevents?: Event[] | null\n\torder_subscription?: OrderSubscription | null\n\n}\n\n\ninterface OrderCopyCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if the target order must be placed upon copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates if the payment source within the source order customer's wallet must be copied.\n\t * @example ```true```\n\t */\n\treuse_wallet?: boolean | null\n\t/** \n\t * Indicates if the source order must be cancelled upon copy.\n\t * @example ```true```\n\t */\n\tcancel_source_order?: boolean | null\n\t/** \n\t * Indicates if promotions got applied upon copy.\n\t * @example ```true```\n\t */\n\tapply_promotions?: boolean | null\n\t/** \n\t * Indicates to ignore any errors during copy.\n\t * @example ```true```\n\t */\n\tskip_errors?: boolean | null\n\t/** \n\t * Indicates to ignore invalid coupon code during copy.\n\t * @example ```true```\n\t */\n\tignore_invalid_coupon?: boolean | null\n\n\tsource_order: OrderRel\n\n}\n\n\ntype OrderCopyUpdate = ResourceUpdate\n\n\nclass OrderCopies extends ApiResource<OrderCopy> {\n\n\tstatic readonly TYPE: OrderCopyType = 'order_copies' as const\n\n\tasync create(resource: OrderCopyCreate, params?: QueryParamsRetrieve<OrderCopy>, options?: ResourcesConfig): Promise<OrderCopy> {\n\t\treturn this.resources.create<OrderCopyCreate, OrderCopy>({ ...resource, type: OrderCopies.TYPE }, params, options)\n\t}\n\n\tasync update(resource: OrderCopyUpdate, params?: QueryParamsRetrieve<OrderCopy>, options?: ResourcesConfig): Promise<OrderCopy> {\n\t\treturn this.resources.update<OrderCopyUpdate, OrderCopy>({ ...resource, type: OrderCopies.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: OrderCopies.TYPE } : id, options)\n\t}\n\n\tasync source_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_copies/${_orderCopyId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync target_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_copies/${_orderCopyId}/target_order`, params, options) as unknown as Order\n\t}\n\n\tasync events(orderCopyId: string | OrderCopy, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `order_copies/${_orderCopyId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync order_subscription(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\tconst _orderCopyId = (orderCopyId as OrderCopy).id || orderCopyId as string\n\t\treturn this.resources.fetch<OrderSubscription>({ type: 'order_subscriptions' }, `order_copies/${_orderCopyId}/order_subscription`, params, options) as unknown as OrderSubscription\n\t}\n\n\n\tisOrderCopy(resource: any): resource is OrderCopy {\n\t\treturn resource.type && (resource.type === OrderCopies.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): OrderCopyRel {\n\t\treturn super.relationshipOneToOne<OrderCopyRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): OrderCopyRel[] {\n\t\treturn super.relationshipOneToMany<OrderCopyRel>(...ids)\n\t}\n\n\n\ttype(): OrderCopyType {\n\t\treturn OrderCopies.TYPE\n\t}\n\n}\n\n\nconst instance = new OrderCopies()\nexport default instance\n\nexport type { OrderCopies, OrderCopy, OrderCopyCreate, OrderCopyUpdate, OrderCopyType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/returns.ts"],"names":["ApiResource"],"mappings":";;;;;AA6MA,IAAM,OAAA,GAAN,MAAM,QAAA,SAAgBA,6BAAA,CAAoB;AAAA,EAEzC,OAAgB,IAAA,GAAmB,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAA,EAAwB,MAAA,EAAsC,OAAA,EAA4C;AACtH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,QAAA,CAAQ,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAA,EAAwB,MAAA,EAAsC,OAAA,EAA4C;AACtH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,QAAA,CAAQ,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,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,QAAA,CAAQ,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,KAA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AK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,QAAA,CAAQ,IAAA,EAAM,cAAc,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA;AAChK,EAGA,SAAS,QAAA,EAAmC;AAC3C,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,QAAA,CAAQ,IAAA;AAAA;AACpD,EAGA,aAAa,EAAA,EAA2C;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAAA,EAA4B;AACjD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAiC,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAA,GAAmB;AAClB,IAAA,OAAO,QAAA,CAAQ,IAAA;AAAA;AAGjB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,OAAA,EAAQ;AAC7B,IAAO,eAAA,GAAQ","file":"chunk-IKENWSRH.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 { Customer } from './customers'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Address } from './addresses'\nimport type { Capture, CaptureType } from './captures'\nimport type { Refund } from './refunds'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { Attachment } from './attachments'\nimport type { ResourceError } from './resource_errors'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype ReturnType = 'returns'\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype CaptureRel = ResourceRel & { type: CaptureType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type ReturnSort = Pick<Return, 'id' | 'number' | 'status' | 'approved_at' | 'cancelled_at' | 'shipped_at' | 'rejected_at' | 'received_at' | 'refunded_at' | 'archived_at'> & ResourceSort\n// export type ReturnFilter = Pick<Return, 'id' | 'number' | 'status' | 'skus_count' | 'approved_at' | 'cancelled_at' | 'shipped_at' | 'rejected_at' | 'received_at' | 'refunded_at' | 'archived_at'> & ResourceFilter\n\n\ninterface Return extends Resource {\n\t\n\treadonly type: ReturnType\n\n\t/** \n\t * Unique identifier for the return.\n\t * @example ```\"#1234/R/001\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The return status. One of 'draft' (default), 'requested', 'approved', 'cancelled', 'shipped', 'rejected', 'received', or 'refunded'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received' | 'refunded'\n\t/** \n\t * The email address of the associated customer.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email?: string | null\n\t/** \n\t * The total number of SKUs in the return's line items. This can be useful to display a preview of the return content.\n\t * @example ```2```\n\t */\n\tskus_count?: number | null\n\t/** \n\t * Time at which the return was approved.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tapproved_at?: string | null\n\t/** \n\t * Time at which the return was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\t/** \n\t * Time at which the return was shipped.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tshipped_at?: string | null\n\t/** \n\t * Time at which the return was rejected.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trejected_at?: string | null\n\t/** \n\t * Time at which the return was received.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\treceived_at?: string | null\n\t/** \n\t * Time at which the return was refunded.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trefunded_at?: string | null\n\t/** \n\t * Time at which the resource has been archived.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tarchived_at?: string | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, in cents.\n\t * @example ```500```\n\t */\n\testimated_refund_amount_cents?: number | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, float.\n\t * @example ```5```\n\t */\n\testimated_refund_amount_float?: number | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, formatted.\n\t * @example ```\"€5,00\"```\n\t */\n\tformatted_estimated_refund_amount?: string | null\n\n\torder?: Order | null\n\tcustomer?: Customer | null\n\tstock_location?: StockLocation | null\n\torigin_address?: Address | null\n\tdestination_address?: Address | null\n\treference_capture?: Capture | null\n\treference_refund?: Refund | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tattachments?: Attachment[] | null\n\tresource_errors?: ResourceError[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ReturnCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\tstock_location?: StockLocationRel | null\n\treference_capture?: CaptureRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface ReturnUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to activate this return.\n\t * @example ```true```\n\t */\n\t_request?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as approved.\n\t * @example ```true```\n\t */\n\t_approve?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as cancelled.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as shipped.\n\t * @example ```true```\n\t */\n\t_ship?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as rejected.\n\t * @example ```true```\n\t */\n\t_reject?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as received.\n\t * @example ```true```\n\t */\n\t_receive?: boolean | null\n\t/** \n\t * Send this attribute if you want to restock all of the return line items.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Send this attribute if you want to archive the return.\n\t * @example ```true```\n\t */\n\t_archive?: boolean | null\n\t/** \n\t * Send this attribute if you want to unarchive the return.\n\t * @example ```true```\n\t */\n\t_unarchive?: boolean | null\n\t/** \n\t * Send this attribute if you want to create a refund for this return.\n\t * @example ```true```\n\t */\n\t_refund?: boolean | null\n\t/** \n\t * Send this attribute as a value in cents to specify the amount to be refunded.\n\t * @example ```500```\n\t */\n\t_refund_amount_cents?: number | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tstock_location?: StockLocationRel | null\n\treference_capture?: CaptureRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Returns extends ApiResource<Return> {\n\n\tstatic readonly TYPE: ReturnType = 'returns' as const\n\n\tasync create(resource: ReturnCreate, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.create<ReturnCreate, Return>({ ...resource, type: Returns.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnUpdate, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ ...resource, type: Returns.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: Returns.TYPE } : id, options)\n\t}\n\n\tasync order(returnId: string | Return, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `returns/${_returnId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync customer(returnId: string | Return, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `returns/${_returnId}/customer`, params, options) as unknown as Customer\n\t}\n\n\tasync stock_location(returnId: string | Return, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `returns/${_returnId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync origin_address(returnId: string | Return, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `returns/${_returnId}/origin_address`, params, options) as unknown as Address\n\t}\n\n\tasync destination_address(returnId: string | Return, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `returns/${_returnId}/destination_address`, params, options) as unknown as Address\n\t}\n\n\tasync reference_capture(returnId: string | Return, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `returns/${_returnId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync reference_refund(returnId: string | Return, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Refund>({ type: 'refunds' }, `returns/${_returnId}/reference_refund`, params, options) as unknown as Refund\n\t}\n\n\tasync return_line_items(returnId: string | Return, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `returns/${_returnId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync attachments(returnId: string | Return, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `returns/${_returnId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync resource_errors(returnId: string | Return, params?: QueryParamsList<ResourceError>, options?: ResourcesConfig): Promise<ListResponse<ResourceError>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<ResourceError>({ type: 'resource_errors' }, `returns/${_returnId}/resource_errors`, params, options) as unknown as ListResponse<ResourceError>\n\t}\n\n\tasync events(returnId: string | Return, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `returns/${_returnId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(returnId: string | Return, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `returns/${_returnId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(returnId: string | Return, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `returns/${_returnId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _request(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _request: true }, params, options)\n\t}\n\n\tasync _approve(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _approve: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _cancel: true }, params, options)\n\t}\n\n\tasync _ship(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _ship: true }, params, options)\n\t}\n\n\tasync _reject(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _reject: true }, params, options)\n\t}\n\n\tasync _receive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _receive: true }, params, options)\n\t}\n\n\tasync _restock(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _restock: true }, params, options)\n\t}\n\n\tasync _archive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _archive: true }, params, options)\n\t}\n\n\tasync _unarchive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _unarchive: true }, params, options)\n\t}\n\n\tasync _refund(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _refund: true }, params, options)\n\t}\n\n\tasync _refund_amount_cents(id: string | Return, triggerValue: number, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _refund_amount_cents: triggerValue }, params, options)\n\t}\n\n\tasync _add_tags(id: string | Return, triggerValue: string, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Return, triggerValue: string, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisReturn(resource: any): resource is Return {\n\t\treturn resource.type && (resource.type === Returns.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnRel {\n\t\treturn super.relationshipOneToOne<ReturnRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnRel[] {\n\t\treturn super.relationshipOneToMany<ReturnRel>(...ids)\n\t}\n\n\n\ttype(): ReturnType {\n\t\treturn Returns.TYPE\n\t}\n\n}\n\n\nconst instance = new Returns()\nexport default instance\n\nexport type { Returns, Return, ReturnCreate, ReturnUpdate, ReturnType }\n"]}
1
+ {"version":3,"sources":["../src/resources/returns.ts"],"names":["ApiResource"],"mappings":";;;;;AA6MA,IAAM,OAAA,G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A,EAGA,aAAa,EAAA,EAA2C;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA,EAChD;AAAA,EAEA,sBAAsB,GAAA,EAA4B;AACjD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAiC,GAAG,GAAG,CAAA;AAAA,EACrD;AAAA,EAGA,IAAA,GAAmB;AAClB,IAAA,OAAO,QAAA,CAAQ,IAAA;AAAA,EAChB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,OAAA,EAAQ;AAC7B,IAAO,eAAA,GAAQ","file":"chunk-IKENWSRH.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 { Customer } from './customers'\nimport type { StockLocation, StockLocationType } from './stock_locations'\nimport type { Address } from './addresses'\nimport type { Capture, CaptureType } from './captures'\nimport type { Refund } from './refunds'\nimport type { ReturnLineItem } from './return_line_items'\nimport type { Attachment } from './attachments'\nimport type { ResourceError } from './resource_errors'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype ReturnType = 'returns'\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype CaptureRel = ResourceRel & { type: CaptureType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type ReturnSort = Pick<Return, 'id' | 'number' | 'status' | 'approved_at' | 'cancelled_at' | 'shipped_at' | 'rejected_at' | 'received_at' | 'refunded_at' | 'archived_at'> & ResourceSort\n// export type ReturnFilter = Pick<Return, 'id' | 'number' | 'status' | 'skus_count' | 'approved_at' | 'cancelled_at' | 'shipped_at' | 'rejected_at' | 'received_at' | 'refunded_at' | 'archived_at'> & ResourceFilter\n\n\ninterface Return extends Resource {\n\t\n\treadonly type: ReturnType\n\n\t/** \n\t * Unique identifier for the return.\n\t * @example ```\"#1234/R/001\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The return status. One of 'draft' (default), 'requested', 'approved', 'cancelled', 'shipped', 'rejected', 'received', or 'refunded'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received' | 'refunded'\n\t/** \n\t * The email address of the associated customer.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email?: string | null\n\t/** \n\t * The total number of SKUs in the return's line items. This can be useful to display a preview of the return content.\n\t * @example ```2```\n\t */\n\tskus_count?: number | null\n\t/** \n\t * Time at which the return was approved.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tapproved_at?: string | null\n\t/** \n\t * Time at which the return was cancelled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tcancelled_at?: string | null\n\t/** \n\t * Time at which the return was shipped.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tshipped_at?: string | null\n\t/** \n\t * Time at which the return was rejected.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trejected_at?: string | null\n\t/** \n\t * Time at which the return was received.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\treceived_at?: string | null\n\t/** \n\t * Time at which the return was refunded.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trefunded_at?: string | null\n\t/** \n\t * Time at which the resource has been archived.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tarchived_at?: string | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, in cents.\n\t * @example ```500```\n\t */\n\testimated_refund_amount_cents?: number | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, float.\n\t * @example ```5```\n\t */\n\testimated_refund_amount_float?: number | null\n\t/** \n\t * The amount to be refunded, estimated by associated return line items, formatted.\n\t * @example ```\"€5,00\"```\n\t */\n\tformatted_estimated_refund_amount?: string | null\n\n\torder?: Order | null\n\tcustomer?: Customer | null\n\tstock_location?: StockLocation | null\n\torigin_address?: Address | null\n\tdestination_address?: Address | null\n\treference_capture?: Capture | null\n\treference_refund?: Refund | null\n\treturn_line_items?: ReturnLineItem[] | null\n\tattachments?: Attachment[] | null\n\tresource_errors?: ResourceError[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ReturnCreate extends ResourceCreate {\n\t\n\torder: OrderRel\n\tstock_location?: StockLocationRel | null\n\treference_capture?: CaptureRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface ReturnUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Send this attribute if you want to activate this return.\n\t * @example ```true```\n\t */\n\t_request?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as approved.\n\t * @example ```true```\n\t */\n\t_approve?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as cancelled.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as shipped.\n\t * @example ```true```\n\t */\n\t_ship?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as rejected.\n\t * @example ```true```\n\t */\n\t_reject?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this return as received.\n\t * @example ```true```\n\t */\n\t_receive?: boolean | null\n\t/** \n\t * Send this attribute if you want to restock all of the return line items.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Send this attribute if you want to archive the return.\n\t * @example ```true```\n\t */\n\t_archive?: boolean | null\n\t/** \n\t * Send this attribute if you want to unarchive the return.\n\t * @example ```true```\n\t */\n\t_unarchive?: boolean | null\n\t/** \n\t * Send this attribute if you want to create a refund for this return.\n\t * @example ```true```\n\t */\n\t_refund?: boolean | null\n\t/** \n\t * Send this attribute as a value in cents to specify the amount to be refunded.\n\t * @example ```500```\n\t */\n\t_refund_amount_cents?: number | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tstock_location?: StockLocationRel | null\n\treference_capture?: CaptureRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Returns extends ApiResource<Return> {\n\n\tstatic readonly TYPE: ReturnType = 'returns' as const\n\n\tasync create(resource: ReturnCreate, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.create<ReturnCreate, Return>({ ...resource, type: Returns.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnUpdate, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ ...resource, type: Returns.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: Returns.TYPE } : id, options)\n\t}\n\n\tasync order(returnId: string | Return, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `returns/${_returnId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync customer(returnId: string | Return, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `returns/${_returnId}/customer`, params, options) as unknown as Customer\n\t}\n\n\tasync stock_location(returnId: string | Return, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `returns/${_returnId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync origin_address(returnId: string | Return, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `returns/${_returnId}/origin_address`, params, options) as unknown as Address\n\t}\n\n\tasync destination_address(returnId: string | Return, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Address>({ type: 'addresses' }, `returns/${_returnId}/destination_address`, params, options) as unknown as Address\n\t}\n\n\tasync reference_capture(returnId: string | Return, params?: QueryParamsRetrieve<Capture>, options?: ResourcesConfig): Promise<Capture> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Capture>({ type: 'captures' }, `returns/${_returnId}/reference_capture`, params, options) as unknown as Capture\n\t}\n\n\tasync reference_refund(returnId: string | Return, params?: QueryParamsRetrieve<Refund>, options?: ResourcesConfig): Promise<Refund> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Refund>({ type: 'refunds' }, `returns/${_returnId}/reference_refund`, params, options) as unknown as Refund\n\t}\n\n\tasync return_line_items(returnId: string | Return, params?: QueryParamsList<ReturnLineItem>, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<ReturnLineItem>({ type: 'return_line_items' }, `returns/${_returnId}/return_line_items`, params, options) as unknown as ListResponse<ReturnLineItem>\n\t}\n\n\tasync attachments(returnId: string | Return, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `returns/${_returnId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync resource_errors(returnId: string | Return, params?: QueryParamsList<ResourceError>, options?: ResourcesConfig): Promise<ListResponse<ResourceError>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<ResourceError>({ type: 'resource_errors' }, `returns/${_returnId}/resource_errors`, params, options) as unknown as ListResponse<ResourceError>\n\t}\n\n\tasync events(returnId: string | Return, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `returns/${_returnId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(returnId: string | Return, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `returns/${_returnId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(returnId: string | Return, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _returnId = (returnId as Return).id || returnId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `returns/${_returnId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _request(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _request: true }, params, options)\n\t}\n\n\tasync _approve(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _approve: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _cancel: true }, params, options)\n\t}\n\n\tasync _ship(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _ship: true }, params, options)\n\t}\n\n\tasync _reject(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _reject: true }, params, options)\n\t}\n\n\tasync _receive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _receive: true }, params, options)\n\t}\n\n\tasync _restock(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _restock: true }, params, options)\n\t}\n\n\tasync _archive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _archive: true }, params, options)\n\t}\n\n\tasync _unarchive(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _unarchive: true }, params, options)\n\t}\n\n\tasync _refund(id: string | Return, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _refund: true }, params, options)\n\t}\n\n\tasync _refund_amount_cents(id: string | Return, triggerValue: number, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _refund_amount_cents: triggerValue }, params, options)\n\t}\n\n\tasync _add_tags(id: string | Return, triggerValue: string, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Return, triggerValue: string, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\treturn this.resources.update<ReturnUpdate, Return>({ id: (typeof id === 'string')? id: id.id, type: Returns.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisReturn(resource: any): resource is Return {\n\t\treturn resource.type && (resource.type === Returns.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnRel {\n\t\treturn super.relationshipOneToOne<ReturnRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnRel[] {\n\t\treturn super.relationshipOneToMany<ReturnRel>(...ids)\n\t}\n\n\n\ttype(): ReturnType {\n\t\treturn Returns.TYPE\n\t}\n\n}\n\n\nconst instance = new Returns()\nexport default instance\n\nexport type { Returns, Return, ReturnCreate, ReturnUpdate, ReturnType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error.ts","../src/fetch.ts"],"names":["ErrorType","debug_default"],"mappings":";;;;;AAGA,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AACC,EAAAA,WAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,WAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,WAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,WAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA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UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAO,MAAM,KAAA;AAAA;AAGnB,EAAA,OAAO,YAAA;AAET","file":"chunk-IKHD5UQP.cjs","sourcesContent":["import { FetchError } from './fetch'\n\n\nenum ErrorType {\n\tCLIENT = 'client',\t\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n","\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
1
+ {"version":3,"sources":["../src/error.ts","../src/fetch.ts"],"names":["ErrorType","debug_default"],"mappings":";;;;;AAGA,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AACC,EAAAA,WAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,WAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,WAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,WAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA;AACP,EAAAA,WAAA,SAAA,CAAA,GAAU,SAAA;AACX,EAAAA,WAAA,eAAA,CAAA,GAAgB,eAAA;AAPZ,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAWL,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAE5B,OAAO,IAAA,GAAO,UAAA;AAAA,EAEd,OAAO,WAAW,KAAA,EAA+B;AAChD,IAAA,OAAO,SAAS,CAAC,SAAA,CAAS,IAAA,EAAM,QAAA,CAAS,IAAI,CAAA,CAAE,QAAA,CAAS,KAAA,CAAM,IAAc,KAAK,MAAA,CAAO,MAAA,CAAO,SAAS,CAAA,CAAE,QAAA,CAAS,MAAM,IAAiB,CAAA;AAAA,EAC3I;AAAA,EAEA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAY,KAAA,EAA8C;AACzD,IAAA,KAAA,CAAM,MAAM,OAAO,CAAA;AACnB,IAAA,IAAA,CAAK,OAAO,SAAA,CAAS,IAAA;AACrB,IAAA,IAAA,CAAK,IAAA,GAAO,MAAM,IAAA,IAAQ,QAAA;AAAA,EAC3B;AAED;AAGA,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AA,IAAA,KAAQ;AAAE,IAAA,KAAA,CAAM,gBAAgB,IAAI,CAAA;AAAG,IAAA,OAAO,IAAA;AAAA,EAAK,CAAC,CAAA,CACzD,KAAA,CAAM,CAAC,GAAA,KAAe;AACrB,IAAA,KAAA,CAAM,WAAA,EAAa,IAAI,OAAO,CAAA;AAC9B,IAAA,IAAI,QAAA,CAAS,IAAI,MAAM,IAAI,SAAS,EAAE,OAAA,EAAS,iCAAA,EAAmC,IAAA,EAAA,OAAA,cAAuB,CAAA;AAAA,EAC3G,CAAC,CAAA,GACC,MAAA;AAEJ,EAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,IAAA,IAAI,KAAA,GAAQ,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ,QAAA,CAAS,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAA,IAAI,YAAA,EAAc,UAAU,SAAA,EAAW,KAAA,GAAQ,MAAM,YAAA,CAAa,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAO,MAAM,KAAA;AAAA,EACnB;AAEA,EAAA,OAAO,YAAA;AAET","file":"chunk-IKHD5UQP.cjs","sourcesContent":["import { FetchError } from './fetch'\n\n\nenum ErrorType {\n\tCLIENT = 'client',\t\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n","\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/stripe_tax_accounts.ts"],"names":["ApiResource"],"mappings":";;;;;AA0FA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,qBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACtI,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,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Content":["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 { TaxCategory, TaxCategoryType } from './tax_categories'\n\n\ntype StripeTaxAccountType = 'stripe_tax_accounts'\ntype StripeTaxAccountRel = ResourceRel & { type: StripeTaxAccountType }\ntype TaxCategoryRel = ResourceRel & { type: TaxCategoryType }\n\n\nexport type StripeTaxAccountSort = Pick<StripeTaxAccount, 'id' | 'name'> & ResourceSort\n// export type StripeTaxAccountFilter = Pick<StripeTaxAccount, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeTaxAccount extends Resource {\n\t\n\treadonly type: StripeTaxAccountType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\ttax_categories?: TaxCategory[] | null\n\n}\n\n\ninterface StripeTaxAccountCreate 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\t/** \n\t * The Stripe account API key.\n\t * @example ```\"STRIPE_API_KEY\"```\n\t */\n\tapi_key: string\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\ninterface StripeTaxAccountUpdate 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\t/** \n\t * The Stripe account API key.\n\t * @example ```\"STRIPE_API_KEY\"```\n\t */\n\tapi_key?: string | null\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\nclass StripeTaxAccounts extends ApiResource<StripeTaxAccount> {\n\n\tstatic readonly TYPE: StripeTaxAccountType = 'stripe_tax_accounts' as const\n\n\tasync create(resource: StripeTaxAccountCreate, params?: QueryParamsRetrieve<StripeTaxAccount>, options?: ResourcesConfig): Promise<StripeTaxAccount> {\n\t\treturn this.resources.create<StripeTaxAccountCreate, StripeTaxAccount>({ ...resource, type: StripeTaxAccounts.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeTaxAccountUpdate, params?: QueryParamsRetrieve<StripeTaxAccount>, options?: ResourcesConfig): Promise<StripeTaxAccount> {\n\t\treturn this.resources.update<StripeTaxAccountUpdate, StripeTaxAccount>({ ...resource, type: StripeTaxAccounts.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: StripeTaxAccounts.TYPE } : id, options)\n\t}\n\n\tasync markets(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stripe_tax_accounts/${_stripeTaxAccountId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stripe_tax_accounts/${_stripeTaxAccountId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stripe_tax_accounts/${_stripeTaxAccountId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_tax_accounts/${_stripeTaxAccountId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync tax_categories(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<TaxCategory>, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<TaxCategory>({ type: 'tax_categories' }, `stripe_tax_accounts/${_stripeTaxAccountId}/tax_categories`, params, options) as unknown as ListResponse<TaxCategory>\n\t}\n\n\n\tisStripeTaxAccount(resource: any): resource is StripeTaxAccount {\n\t\treturn resource.type && (resource.type === StripeTaxAccounts.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeTaxAccountRel {\n\t\treturn super.relationshipOneToOne<StripeTaxAccountRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeTaxAccountRel[] {\n\t\treturn super.relationshipOneToMany<StripeTaxAccountRel>(...ids)\n\t}\n\n\n\ttype(): StripeTaxAccountType {\n\t\treturn StripeTaxAccounts.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeTaxAccounts()\nexport default instance\n\nexport type { StripeTaxAccounts, StripeTaxAccount, StripeTaxAccountCreate, StripeTaxAccountUpdate, StripeTaxAccountType }\n"]}
1
+ {"version":3,"sources":["../src/resources/stripe_tax_accounts.ts"],"names":["ApiResource"],"mappings":";;;;;AA0FA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,qBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,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,kBAAA,CAAkB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EACzG;AAAA,EAEA,MAAM,OAAA,CAAQ,kBAAA,EAA+C,MAAA,EAAkC,OAAA,EAA0D;AACxJ,IAAA,MAAM,mBAAA,GAAuB,mBAAwC,EAAA,IAAM,kBAAA;AAC3E,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAc,EAAE,IAAA,EAAM,SAAA,EAAU,EAA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,IAAA,EAAM,gBAAA,EAAiB,EAAG,CAAA,oBAAA,EAAuB,mBAAmB,CAAA,eAAA,CAAA,EAAmB,MAAA,EAAQ,OAAO,CAAA;AAAA,EAClJ;AAAA,EAGA,mBAAmB,QAAA,EAA6C;AAC/D,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,kBAAA,CAAkB,IAAA;AAAA,EAC9D;AAAA,EAGA,aAAa,EAAA,EAAqD;AACjE,IAAA,OAAO,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA,EAC1D;AAAA,EAEA,sBAAsB,GAAA,EAAsC;AAC3D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA2C,GAAG,GAAG,CAAA;AAAA,EAC/D;AAAA,EAGA,IAAA,GAA6B;AAC5B,IAAA,OAAO,kBAAA,CAAkB,IAAA;AAAA,EAC1B;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,iBAAA,EAAkB;AACvC,IAAO,2BAAA,GAAQ","file":"chunk-INJ7FRDA.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 { Market } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { TaxCategory, TaxCategoryType } from './tax_categories'\n\n\ntype StripeTaxAccountType = 'stripe_tax_accounts'\ntype StripeTaxAccountRel = ResourceRel & { type: StripeTaxAccountType }\ntype TaxCategoryRel = ResourceRel & { type: TaxCategoryType }\n\n\nexport type StripeTaxAccountSort = Pick<StripeTaxAccount, 'id' | 'name'> & ResourceSort\n// export type StripeTaxAccountFilter = Pick<StripeTaxAccount, 'id' | 'name'> & ResourceFilter\n\n\ninterface StripeTaxAccount extends Resource {\n\t\n\treadonly type: StripeTaxAccountType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\ttax_categories?: TaxCategory[] | null\n\n}\n\n\ninterface StripeTaxAccountCreate 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\t/** \n\t * The Stripe account API key.\n\t * @example ```\"STRIPE_API_KEY\"```\n\t */\n\tapi_key: string\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\ninterface StripeTaxAccountUpdate 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\t/** \n\t * The Stripe account API key.\n\t * @example ```\"STRIPE_API_KEY\"```\n\t */\n\tapi_key?: string | null\n\t/** \n\t * Indicates if the transaction will be recorded and visible on the Stripe website.\n\t * @example ```true```\n\t */\n\tcommit_invoice?: boolean | null\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\nclass StripeTaxAccounts extends ApiResource<StripeTaxAccount> {\n\n\tstatic readonly TYPE: StripeTaxAccountType = 'stripe_tax_accounts' as const\n\n\tasync create(resource: StripeTaxAccountCreate, params?: QueryParamsRetrieve<StripeTaxAccount>, options?: ResourcesConfig): Promise<StripeTaxAccount> {\n\t\treturn this.resources.create<StripeTaxAccountCreate, StripeTaxAccount>({ ...resource, type: StripeTaxAccounts.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StripeTaxAccountUpdate, params?: QueryParamsRetrieve<StripeTaxAccount>, options?: ResourcesConfig): Promise<StripeTaxAccount> {\n\t\treturn this.resources.update<StripeTaxAccountUpdate, StripeTaxAccount>({ ...resource, type: StripeTaxAccounts.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: StripeTaxAccounts.TYPE } : id, options)\n\t}\n\n\tasync markets(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `stripe_tax_accounts/${_stripeTaxAccountId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `stripe_tax_accounts/${_stripeTaxAccountId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `stripe_tax_accounts/${_stripeTaxAccountId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stripe_tax_accounts/${_stripeTaxAccountId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync tax_categories(stripeTaxAccountId: string | StripeTaxAccount, params?: QueryParamsList<TaxCategory>, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>> {\n\t\tconst _stripeTaxAccountId = (stripeTaxAccountId as StripeTaxAccount).id || stripeTaxAccountId as string\n\t\treturn this.resources.fetch<TaxCategory>({ type: 'tax_categories' }, `stripe_tax_accounts/${_stripeTaxAccountId}/tax_categories`, params, options) as unknown as ListResponse<TaxCategory>\n\t}\n\n\n\tisStripeTaxAccount(resource: any): resource is StripeTaxAccount {\n\t\treturn resource.type && (resource.type === StripeTaxAccounts.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StripeTaxAccountRel {\n\t\treturn super.relationshipOneToOne<StripeTaxAccountRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StripeTaxAccountRel[] {\n\t\treturn super.relationshipOneToMany<StripeTaxAccountRel>(...ids)\n\t}\n\n\n\ttype(): StripeTaxAccountType {\n\t\treturn StripeTaxAccounts.TYPE\n\t}\n\n}\n\n\nconst instance = new StripeTaxAccounts()\nexport default instance\n\nexport type { StripeTaxAccounts, StripeTaxAccount, StripeTaxAccountCreate, StripeTaxAccountUpdate, StripeTaxAccountType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/stock_line_items.ts"],"names":["ApiResource"],"mappings":";;;;;AAyHA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,6BAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0B,kBAAA;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,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eAAA,CAAe,IAAA,EAAM,gBAAgB,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC/K,EAEA,MAAM,cAAA,CAAe,EAAA,EAA4B,MAAA,EAA6C,OAAA,EAAmD;AAChJ,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,gBAAgB,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC/K,EAEA,MAAM,gBAAA,CAAiB,EAAA,EAA4B,MAAA,EAA6C,OAAA,EAAmD;AAClJ,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,kBAAkB,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjL,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,wBAAA,GAAQ","file":"chunk-J4CTOHX6.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 { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { Sku, SkuType } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype StockLineItemType = 'stock_line_items'\ntype StockLineItemRel = ResourceRel & { type: StockLineItemType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\ntype SkuRel = ResourceRel & { type: SkuType }\n\n\nexport type StockLineItemSort = Pick<StockLineItem, 'id' | 'quantity'> & ResourceSort\n// export type StockLineItemFilter = Pick<StockLineItem, 'id' | 'sku_code' | 'quantity'> & ResourceFilter\n\n\ninterface StockLineItem extends Resource {\n\t\n\treadonly type: StockLineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The internal name of the associated line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservation?: StockReservation | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\tstock_item?: StockItemRel | null\n\tsku?: SkuRel | null\n\n}\n\n\ninterface StockLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * Send this attribute if you want to automatically destroy the stock reservation for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_release_stock?: boolean | null\n\t/** \n\t * Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_decrement_stock?: boolean | null\n\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\tstock_item?: StockItemRel | null\n\tsku?: SkuRel | null\n\n}\n\n\nclass StockLineItems extends ApiResource<StockLineItem> {\n\n\tstatic readonly TYPE: StockLineItemType = 'stock_line_items' as const\n\n\tasync create(resource: StockLineItemCreate, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.create<StockLineItemCreate, StockLineItem>({ ...resource, type: StockLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockLineItemUpdate, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ ...resource, type: StockLineItems.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: StockLineItems.TYPE } : id, options)\n\t}\n\n\tasync shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_line_items/${_stockLineItemId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_line_items/${_stockLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservation(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_line_items/${_stockLineItemId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _reserve_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _release_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options)\n\t}\n\n\tasync _decrement_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options)\n\t}\n\n\n\tisStockLineItem(resource: any): resource is StockLineItem {\n\t\treturn resource.type && (resource.type === StockLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockLineItemRel {\n\t\treturn super.relationshipOneToOne<StockLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockLineItemRel[] {\n\t\treturn super.relationshipOneToMany<StockLineItemRel>(...ids)\n\t}\n\n\n\ttype(): StockLineItemType {\n\t\treturn StockLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new StockLineItems()\nexport default instance\n\nexport type { StockLineItems, StockLineItem, StockLineItemCreate, StockLineItemUpdate, StockLineItemType }\n"]}
1
+ {"version":3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AA,CAAe,IAAA;AAAA,EAC3D;AAAA,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA,EACvD;AAAA,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA,EAC5D;AAAA,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA,EACvB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,wBAAA,GAAQ","file":"chunk-J4CTOHX6.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 { Shipment, ShipmentType } from './shipments'\nimport type { LineItem, LineItemType } from './line_items'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { Sku, SkuType } from './skus'\nimport type { StockReservation } from './stock_reservations'\nimport type { Version } from './versions'\n\n\ntype StockLineItemType = 'stock_line_items'\ntype StockLineItemRel = ResourceRel & { type: StockLineItemType }\ntype ShipmentRel = ResourceRel & { type: ShipmentType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\ntype SkuRel = ResourceRel & { type: SkuType }\n\n\nexport type StockLineItemSort = Pick<StockLineItem, 'id' | 'quantity'> & ResourceSort\n// export type StockLineItemFilter = Pick<StockLineItem, 'id' | 'sku_code' | 'quantity'> & ResourceFilter\n\n\ninterface StockLineItem extends Resource {\n\t\n\treadonly type: StockLineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The internal name of the associated line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\n\tshipment?: Shipment | null\n\tline_item?: LineItem | null\n\tstock_item?: StockItem | null\n\tsku?: Sku | null\n\tstock_reservation?: StockReservation | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface StockLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\tstock_item?: StockItemRel | null\n\tsku?: SkuRel | null\n\n}\n\n\ninterface StockLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reserve_stock?: boolean | null\n\t/** \n\t * Send this attribute if you want to automatically destroy the stock reservation for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_release_stock?: boolean | null\n\t/** \n\t * Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_decrement_stock?: boolean | null\n\n\tshipment?: ShipmentRel | null\n\tline_item?: LineItemRel | null\n\tstock_item?: StockItemRel | null\n\tsku?: SkuRel | null\n\n}\n\n\nclass StockLineItems extends ApiResource<StockLineItem> {\n\n\tstatic readonly TYPE: StockLineItemType = 'stock_line_items' as const\n\n\tasync create(resource: StockLineItemCreate, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.create<StockLineItemCreate, StockLineItem>({ ...resource, type: StockLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockLineItemUpdate, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ ...resource, type: StockLineItems.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: StockLineItems.TYPE } : id, options)\n\t}\n\n\tasync shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<Shipment>, options?: ResourcesConfig): Promise<Shipment> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Shipment>({ type: 'shipments' }, `stock_line_items/${_stockLineItemId}/shipment`, params, options) as unknown as Shipment\n\t}\n\n\tasync line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_line_items/${_stockLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync stock_reservation(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `stock_line_items/${_stockLineItemId}/stock_reservation`, params, options) as unknown as StockReservation\n\t}\n\n\tasync versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _stockLineItemId = (stockLineItemId as StockLineItem).id || stockLineItemId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _reserve_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options)\n\t}\n\n\tasync _release_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options)\n\t}\n\n\tasync _decrement_stock(id: string | StockLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\treturn this.resources.update<StockLineItemUpdate, StockLineItem>({ id: (typeof id === 'string')? id: id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options)\n\t}\n\n\n\tisStockLineItem(resource: any): resource is StockLineItem {\n\t\treturn resource.type && (resource.type === StockLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockLineItemRel {\n\t\treturn super.relationshipOneToOne<StockLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockLineItemRel[] {\n\t\treturn super.relationshipOneToMany<StockLineItemRel>(...ids)\n\t}\n\n\n\ttype(): StockLineItemType {\n\t\treturn StockLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new StockLineItems()\nexport default instance\n\nexport type { StockLineItems, StockLineItem, StockLineItemCreate, StockLineItemUpdate, StockLineItemType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/order_subscriptions.ts"],"names":["ApiResource"],"mappings":";;;;;AAmOA,IAAM,kBAAA,GAAN,MAAM,mBAAA,SAA2BA,6BAAA,CAA+B;AAAA,EAE/D,OAAgB,IAAA,GAA8B,qBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAA,EAAmC,MAAA,EAAiD,OAAA,EAAuD;AACvJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAA,CAAmB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,EAEA,MAAM,MAAA,CAAO,QAAA,EAAmC,MAAA,EAAiD,OAAA,EAAuD;AACvJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAA,CAAmB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAA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,CAAmB,IAAA,EAAM,UAAU,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAEA,MAAM,SAAA,CAAU,EAAA,EAAgC,YAAA,EAAsB,QAAiD,OAAA,EAAuD;AAC7K,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,EAAA,EAAK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,mBAAA,CAAmB,IAAA,EAAM,WAAW,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC9L,EAEA,MAAM,YAAA,CAAa,EAAA,EAAgC,YAAA,EAAsB,QAAiD,OAAA,EAAuD;AAChL,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,EAAA,EAAK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,mBAAA,CAAmB,IAAA,EAAM,cAAc,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjM,EAGA,oBAAoB,QAAA,EAA8C;AACjE,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,mBAAA,CAAmB,IAAA;AAAA;AAC/D,EAGA,aAAa,EAAA,EAAsD;AAClE,IAAA,OAAO,KAAA,CAAM,qBAA2C,EAAE,CAAA;AAAA;AAC3D,EAEA,sBAAsB,GAAA,EAAuC;AAC5D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA4C,GAAG,GAAG,CAAA;AAAA;AAChE,EAGA,IAAA,GAA8B;AAC7B,IAAA,OAAO,mBAAA,CAAmB,IAAA;AAAA;AAG5B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,kBAAA,EAAmB;AACxC,IAAO,2BAAA,GAAQ","file":"chunk-J6NBJHWL.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 { Market, MarketType } from './markets'\nimport type { SubscriptionModel } from './subscription_models'\nimport type { Order, OrderType } from './orders'\nimport type { Customer } from './customers'\nimport type { CustomerPaymentSource, CustomerPaymentSourceType } from './customer_payment_sources'\nimport type { OrderSubscriptionItem } from './order_subscription_items'\nimport type { OrderFactory } from './order_factories'\nimport type { RecurringOrderCopy } from './recurring_order_copies'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype OrderSubscriptionType = 'order_subscriptions'\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype TagRel = ResourceRel & { type: TagType }\ntype CustomerPaymentSourceRel = ResourceRel & { type: CustomerPaymentSourceType }\n\n\nexport type OrderSubscriptionSort = Pick<OrderSubscription, 'id' | 'number' | 'status' | 'frequency' | 'starts_at' | 'expires_at' | 'last_run_at' | 'next_run_at' | 'occurrencies' | 'errors_count' | 'succeeded_on_last_run'> & ResourceSort\n// export type OrderSubscriptionFilter = Pick<OrderSubscription, 'id' | 'number' | 'status' | 'frequency' | 'customer_email' | 'starts_at' | 'expires_at' | 'last_run_at' | 'next_run_at' | 'occurrencies' | 'errors_count' | 'succeeded_on_last_run'> & ResourceFilter\n\n\ninterface OrderSubscription extends Resource {\n\t\n\treadonly type: OrderSubscriptionType\n\n\t/** \n\t * Unique identifier for the subscription (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The subscription status. One of 'draft' (default), 'inactive', 'active', 'running', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'inactive' | 'active' | 'running' | 'cancelled'\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency: string\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The email address of the customer, if any, associated to the source order.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email?: string | null\n\t/** \n\t * The activation date/time of this subscription.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The date/time of the subscription last run.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tlast_run_at?: string | null\n\t/** \n\t * The date/time of the subscription next run. Can be updated but only in the future, to copy with frequency changes.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tnext_run_at?: string | null\n\t/** \n\t * The number of times this subscription has run.\n\t * @example ```2```\n\t */\n\toccurrencies?: number | null\n\t/** \n\t * Indicates the number of subscription errors, if any.\n\t * @example ```3```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the subscription has succeeded on its last run.\n\t * @example ```true```\n\t */\n\tsucceeded_on_last_run?: boolean | null\n\n\tmarket?: Market | null\n\tsubscription_model?: SubscriptionModel | null\n\tsource_order?: Order | null\n\tcustomer?: Customer | null\n\tcustomer_payment_source?: CustomerPaymentSource | null\n\torder_subscription_items?: OrderSubscriptionItem[] | null\n\torder_factories?: OrderFactory[] | null\n\trecurring_order_copies?: RecurringOrderCopy[] | null\n\torders?: Order[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface OrderSubscriptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency: string\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The activation date/time of this subscription.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\n\tmarket?: MarketRel | null\n\tsource_order: OrderRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface OrderSubscriptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The date/time of the subscription next run. Can be updated but only in the future, to copy with frequency changes.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tnext_run_at?: string | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as active.\n\t * @example ```true```\n\t */\n\t_activate?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as inactive.\n\t * @example ```true```\n\t */\n\t_deactivate?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as cancelled.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\t/** \n\t * Send this attribute if you want to convert a manual subscription to an automatic one. A subscription model is required before conversion.\n\t * @example ```true```\n\t */\n\t_convert?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcustomer_payment_source?: CustomerPaymentSourceRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass OrderSubscriptions extends ApiResource<OrderSubscription> {\n\n\tstatic readonly TYPE: OrderSubscriptionType = 'order_subscriptions' as const\n\n\tasync create(resource: OrderSubscriptionCreate, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.create<OrderSubscriptionCreate, OrderSubscription>({ ...resource, type: OrderSubscriptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: OrderSubscriptionUpdate, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ ...resource, type: OrderSubscriptions.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: OrderSubscriptions.TYPE } : id, options)\n\t}\n\n\tasync market(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `order_subscriptions/${_orderSubscriptionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync subscription_model(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<SubscriptionModel>, options?: ResourcesConfig): Promise<SubscriptionModel> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<SubscriptionModel>({ type: 'subscription_models' }, `order_subscriptions/${_orderSubscriptionId}/subscription_model`, params, options) as unknown as SubscriptionModel\n\t}\n\n\tasync source_order(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_subscriptions/${_orderSubscriptionId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync customer(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `order_subscriptions/${_orderSubscriptionId}/customer`, params, options) as unknown as Customer\n\t}\n\n\tasync customer_payment_source(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<CustomerPaymentSource>, options?: ResourcesConfig): Promise<CustomerPaymentSource> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<CustomerPaymentSource>({ type: 'customer_payment_sources' }, `order_subscriptions/${_orderSubscriptionId}/customer_payment_source`, params, options) as unknown as CustomerPaymentSource\n\t}\n\n\tasync order_subscription_items(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<OrderSubscriptionItem>, options?: ResourcesConfig): Promise<ListResponse<OrderSubscriptionItem>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<OrderSubscriptionItem>({ type: 'order_subscription_items' }, `order_subscriptions/${_orderSubscriptionId}/order_subscription_items`, params, options) as unknown as ListResponse<OrderSubscriptionItem>\n\t}\n\n\tasync order_factories(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<OrderFactory>, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<OrderFactory>({ type: 'order_factories' }, `order_subscriptions/${_orderSubscriptionId}/order_factories`, params, options) as unknown as ListResponse<OrderFactory>\n\t}\n\n\tasync recurring_order_copies(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<RecurringOrderCopy>, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<RecurringOrderCopy>({ type: 'recurring_order_copies' }, `order_subscriptions/${_orderSubscriptionId}/recurring_order_copies`, params, options) as unknown as ListResponse<RecurringOrderCopy>\n\t}\n\n\tasync orders(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_subscriptions/${_orderSubscriptionId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync events(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `order_subscriptions/${_orderSubscriptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `order_subscriptions/${_orderSubscriptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `order_subscriptions/${_orderSubscriptionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _activate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _activate: true }, params, options)\n\t}\n\n\tasync _deactivate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _deactivate: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _cancel: true }, params, options)\n\t}\n\n\tasync _convert(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _convert: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | OrderSubscription, triggerValue: string, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | OrderSubscription, triggerValue: string, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisOrderSubscription(resource: any): resource is OrderSubscription {\n\t\treturn resource.type && (resource.type === OrderSubscriptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): OrderSubscriptionRel {\n\t\treturn super.relationshipOneToOne<OrderSubscriptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): OrderSubscriptionRel[] {\n\t\treturn super.relationshipOneToMany<OrderSubscriptionRel>(...ids)\n\t}\n\n\n\ttype(): OrderSubscriptionType {\n\t\treturn OrderSubscriptions.TYPE\n\t}\n\n}\n\n\nconst instance = new OrderSubscriptions()\nexport default instance\n\nexport type { OrderSubscriptions, OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate, OrderSubscriptionType }\n"]}
1
+ {"version":3,"sources":["../src/resources/order_subscriptions.ts"],"names":["ApiResource"],"mappings":";;;;;AAmOA,IAAM,kBAAA,GAAN,MAAM,mBAAA,SAA2BA,6BAAA,CAA+B;AAAA,EAE/D,OAAgB,IAAA,GAA8B,qBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAA,EAAmC,MAAA,EAAiD,OAAA,EAAuD;AACvJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAA,CAAmB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACzI;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAmC,MAAA,EAAiD,OAAA,EAAuD;AACvJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAA,CAAmB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACzI;AAAA,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,mBAAA,CAAmB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EAC1G;AAAA,EAEA,MAAM,MAAA,CAAO,mBAAA,EAAiD,MAAA,EAAsC,OAAA,EAA4C;AAC/I,IAAA,MAAM,oBAAA,GAAwB,oBAA0C,EAAA,IAAM,mBAAA;AAC9E,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAc,EAAE,IAAA,EAAM,SAAA,EAAU,EAAG,CAAA,oBAAA,EAAuB,oBAAo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,CAAmB,IAAA,EAAM,WAAW,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA,EAC9L;AAAA,EAEA,MAAM,YAAA,CAAa,EAAA,EAAgC,YAAA,EAAsB,QAAiD,OAAA,EAAuD;AAChL,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA,CAAmD,EAAE,EAAA,EAAK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,mBAAA,CAAmB,IAAA,EAAM,cAAc,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA,EACjM;AAAA,EAGA,oBAAoB,QAAA,EAA8C;AACjE,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,mBAAA,CAAmB,IAAA;AAAA,EAC/D;AAAA,EAGA,aAAa,EAAA,EAAsD;AAClE,IAAA,OAAO,KAAA,CAAM,qBAA2C,EAAE,CAAA;AAAA,EAC3D;AAAA,EAEA,sBAAsB,GAAA,EAAuC;AAC5D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA4C,GAAG,GAAG,CAAA;AAAA,EAChE;AAAA,EAGA,IAAA,GAA8B;AAC7B,IAAA,OAAO,mBAAA,CAAmB,IAAA;AAAA,EAC3B;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,kBAAA,EAAmB;AACxC,IAAO,2BAAA,GAAQ","file":"chunk-J6NBJHWL.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 { Market, MarketType } from './markets'\nimport type { SubscriptionModel } from './subscription_models'\nimport type { Order, OrderType } from './orders'\nimport type { Customer } from './customers'\nimport type { CustomerPaymentSource, CustomerPaymentSourceType } from './customer_payment_sources'\nimport type { OrderSubscriptionItem } from './order_subscription_items'\nimport type { OrderFactory } from './order_factories'\nimport type { RecurringOrderCopy } from './recurring_order_copies'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype OrderSubscriptionType = 'order_subscriptions'\ntype OrderSubscriptionRel = ResourceRel & { type: OrderSubscriptionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderRel = ResourceRel & { type: OrderType }\ntype TagRel = ResourceRel & { type: TagType }\ntype CustomerPaymentSourceRel = ResourceRel & { type: CustomerPaymentSourceType }\n\n\nexport type OrderSubscriptionSort = Pick<OrderSubscription, 'id' | 'number' | 'status' | 'frequency' | 'starts_at' | 'expires_at' | 'last_run_at' | 'next_run_at' | 'occurrencies' | 'errors_count' | 'succeeded_on_last_run'> & ResourceSort\n// export type OrderSubscriptionFilter = Pick<OrderSubscription, 'id' | 'number' | 'status' | 'frequency' | 'customer_email' | 'starts_at' | 'expires_at' | 'last_run_at' | 'next_run_at' | 'occurrencies' | 'errors_count' | 'succeeded_on_last_run'> & ResourceFilter\n\n\ninterface OrderSubscription extends Resource {\n\t\n\treadonly type: OrderSubscriptionType\n\n\t/** \n\t * Unique identifier for the subscription (numeric).\n\t * @example ```\"1234\"```\n\t */\n\tnumber?: string | null\n\t/** \n\t * The subscription status. One of 'draft' (default), 'inactive', 'active', 'running', or 'cancelled'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'inactive' | 'active' | 'running' | 'cancelled'\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency: string\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The email address of the customer, if any, associated to the source order.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email?: string | null\n\t/** \n\t * The activation date/time of this subscription.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The date/time of the subscription last run.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tlast_run_at?: string | null\n\t/** \n\t * The date/time of the subscription next run. Can be updated but only in the future, to copy with frequency changes.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tnext_run_at?: string | null\n\t/** \n\t * The number of times this subscription has run.\n\t * @example ```2```\n\t */\n\toccurrencies?: number | null\n\t/** \n\t * Indicates the number of subscription errors, if any.\n\t * @example ```3```\n\t */\n\terrors_count?: number | null\n\t/** \n\t * Indicates if the subscription has succeeded on its last run.\n\t * @example ```true```\n\t */\n\tsucceeded_on_last_run?: boolean | null\n\n\tmarket?: Market | null\n\tsubscription_model?: SubscriptionModel | null\n\tsource_order?: Order | null\n\tcustomer?: Customer | null\n\tcustomer_payment_source?: CustomerPaymentSource | null\n\torder_subscription_items?: OrderSubscriptionItem[] | null\n\torder_factories?: OrderFactory[] | null\n\trecurring_order_copies?: RecurringOrderCopy[] | null\n\torders?: Order[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface OrderSubscriptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency: string\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The activation date/time of this subscription.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\n\tmarket?: MarketRel | null\n\tsource_order: OrderRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface OrderSubscriptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The frequency of the subscription. Use one of the supported within 'hourly', 'daily', 'weekly', 'monthly', 'two-month', 'three-month', 'four-month', 'six-month', 'yearly', or provide your custom crontab expression (min unit is hour). Must be supported by existing associated subscription_model.\n\t * @example ```\"monthly\"```\n\t */\n\tfrequency?: string | null\n\t/** \n\t * Indicates if the subscription will be activated considering the placed source order as its first run.\n\t * @example ```true```\n\t */\n\tactivate_by_source_order?: boolean | null\n\t/** \n\t * Indicates if the subscription created orders are automatically placed at the end of the copy.\n\t * @example ```true```\n\t */\n\tplace_target_order?: boolean | null\n\t/** \n\t * Indicates the number of hours the renewal alert will be triggered before the subscription next run. Must be included between 1 and 720 hours.\n\t * @example ```1```\n\t */\n\trenewal_alert_period?: number | null\n\t/** \n\t * The expiration date/time of this subscription (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The date/time of the subscription next run. Can be updated but only in the future, to copy with frequency changes.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tnext_run_at?: string | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as active.\n\t * @example ```true```\n\t */\n\t_activate?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as inactive.\n\t * @example ```true```\n\t */\n\t_deactivate?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this subscription as cancelled.\n\t * @example ```true```\n\t */\n\t_cancel?: boolean | null\n\t/** \n\t * Send this attribute if you want to convert a manual subscription to an automatic one. A subscription model is required before conversion.\n\t * @example ```true```\n\t */\n\t_convert?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcustomer_payment_source?: CustomerPaymentSourceRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass OrderSubscriptions extends ApiResource<OrderSubscription> {\n\n\tstatic readonly TYPE: OrderSubscriptionType = 'order_subscriptions' as const\n\n\tasync create(resource: OrderSubscriptionCreate, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.create<OrderSubscriptionCreate, OrderSubscription>({ ...resource, type: OrderSubscriptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: OrderSubscriptionUpdate, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ ...resource, type: OrderSubscriptions.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: OrderSubscriptions.TYPE } : id, options)\n\t}\n\n\tasync market(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `order_subscriptions/${_orderSubscriptionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync subscription_model(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<SubscriptionModel>, options?: ResourcesConfig): Promise<SubscriptionModel> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<SubscriptionModel>({ type: 'subscription_models' }, `order_subscriptions/${_orderSubscriptionId}/subscription_model`, params, options) as unknown as SubscriptionModel\n\t}\n\n\tasync source_order(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_subscriptions/${_orderSubscriptionId}/source_order`, params, options) as unknown as Order\n\t}\n\n\tasync customer(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `order_subscriptions/${_orderSubscriptionId}/customer`, params, options) as unknown as Customer\n\t}\n\n\tasync customer_payment_source(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsRetrieve<CustomerPaymentSource>, options?: ResourcesConfig): Promise<CustomerPaymentSource> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<CustomerPaymentSource>({ type: 'customer_payment_sources' }, `order_subscriptions/${_orderSubscriptionId}/customer_payment_source`, params, options) as unknown as CustomerPaymentSource\n\t}\n\n\tasync order_subscription_items(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<OrderSubscriptionItem>, options?: ResourcesConfig): Promise<ListResponse<OrderSubscriptionItem>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<OrderSubscriptionItem>({ type: 'order_subscription_items' }, `order_subscriptions/${_orderSubscriptionId}/order_subscription_items`, params, options) as unknown as ListResponse<OrderSubscriptionItem>\n\t}\n\n\tasync order_factories(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<OrderFactory>, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<OrderFactory>({ type: 'order_factories' }, `order_subscriptions/${_orderSubscriptionId}/order_factories`, params, options) as unknown as ListResponse<OrderFactory>\n\t}\n\n\tasync recurring_order_copies(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<RecurringOrderCopy>, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<RecurringOrderCopy>({ type: 'recurring_order_copies' }, `order_subscriptions/${_orderSubscriptionId}/recurring_order_copies`, params, options) as unknown as ListResponse<RecurringOrderCopy>\n\t}\n\n\tasync orders(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Order>, options?: ResourcesConfig): Promise<ListResponse<Order>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `order_subscriptions/${_orderSubscriptionId}/orders`, params, options) as unknown as ListResponse<Order>\n\t}\n\n\tasync events(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `order_subscriptions/${_orderSubscriptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `order_subscriptions/${_orderSubscriptionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _orderSubscriptionId = (orderSubscriptionId as OrderSubscription).id || orderSubscriptionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `order_subscriptions/${_orderSubscriptionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _activate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _activate: true }, params, options)\n\t}\n\n\tasync _deactivate(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _deactivate: true }, params, options)\n\t}\n\n\tasync _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _cancel: true }, params, options)\n\t}\n\n\tasync _convert(id: string | OrderSubscription, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _convert: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | OrderSubscription, triggerValue: string, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | OrderSubscription, triggerValue: string, params?: QueryParamsRetrieve<OrderSubscription>, options?: ResourcesConfig): Promise<OrderSubscription> {\n\t\treturn this.resources.update<OrderSubscriptionUpdate, OrderSubscription>({ id: (typeof id === 'string')? id: id.id, type: OrderSubscriptions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisOrderSubscription(resource: any): resource is OrderSubscription {\n\t\treturn resource.type && (resource.type === OrderSubscriptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): OrderSubscriptionRel {\n\t\treturn super.relationshipOneToOne<OrderSubscriptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): OrderSubscriptionRel[] {\n\t\treturn super.relationshipOneToMany<OrderSubscriptionRel>(...ids)\n\t}\n\n\n\ttype(): OrderSubscriptionType {\n\t\treturn OrderSubscriptions.TYPE\n\t}\n\n}\n\n\nconst instance = new OrderSubscriptions()\nexport default instance\n\nexport type { OrderSubscriptions, OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate, OrderSubscriptionType }\n"]}