@commercelayer/sdk 7.0.0-rc.2 → 7.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/README.md +2 -1
  2. package/lib/{api-DDgIE2i8.d.ts → api-F1F37Dud.d.ts} +27 -8
  3. package/lib/{api-DmIZO_Np.d.cts → api-IwWtsAqE.d.cts} +27 -8
  4. package/lib/api.d.cts +2 -2
  5. package/lib/api.d.ts +2 -2
  6. package/lib/bundle.cjs +568 -0
  7. package/lib/bundle.cjs.map +1 -0
  8. package/lib/bundle.d.cts +145 -0
  9. package/lib/bundle.d.ts +145 -0
  10. package/lib/bundle.js +546 -0
  11. package/lib/bundle.js.map +1 -0
  12. package/lib/client.d.cts +1 -1
  13. package/lib/client.d.ts +1 -1
  14. package/lib/commercelayer.cjs +2 -1
  15. package/lib/commercelayer.cjs.map +1 -1
  16. package/lib/commercelayer.d.cts +5 -6
  17. package/lib/commercelayer.d.ts +5 -6
  18. package/lib/commercelayer.js +2 -2
  19. package/lib/commercelayer.js.map +1 -1
  20. package/lib/config.d.cts +1 -1
  21. package/lib/config.d.ts +1 -1
  22. package/lib/enum.d.cts +2 -2
  23. package/lib/enum.d.ts +2 -2
  24. package/lib/error.cjs.map +1 -1
  25. package/lib/error.js.map +1 -1
  26. package/lib/fetch.cjs +2 -0
  27. package/lib/fetch.cjs.map +1 -1
  28. package/lib/fetch.d.cts +1 -1
  29. package/lib/fetch.d.ts +1 -1
  30. package/lib/fetch.js +2 -0
  31. package/lib/fetch.js.map +1 -1
  32. package/lib/index.d.cts +2 -2
  33. package/lib/index.d.ts +2 -2
  34. package/lib/{interceptor-5MISI1yn.d.cts → interceptor-k15jXzf0.d.cts} +3 -2
  35. package/lib/{interceptor-5MISI1yn.d.ts → interceptor-k15jXzf0.d.ts} +3 -2
  36. package/lib/interceptor.d.cts +1 -1
  37. package/lib/interceptor.d.ts +1 -1
  38. package/lib/jsonapi.d.cts +2 -2
  39. package/lib/jsonapi.d.ts +2 -2
  40. package/lib/model.d.cts +2 -2
  41. package/lib/model.d.ts +2 -2
  42. package/lib/query.d.cts +2 -2
  43. package/lib/query.d.ts +2 -2
  44. package/lib/resource.cjs +7 -6
  45. package/lib/resource.cjs.map +1 -1
  46. package/lib/resource.d.cts +2 -2
  47. package/lib/resource.d.ts +2 -2
  48. package/lib/resource.js +7 -6
  49. package/lib/resource.js.map +1 -1
  50. package/lib/resources/addresses.cjs.map +1 -1
  51. package/lib/resources/addresses.d.cts +2 -2
  52. package/lib/resources/addresses.d.ts +2 -2
  53. package/lib/resources/addresses.js.map +1 -1
  54. package/lib/resources/adjustments.cjs.map +1 -1
  55. package/lib/resources/adjustments.d.cts +2 -2
  56. package/lib/resources/adjustments.d.ts +2 -2
  57. package/lib/resources/adjustments.js.map +1 -1
  58. package/lib/resources/adyen_gateways.cjs.map +1 -1
  59. package/lib/resources/adyen_gateways.d.cts +2 -2
  60. package/lib/resources/adyen_gateways.d.ts +2 -2
  61. package/lib/resources/adyen_gateways.js.map +1 -1
  62. package/lib/resources/adyen_payments.cjs.map +1 -1
  63. package/lib/resources/adyen_payments.d.cts +2 -2
  64. package/lib/resources/adyen_payments.d.ts +2 -2
  65. package/lib/resources/adyen_payments.js.map +1 -1
  66. package/lib/resources/applications.cjs.map +1 -1
  67. package/lib/resources/applications.d.cts +2 -2
  68. package/lib/resources/applications.d.ts +2 -2
  69. package/lib/resources/applications.js.map +1 -1
  70. package/lib/resources/attachments.cjs.map +1 -1
  71. package/lib/resources/attachments.d.cts +2 -2
  72. package/lib/resources/attachments.d.ts +2 -2
  73. package/lib/resources/attachments.js.map +1 -1
  74. package/lib/resources/authorizations.cjs.map +1 -1
  75. package/lib/resources/authorizations.d.cts +2 -2
  76. package/lib/resources/authorizations.d.ts +2 -2
  77. package/lib/resources/authorizations.js.map +1 -1
  78. package/lib/resources/avalara_accounts.cjs.map +1 -1
  79. package/lib/resources/avalara_accounts.d.cts +2 -2
  80. package/lib/resources/avalara_accounts.d.ts +2 -2
  81. package/lib/resources/avalara_accounts.js.map +1 -1
  82. package/lib/resources/axerve_gateways.cjs.map +1 -1
  83. package/lib/resources/axerve_gateways.d.cts +2 -2
  84. package/lib/resources/axerve_gateways.d.ts +2 -2
  85. package/lib/resources/axerve_gateways.js.map +1 -1
  86. package/lib/resources/axerve_payments.cjs.map +1 -1
  87. package/lib/resources/axerve_payments.d.cts +2 -2
  88. package/lib/resources/axerve_payments.d.ts +2 -2
  89. package/lib/resources/axerve_payments.js.map +1 -1
  90. package/lib/resources/bing_geocoders.cjs.map +1 -1
  91. package/lib/resources/bing_geocoders.d.cts +2 -2
  92. package/lib/resources/bing_geocoders.d.ts +2 -2
  93. package/lib/resources/bing_geocoders.js.map +1 -1
  94. package/lib/resources/braintree_gateways.cjs.map +1 -1
  95. package/lib/resources/braintree_gateways.d.cts +2 -2
  96. package/lib/resources/braintree_gateways.d.ts +2 -2
  97. package/lib/resources/braintree_gateways.js.map +1 -1
  98. package/lib/resources/braintree_payments.cjs.map +1 -1
  99. package/lib/resources/braintree_payments.d.cts +2 -2
  100. package/lib/resources/braintree_payments.d.ts +2 -2
  101. package/lib/resources/braintree_payments.js.map +1 -1
  102. package/lib/resources/bundles.cjs.map +1 -1
  103. package/lib/resources/bundles.d.cts +2 -2
  104. package/lib/resources/bundles.d.ts +2 -2
  105. package/lib/resources/bundles.js.map +1 -1
  106. package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -1
  107. package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
  108. package/lib/resources/buy_x_pay_y_promotions.d.ts +2 -2
  109. package/lib/resources/buy_x_pay_y_promotions.js.map +1 -1
  110. package/lib/resources/captures.cjs.map +1 -1
  111. package/lib/resources/captures.d.cts +2 -2
  112. package/lib/resources/captures.d.ts +2 -2
  113. package/lib/resources/captures.js.map +1 -1
  114. package/lib/resources/carrier_accounts.cjs.map +1 -1
  115. package/lib/resources/carrier_accounts.d.cts +2 -2
  116. package/lib/resources/carrier_accounts.d.ts +2 -2
  117. package/lib/resources/carrier_accounts.js.map +1 -1
  118. package/lib/resources/checkout_com_gateways.cjs.map +1 -1
  119. package/lib/resources/checkout_com_gateways.d.cts +2 -2
  120. package/lib/resources/checkout_com_gateways.d.ts +2 -2
  121. package/lib/resources/checkout_com_gateways.js.map +1 -1
  122. package/lib/resources/checkout_com_payments.cjs.map +1 -1
  123. package/lib/resources/checkout_com_payments.d.cts +2 -2
  124. package/lib/resources/checkout_com_payments.d.ts +2 -2
  125. package/lib/resources/checkout_com_payments.js.map +1 -1
  126. package/lib/resources/cleanups.cjs.map +1 -1
  127. package/lib/resources/cleanups.d.cts +2 -2
  128. package/lib/resources/cleanups.d.ts +2 -2
  129. package/lib/resources/cleanups.js.map +1 -1
  130. package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -1
  131. package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
  132. package/lib/resources/coupon_codes_promotion_rules.d.ts +2 -2
  133. package/lib/resources/coupon_codes_promotion_rules.js.map +1 -1
  134. package/lib/resources/coupon_recipients.cjs.map +1 -1
  135. package/lib/resources/coupon_recipients.d.cts +2 -2
  136. package/lib/resources/coupon_recipients.d.ts +2 -2
  137. package/lib/resources/coupon_recipients.js.map +1 -1
  138. package/lib/resources/coupons.cjs.map +1 -1
  139. package/lib/resources/coupons.d.cts +2 -2
  140. package/lib/resources/coupons.d.ts +2 -2
  141. package/lib/resources/coupons.js.map +1 -1
  142. package/lib/resources/custom_promotion_rules.cjs.map +1 -1
  143. package/lib/resources/custom_promotion_rules.d.cts +2 -2
  144. package/lib/resources/custom_promotion_rules.d.ts +2 -2
  145. package/lib/resources/custom_promotion_rules.js.map +1 -1
  146. package/lib/resources/customer_addresses.cjs.map +1 -1
  147. package/lib/resources/customer_addresses.d.cts +2 -2
  148. package/lib/resources/customer_addresses.d.ts +2 -2
  149. package/lib/resources/customer_addresses.js.map +1 -1
  150. package/lib/resources/customer_groups.cjs.map +1 -1
  151. package/lib/resources/customer_groups.d.cts +2 -2
  152. package/lib/resources/customer_groups.d.ts +2 -2
  153. package/lib/resources/customer_groups.js.map +1 -1
  154. package/lib/resources/customer_password_resets.cjs.map +1 -1
  155. package/lib/resources/customer_password_resets.d.cts +2 -2
  156. package/lib/resources/customer_password_resets.d.ts +2 -2
  157. package/lib/resources/customer_password_resets.js.map +1 -1
  158. package/lib/resources/customer_payment_sources.cjs.map +1 -1
  159. package/lib/resources/customer_payment_sources.d.cts +2 -2
  160. package/lib/resources/customer_payment_sources.d.ts +2 -2
  161. package/lib/resources/customer_payment_sources.js.map +1 -1
  162. package/lib/resources/customer_subscriptions.cjs.map +1 -1
  163. package/lib/resources/customer_subscriptions.d.cts +2 -2
  164. package/lib/resources/customer_subscriptions.d.ts +2 -2
  165. package/lib/resources/customer_subscriptions.js.map +1 -1
  166. package/lib/resources/customers.cjs.map +1 -1
  167. package/lib/resources/customers.d.cts +2 -2
  168. package/lib/resources/customers.d.ts +2 -2
  169. package/lib/resources/customers.js.map +1 -1
  170. package/lib/resources/delivery_lead_times.cjs.map +1 -1
  171. package/lib/resources/delivery_lead_times.d.cts +2 -2
  172. package/lib/resources/delivery_lead_times.d.ts +2 -2
  173. package/lib/resources/delivery_lead_times.js.map +1 -1
  174. package/lib/resources/discount_engine_items.cjs.map +1 -1
  175. package/lib/resources/discount_engine_items.d.cts +2 -2
  176. package/lib/resources/discount_engine_items.d.ts +2 -2
  177. package/lib/resources/discount_engine_items.js.map +1 -1
  178. package/lib/resources/discount_engines.cjs.map +1 -1
  179. package/lib/resources/discount_engines.d.cts +2 -2
  180. package/lib/resources/discount_engines.d.ts +2 -2
  181. package/lib/resources/discount_engines.js.map +1 -1
  182. package/lib/resources/easypost_pickups.cjs.map +1 -1
  183. package/lib/resources/easypost_pickups.d.cts +2 -2
  184. package/lib/resources/easypost_pickups.d.ts +2 -2
  185. package/lib/resources/easypost_pickups.js.map +1 -1
  186. package/lib/resources/event_callbacks.cjs.map +1 -1
  187. package/lib/resources/event_callbacks.d.cts +2 -2
  188. package/lib/resources/event_callbacks.d.ts +2 -2
  189. package/lib/resources/event_callbacks.js.map +1 -1
  190. package/lib/resources/events.cjs.map +1 -1
  191. package/lib/resources/events.d.cts +2 -2
  192. package/lib/resources/events.d.ts +2 -2
  193. package/lib/resources/events.js.map +1 -1
  194. package/lib/resources/exports.cjs.map +1 -1
  195. package/lib/resources/exports.d.cts +2 -2
  196. package/lib/resources/exports.d.ts +2 -2
  197. package/lib/resources/exports.js.map +1 -1
  198. package/lib/resources/external_gateways.cjs.map +1 -1
  199. package/lib/resources/external_gateways.d.cts +2 -2
  200. package/lib/resources/external_gateways.d.ts +2 -2
  201. package/lib/resources/external_gateways.js.map +1 -1
  202. package/lib/resources/external_payments.cjs.map +1 -1
  203. package/lib/resources/external_payments.d.cts +2 -2
  204. package/lib/resources/external_payments.d.ts +2 -2
  205. package/lib/resources/external_payments.js.map +1 -1
  206. package/lib/resources/external_promotions.cjs.map +1 -1
  207. package/lib/resources/external_promotions.d.cts +2 -2
  208. package/lib/resources/external_promotions.d.ts +2 -2
  209. package/lib/resources/external_promotions.js.map +1 -1
  210. package/lib/resources/external_tax_calculators.cjs.map +1 -1
  211. package/lib/resources/external_tax_calculators.d.cts +2 -2
  212. package/lib/resources/external_tax_calculators.d.ts +2 -2
  213. package/lib/resources/external_tax_calculators.js.map +1 -1
  214. package/lib/resources/fixed_amount_promotions.cjs.map +1 -1
  215. package/lib/resources/fixed_amount_promotions.d.cts +2 -2
  216. package/lib/resources/fixed_amount_promotions.d.ts +2 -2
  217. package/lib/resources/fixed_amount_promotions.js.map +1 -1
  218. package/lib/resources/fixed_price_promotions.cjs.map +1 -1
  219. package/lib/resources/fixed_price_promotions.d.cts +2 -2
  220. package/lib/resources/fixed_price_promotions.d.ts +2 -2
  221. package/lib/resources/fixed_price_promotions.js.map +1 -1
  222. package/lib/resources/flex_promotions.cjs.map +1 -1
  223. package/lib/resources/flex_promotions.d.cts +2 -2
  224. package/lib/resources/flex_promotions.d.ts +2 -2
  225. package/lib/resources/flex_promotions.js.map +1 -1
  226. package/lib/resources/free_gift_promotions.cjs.map +1 -1
  227. package/lib/resources/free_gift_promotions.d.cts +2 -2
  228. package/lib/resources/free_gift_promotions.d.ts +2 -2
  229. package/lib/resources/free_gift_promotions.js.map +1 -1
  230. package/lib/resources/free_shipping_promotions.cjs.map +1 -1
  231. package/lib/resources/free_shipping_promotions.d.cts +2 -2
  232. package/lib/resources/free_shipping_promotions.d.ts +2 -2
  233. package/lib/resources/free_shipping_promotions.js.map +1 -1
  234. package/lib/resources/geocoders.cjs.map +1 -1
  235. package/lib/resources/geocoders.d.cts +2 -2
  236. package/lib/resources/geocoders.d.ts +2 -2
  237. package/lib/resources/geocoders.js.map +1 -1
  238. package/lib/resources/gift_card_recipients.cjs.map +1 -1
  239. package/lib/resources/gift_card_recipients.d.cts +2 -2
  240. package/lib/resources/gift_card_recipients.d.ts +2 -2
  241. package/lib/resources/gift_card_recipients.js.map +1 -1
  242. package/lib/resources/gift_cards.cjs.map +1 -1
  243. package/lib/resources/gift_cards.d.cts +2 -2
  244. package/lib/resources/gift_cards.d.ts +2 -2
  245. package/lib/resources/gift_cards.js.map +1 -1
  246. package/lib/resources/google_geocoders.cjs.map +1 -1
  247. package/lib/resources/google_geocoders.d.cts +2 -2
  248. package/lib/resources/google_geocoders.d.ts +2 -2
  249. package/lib/resources/google_geocoders.js.map +1 -1
  250. package/lib/resources/imports.cjs.map +1 -1
  251. package/lib/resources/imports.d.cts +2 -2
  252. package/lib/resources/imports.d.ts +2 -2
  253. package/lib/resources/imports.js.map +1 -1
  254. package/lib/resources/in_stock_subscriptions.cjs.map +1 -1
  255. package/lib/resources/in_stock_subscriptions.d.cts +2 -2
  256. package/lib/resources/in_stock_subscriptions.d.ts +2 -2
  257. package/lib/resources/in_stock_subscriptions.js.map +1 -1
  258. package/lib/resources/inventory_models.cjs.map +1 -1
  259. package/lib/resources/inventory_models.d.cts +2 -2
  260. package/lib/resources/inventory_models.d.ts +2 -2
  261. package/lib/resources/inventory_models.js.map +1 -1
  262. package/lib/resources/inventory_return_locations.cjs.map +1 -1
  263. package/lib/resources/inventory_return_locations.d.cts +2 -2
  264. package/lib/resources/inventory_return_locations.d.ts +2 -2
  265. package/lib/resources/inventory_return_locations.js.map +1 -1
  266. package/lib/resources/inventory_stock_locations.cjs.map +1 -1
  267. package/lib/resources/inventory_stock_locations.d.cts +2 -2
  268. package/lib/resources/inventory_stock_locations.d.ts +2 -2
  269. package/lib/resources/inventory_stock_locations.js.map +1 -1
  270. package/lib/resources/klarna_gateways.cjs.map +1 -1
  271. package/lib/resources/klarna_gateways.d.cts +2 -2
  272. package/lib/resources/klarna_gateways.d.ts +2 -2
  273. package/lib/resources/klarna_gateways.js.map +1 -1
  274. package/lib/resources/klarna_payments.cjs.map +1 -1
  275. package/lib/resources/klarna_payments.d.cts +2 -2
  276. package/lib/resources/klarna_payments.d.ts +2 -2
  277. package/lib/resources/klarna_payments.js.map +1 -1
  278. package/lib/resources/line_item_options.cjs.map +1 -1
  279. package/lib/resources/line_item_options.d.cts +2 -2
  280. package/lib/resources/line_item_options.d.ts +2 -2
  281. package/lib/resources/line_item_options.js.map +1 -1
  282. package/lib/resources/line_items.cjs.map +1 -1
  283. package/lib/resources/line_items.d.cts +2 -2
  284. package/lib/resources/line_items.d.ts +2 -2
  285. package/lib/resources/line_items.js.map +1 -1
  286. package/lib/resources/links.cjs.map +1 -1
  287. package/lib/resources/links.d.cts +2 -2
  288. package/lib/resources/links.d.ts +2 -2
  289. package/lib/resources/links.js.map +1 -1
  290. package/lib/resources/manual_gateways.cjs.map +1 -1
  291. package/lib/resources/manual_gateways.d.cts +2 -2
  292. package/lib/resources/manual_gateways.d.ts +2 -2
  293. package/lib/resources/manual_gateways.js.map +1 -1
  294. package/lib/resources/manual_tax_calculators.cjs.map +1 -1
  295. package/lib/resources/manual_tax_calculators.d.cts +2 -2
  296. package/lib/resources/manual_tax_calculators.d.ts +2 -2
  297. package/lib/resources/manual_tax_calculators.js.map +1 -1
  298. package/lib/resources/markets.cjs +4 -0
  299. package/lib/resources/markets.cjs.map +1 -1
  300. package/lib/resources/markets.d.cts +2 -2
  301. package/lib/resources/markets.d.ts +2 -2
  302. package/lib/resources/markets.js +4 -0
  303. package/lib/resources/markets.js.map +1 -1
  304. package/lib/resources/merchants.cjs.map +1 -1
  305. package/lib/resources/merchants.d.cts +2 -2
  306. package/lib/resources/merchants.d.ts +2 -2
  307. package/lib/resources/merchants.js.map +1 -1
  308. package/lib/resources/notifications.cjs.map +1 -1
  309. package/lib/resources/notifications.d.cts +2 -2
  310. package/lib/resources/notifications.d.ts +2 -2
  311. package/lib/resources/notifications.js.map +1 -1
  312. package/lib/resources/order_amount_promotion_rules.cjs.map +1 -1
  313. package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
  314. package/lib/resources/order_amount_promotion_rules.d.ts +2 -2
  315. package/lib/resources/order_amount_promotion_rules.js.map +1 -1
  316. package/lib/resources/order_copies.cjs.map +1 -1
  317. package/lib/resources/order_copies.d.cts +2 -2
  318. package/lib/resources/order_copies.d.ts +2 -2
  319. package/lib/resources/order_copies.js.map +1 -1
  320. package/lib/resources/order_factories.cjs.map +1 -1
  321. package/lib/resources/order_factories.d.cts +2 -2
  322. package/lib/resources/order_factories.d.ts +2 -2
  323. package/lib/resources/order_factories.js.map +1 -1
  324. package/lib/resources/order_subscription_items.cjs.map +1 -1
  325. package/lib/resources/order_subscription_items.d.cts +2 -2
  326. package/lib/resources/order_subscription_items.d.ts +2 -2
  327. package/lib/resources/order_subscription_items.js.map +1 -1
  328. package/lib/resources/order_subscriptions.cjs.map +1 -1
  329. package/lib/resources/order_subscriptions.d.cts +2 -2
  330. package/lib/resources/order_subscriptions.d.ts +2 -2
  331. package/lib/resources/order_subscriptions.js.map +1 -1
  332. package/lib/resources/orders.cjs +4 -0
  333. package/lib/resources/orders.cjs.map +1 -1
  334. package/lib/resources/orders.d.cts +2 -2
  335. package/lib/resources/orders.d.ts +2 -2
  336. package/lib/resources/orders.js +4 -0
  337. package/lib/resources/orders.js.map +1 -1
  338. package/lib/resources/organizations.cjs.map +1 -1
  339. package/lib/resources/organizations.d.cts +2 -2
  340. package/lib/resources/organizations.d.ts +2 -2
  341. package/lib/resources/organizations.js.map +1 -1
  342. package/lib/resources/packages.cjs.map +1 -1
  343. package/lib/resources/packages.d.cts +2 -2
  344. package/lib/resources/packages.d.ts +2 -2
  345. package/lib/resources/packages.js.map +1 -1
  346. package/lib/resources/parcel_line_items.cjs.map +1 -1
  347. package/lib/resources/parcel_line_items.d.cts +2 -2
  348. package/lib/resources/parcel_line_items.d.ts +2 -2
  349. package/lib/resources/parcel_line_items.js.map +1 -1
  350. package/lib/resources/parcels.cjs.map +1 -1
  351. package/lib/resources/parcels.d.cts +2 -2
  352. package/lib/resources/parcels.d.ts +2 -2
  353. package/lib/resources/parcels.js.map +1 -1
  354. package/lib/resources/payment_gateways.cjs.map +1 -1
  355. package/lib/resources/payment_gateways.d.cts +2 -2
  356. package/lib/resources/payment_gateways.d.ts +2 -2
  357. package/lib/resources/payment_gateways.js.map +1 -1
  358. package/lib/resources/payment_methods.cjs.map +1 -1
  359. package/lib/resources/payment_methods.d.cts +2 -2
  360. package/lib/resources/payment_methods.d.ts +2 -2
  361. package/lib/resources/payment_methods.js.map +1 -1
  362. package/lib/resources/payment_options.cjs.map +1 -1
  363. package/lib/resources/payment_options.d.cts +2 -2
  364. package/lib/resources/payment_options.d.ts +2 -2
  365. package/lib/resources/payment_options.js.map +1 -1
  366. package/lib/resources/paypal_gateways.cjs.map +1 -1
  367. package/lib/resources/paypal_gateways.d.cts +2 -2
  368. package/lib/resources/paypal_gateways.d.ts +2 -2
  369. package/lib/resources/paypal_gateways.js.map +1 -1
  370. package/lib/resources/paypal_payments.cjs.map +1 -1
  371. package/lib/resources/paypal_payments.d.cts +2 -2
  372. package/lib/resources/paypal_payments.d.ts +2 -2
  373. package/lib/resources/paypal_payments.js.map +1 -1
  374. package/lib/resources/percentage_discount_promotions.cjs.map +1 -1
  375. package/lib/resources/percentage_discount_promotions.d.cts +2 -2
  376. package/lib/resources/percentage_discount_promotions.d.ts +2 -2
  377. package/lib/resources/percentage_discount_promotions.js.map +1 -1
  378. package/lib/resources/pickups.cjs.map +1 -1
  379. package/lib/resources/pickups.d.cts +2 -2
  380. package/lib/resources/pickups.d.ts +2 -2
  381. package/lib/resources/pickups.js.map +1 -1
  382. package/lib/resources/price_frequency_tiers.cjs.map +1 -1
  383. package/lib/resources/price_frequency_tiers.d.cts +2 -2
  384. package/lib/resources/price_frequency_tiers.d.ts +2 -2
  385. package/lib/resources/price_frequency_tiers.js.map +1 -1
  386. package/lib/resources/price_list_schedulers.cjs.map +1 -1
  387. package/lib/resources/price_list_schedulers.d.cts +2 -2
  388. package/lib/resources/price_list_schedulers.d.ts +2 -2
  389. package/lib/resources/price_list_schedulers.js.map +1 -1
  390. package/lib/resources/price_lists.cjs.map +1 -1
  391. package/lib/resources/price_lists.d.cts +2 -2
  392. package/lib/resources/price_lists.d.ts +2 -2
  393. package/lib/resources/price_lists.js.map +1 -1
  394. package/lib/resources/price_tiers.cjs.map +1 -1
  395. package/lib/resources/price_tiers.d.cts +2 -2
  396. package/lib/resources/price_tiers.d.ts +2 -2
  397. package/lib/resources/price_tiers.js.map +1 -1
  398. package/lib/resources/price_volume_tiers.cjs.map +1 -1
  399. package/lib/resources/price_volume_tiers.d.cts +2 -2
  400. package/lib/resources/price_volume_tiers.d.ts +2 -2
  401. package/lib/resources/price_volume_tiers.js.map +1 -1
  402. package/lib/resources/prices.cjs.map +1 -1
  403. package/lib/resources/prices.d.cts +2 -2
  404. package/lib/resources/prices.d.ts +2 -2
  405. package/lib/resources/prices.js.map +1 -1
  406. package/lib/resources/promotion_rules.cjs.map +1 -1
  407. package/lib/resources/promotion_rules.d.cts +2 -2
  408. package/lib/resources/promotion_rules.d.ts +2 -2
  409. package/lib/resources/promotion_rules.js.map +1 -1
  410. package/lib/resources/promotions.cjs.map +1 -1
  411. package/lib/resources/promotions.d.cts +2 -2
  412. package/lib/resources/promotions.d.ts +2 -2
  413. package/lib/resources/promotions.js.map +1 -1
  414. package/lib/resources/recurring_order_copies.cjs.map +1 -1
  415. package/lib/resources/recurring_order_copies.d.cts +2 -2
  416. package/lib/resources/recurring_order_copies.d.ts +2 -2
  417. package/lib/resources/recurring_order_copies.js.map +1 -1
  418. package/lib/resources/refunds.cjs.map +1 -1
  419. package/lib/resources/refunds.d.cts +2 -2
  420. package/lib/resources/refunds.d.ts +2 -2
  421. package/lib/resources/refunds.js.map +1 -1
  422. package/lib/resources/reserved_stocks.cjs.map +1 -1
  423. package/lib/resources/reserved_stocks.d.cts +2 -2
  424. package/lib/resources/reserved_stocks.d.ts +2 -2
  425. package/lib/resources/reserved_stocks.js.map +1 -1
  426. package/lib/resources/resource_errors.cjs.map +1 -1
  427. package/lib/resources/resource_errors.d.cts +2 -2
  428. package/lib/resources/resource_errors.d.ts +2 -2
  429. package/lib/resources/resource_errors.js.map +1 -1
  430. package/lib/resources/return_line_items.cjs.map +1 -1
  431. package/lib/resources/return_line_items.d.cts +2 -2
  432. package/lib/resources/return_line_items.d.ts +2 -2
  433. package/lib/resources/return_line_items.js.map +1 -1
  434. package/lib/resources/returns.cjs.map +1 -1
  435. package/lib/resources/returns.d.cts +2 -2
  436. package/lib/resources/returns.d.ts +2 -2
  437. package/lib/resources/returns.js.map +1 -1
  438. package/lib/resources/satispay_gateways.cjs.map +1 -1
  439. package/lib/resources/satispay_gateways.d.cts +2 -2
  440. package/lib/resources/satispay_gateways.d.ts +2 -2
  441. package/lib/resources/satispay_gateways.js.map +1 -1
  442. package/lib/resources/satispay_payments.cjs.map +1 -1
  443. package/lib/resources/satispay_payments.d.cts +2 -2
  444. package/lib/resources/satispay_payments.d.ts +2 -2
  445. package/lib/resources/satispay_payments.js.map +1 -1
  446. package/lib/resources/shipments.cjs.map +1 -1
  447. package/lib/resources/shipments.d.cts +2 -2
  448. package/lib/resources/shipments.d.ts +2 -2
  449. package/lib/resources/shipments.js.map +1 -1
  450. package/lib/resources/shipping_categories.cjs.map +1 -1
  451. package/lib/resources/shipping_categories.d.cts +2 -2
  452. package/lib/resources/shipping_categories.d.ts +2 -2
  453. package/lib/resources/shipping_categories.js.map +1 -1
  454. package/lib/resources/shipping_method_tiers.cjs.map +1 -1
  455. package/lib/resources/shipping_method_tiers.d.cts +2 -2
  456. package/lib/resources/shipping_method_tiers.d.ts +2 -2
  457. package/lib/resources/shipping_method_tiers.js.map +1 -1
  458. package/lib/resources/shipping_methods.cjs.map +1 -1
  459. package/lib/resources/shipping_methods.d.cts +2 -2
  460. package/lib/resources/shipping_methods.d.ts +2 -2
  461. package/lib/resources/shipping_methods.js.map +1 -1
  462. package/lib/resources/shipping_weight_tiers.cjs.map +1 -1
  463. package/lib/resources/shipping_weight_tiers.d.cts +2 -2
  464. package/lib/resources/shipping_weight_tiers.d.ts +2 -2
  465. package/lib/resources/shipping_weight_tiers.js.map +1 -1
  466. package/lib/resources/shipping_zones.cjs.map +1 -1
  467. package/lib/resources/shipping_zones.d.cts +2 -2
  468. package/lib/resources/shipping_zones.d.ts +2 -2
  469. package/lib/resources/shipping_zones.js.map +1 -1
  470. package/lib/resources/sku_list_items.cjs.map +1 -1
  471. package/lib/resources/sku_list_items.d.cts +2 -2
  472. package/lib/resources/sku_list_items.d.ts +2 -2
  473. package/lib/resources/sku_list_items.js.map +1 -1
  474. package/lib/resources/sku_list_promotion_rules.cjs.map +1 -1
  475. package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
  476. package/lib/resources/sku_list_promotion_rules.d.ts +2 -2
  477. package/lib/resources/sku_list_promotion_rules.js.map +1 -1
  478. package/lib/resources/sku_lists.cjs.map +1 -1
  479. package/lib/resources/sku_lists.d.cts +2 -2
  480. package/lib/resources/sku_lists.d.ts +2 -2
  481. package/lib/resources/sku_lists.js.map +1 -1
  482. package/lib/resources/sku_options.cjs.map +1 -1
  483. package/lib/resources/sku_options.d.cts +2 -2
  484. package/lib/resources/sku_options.d.ts +2 -2
  485. package/lib/resources/sku_options.js.map +1 -1
  486. package/lib/resources/skus.cjs.map +1 -1
  487. package/lib/resources/skus.d.cts +2 -2
  488. package/lib/resources/skus.d.ts +2 -2
  489. package/lib/resources/skus.js.map +1 -1
  490. package/lib/resources/stock_items.cjs.map +1 -1
  491. package/lib/resources/stock_items.d.cts +2 -2
  492. package/lib/resources/stock_items.d.ts +2 -2
  493. package/lib/resources/stock_items.js.map +1 -1
  494. package/lib/resources/stock_line_items.cjs.map +1 -1
  495. package/lib/resources/stock_line_items.d.cts +2 -2
  496. package/lib/resources/stock_line_items.d.ts +2 -2
  497. package/lib/resources/stock_line_items.js.map +1 -1
  498. package/lib/resources/stock_locations.cjs.map +1 -1
  499. package/lib/resources/stock_locations.d.cts +2 -2
  500. package/lib/resources/stock_locations.d.ts +2 -2
  501. package/lib/resources/stock_locations.js.map +1 -1
  502. package/lib/resources/stock_reservations.cjs.map +1 -1
  503. package/lib/resources/stock_reservations.d.cts +2 -2
  504. package/lib/resources/stock_reservations.d.ts +2 -2
  505. package/lib/resources/stock_reservations.js.map +1 -1
  506. package/lib/resources/stock_transfers.cjs.map +1 -1
  507. package/lib/resources/stock_transfers.d.cts +2 -2
  508. package/lib/resources/stock_transfers.d.ts +2 -2
  509. package/lib/resources/stock_transfers.js.map +1 -1
  510. package/lib/resources/stores.cjs.map +1 -1
  511. package/lib/resources/stores.d.cts +2 -2
  512. package/lib/resources/stores.d.ts +2 -2
  513. package/lib/resources/stores.js.map +1 -1
  514. package/lib/resources/stripe_gateways.cjs.map +1 -1
  515. package/lib/resources/stripe_gateways.d.cts +2 -2
  516. package/lib/resources/stripe_gateways.d.ts +2 -2
  517. package/lib/resources/stripe_gateways.js.map +1 -1
  518. package/lib/resources/stripe_payments.cjs.map +1 -1
  519. package/lib/resources/stripe_payments.d.cts +2 -2
  520. package/lib/resources/stripe_payments.d.ts +2 -2
  521. package/lib/resources/stripe_payments.js.map +1 -1
  522. package/lib/resources/stripe_tax_accounts.cjs.map +1 -1
  523. package/lib/resources/stripe_tax_accounts.d.cts +2 -2
  524. package/lib/resources/stripe_tax_accounts.d.ts +2 -2
  525. package/lib/resources/stripe_tax_accounts.js.map +1 -1
  526. package/lib/resources/subscription_models.cjs.map +1 -1
  527. package/lib/resources/subscription_models.d.cts +2 -2
  528. package/lib/resources/subscription_models.d.ts +2 -2
  529. package/lib/resources/subscription_models.js.map +1 -1
  530. package/lib/resources/tags.cjs.map +1 -1
  531. package/lib/resources/tags.d.cts +2 -2
  532. package/lib/resources/tags.d.ts +2 -2
  533. package/lib/resources/tags.js.map +1 -1
  534. package/lib/resources/talon_one_accounts.cjs.map +1 -1
  535. package/lib/resources/talon_one_accounts.d.cts +2 -2
  536. package/lib/resources/talon_one_accounts.d.ts +2 -2
  537. package/lib/resources/talon_one_accounts.js.map +1 -1
  538. package/lib/resources/tax_calculators.cjs.map +1 -1
  539. package/lib/resources/tax_calculators.d.cts +2 -2
  540. package/lib/resources/tax_calculators.d.ts +2 -2
  541. package/lib/resources/tax_calculators.js.map +1 -1
  542. package/lib/resources/tax_categories.cjs.map +1 -1
  543. package/lib/resources/tax_categories.d.cts +2 -2
  544. package/lib/resources/tax_categories.d.ts +2 -2
  545. package/lib/resources/tax_categories.js.map +1 -1
  546. package/lib/resources/tax_rules.cjs.map +1 -1
  547. package/lib/resources/tax_rules.d.cts +2 -2
  548. package/lib/resources/tax_rules.d.ts +2 -2
  549. package/lib/resources/tax_rules.js.map +1 -1
  550. package/lib/resources/taxjar_accounts.cjs.map +1 -1
  551. package/lib/resources/taxjar_accounts.d.cts +2 -2
  552. package/lib/resources/taxjar_accounts.d.ts +2 -2
  553. package/lib/resources/taxjar_accounts.js.map +1 -1
  554. package/lib/resources/transactions.cjs.map +1 -1
  555. package/lib/resources/transactions.d.cts +2 -2
  556. package/lib/resources/transactions.d.ts +2 -2
  557. package/lib/resources/transactions.js.map +1 -1
  558. package/lib/resources/versions.cjs.map +1 -1
  559. package/lib/resources/versions.d.cts +2 -2
  560. package/lib/resources/versions.d.ts +2 -2
  561. package/lib/resources/versions.js.map +1 -1
  562. package/lib/resources/vertex_accounts.cjs.map +1 -1
  563. package/lib/resources/vertex_accounts.d.cts +2 -2
  564. package/lib/resources/vertex_accounts.d.ts +2 -2
  565. package/lib/resources/vertex_accounts.js.map +1 -1
  566. package/lib/resources/voids.cjs.map +1 -1
  567. package/lib/resources/voids.d.cts +2 -2
  568. package/lib/resources/voids.d.ts +2 -2
  569. package/lib/resources/voids.js.map +1 -1
  570. package/lib/resources/webhooks.cjs.map +1 -1
  571. package/lib/resources/webhooks.d.cts +2 -2
  572. package/lib/resources/webhooks.d.ts +2 -2
  573. package/lib/resources/webhooks.js.map +1 -1
  574. package/lib/resources/wire_transfers.cjs.map +1 -1
  575. package/lib/resources/wire_transfers.d.cts +2 -2
  576. package/lib/resources/wire_transfers.d.ts +2 -2
  577. package/lib/resources/wire_transfers.js.map +1 -1
  578. package/lib/static.d.cts +2 -2
  579. package/lib/static.d.ts +2 -2
  580. package/package.json +15 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/return_line_items.ts"],"names":[],"mappings":";;AAuHA,MAAM,wBAAwB,WAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA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,QAAS,CAAA,IAAA,KAAS,eAAgB,CAAA,IAAA;AAAA;AAC5D,EAGA,aAAa,EAAmD,EAAA;AAC/D,IAAO,OAAA,KAAA,CAAM,qBAAwC,EAAE,CAAA;AAAA;AACxD,EAEA,sBAAsB,GAAoC,EAAA;AACzD,IAAO,OAAA,KAAA,CAAM,qBAAyC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC7D,EAGA,IAA2B,GAAA;AAC1B,IAAA,OAAO,eAAgB,CAAA,IAAA;AAAA;AAGzB;AAGA,MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"return_line_items.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Return, ReturnType } from './returns'\nimport type { LineItem, LineItemType } from './line_items'\n\n\ntype ReturnLineItemType = 'return_line_items'\ntype ReturnLineItemRel = ResourceRel & { type: ReturnLineItemType }\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type ReturnLineItemSort = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'restocked_at'> & ResourceSort\n// export type ReturnLineItemFilter = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'return_reason' | 'restocked_at'> & ResourceFilter\n\n\ninterface ReturnLineItem extends Resource {\n\t\n\treadonly type: ReturnLineItemType\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 return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The name of the 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\t/** \n\t * Calculated as line item unit amount x returned quantity and applied discounts, if any.\n\t * @example ```8800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The return line item total amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```88```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The return line item total amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€88,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t/** \n\t * Time at which the return line item was restocked.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trestocked_at?: string | null\n\n\treturn?: Return | null\n\tline_item?: LineItem | null\n\n}\n\n\ninterface ReturnLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\n\treturn: ReturnRel\n\tline_item: LineItemRel\n\n}\n\n\ninterface ReturnLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to restock the line item.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t\n}\n\n\nclass ReturnLineItems extends ApiResource<ReturnLineItem> {\n\n\tstatic readonly TYPE: ReturnLineItemType = 'return_line_items' as const\n\n\tasync create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.create<ReturnLineItemCreate, ReturnLineItem>({ ...resource, type: ReturnLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ ...resource, type: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options)\n\t}\n\n\tasync return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync _restock(id: string | ReturnLineItem, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ id: (typeof id === 'string')? id: id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options)\n\t}\n\n\n\tisReturnLineItem(resource: any): resource is ReturnLineItem {\n\t\treturn resource.type && (resource.type === ReturnLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnLineItemRel {\n\t\treturn super.relationshipOneToOne<ReturnLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ReturnLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ReturnLineItemType {\n\t\treturn ReturnLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ReturnLineItems()\nexport default instance\n\nexport type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate, ReturnLineItemType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/return_line_items.ts"],"names":[],"mappings":";;AAuHA,MAAM,wBAAwB,WAA4B,CAAA;AAAA,EAEzD,OAAgB,IAA2B,GAAA,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAgC,EAAA,MAAA,EAA8C,OAAoD,EAAA;AAC9I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,eAAgB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,eAAA,CAAgB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACvG,EAEA,MAAM,MAAA,CAAO,gBAA2C,EAAA,MAAA,EAAsC,OAA4C,E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MAAM,QAAA,GAAW,IAAI,eAAgB,EAAA;AACrC,IAAO,yBAAQ,GAAA","file":"return_line_items.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { Return, ReturnType } from './returns'\nimport type { LineItem, LineItemType } from './line_items'\n\n\ntype ReturnLineItemType = 'return_line_items'\ntype ReturnLineItemRel = ResourceRel & { type: ReturnLineItemType }\ntype ReturnRel = ResourceRel & { type: ReturnType }\ntype LineItemRel = ResourceRel & { type: LineItemType }\n\n\nexport type ReturnLineItemSort = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'restocked_at'> & ResourceSort\n// export type ReturnLineItemFilter = Pick<ReturnLineItem, 'id' | 'quantity' | 'total_amount_cents' | 'return_reason' | 'restocked_at'> & ResourceFilter\n\n\ninterface ReturnLineItem extends Resource {\n\t\n\treadonly type: ReturnLineItemType\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 return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The name of the 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\t/** \n\t * Calculated as line item unit amount x returned quantity and applied discounts, if any.\n\t * @example ```8800```\n\t */\n\ttotal_amount_cents?: number | null\n\t/** \n\t * The return line item total amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce.\n\t * @example ```88```\n\t */\n\ttotal_amount_float: number\n\t/** \n\t * The return line item total amount, formatted. This can be useful to display the amount with currency in you views.\n\t * @example ```\"€88,00\"```\n\t */\n\tformatted_total_amount?: string | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t/** \n\t * Time at which the return line item was restocked.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\trestocked_at?: string | null\n\n\treturn?: Return | null\n\tline_item?: LineItem | null\n\n}\n\n\ninterface ReturnLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\n\treturn: ReturnRel\n\tline_item: LineItemRel\n\n}\n\n\ninterface ReturnLineItemUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The return line item quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to restock the line item.\n\t * @example ```true```\n\t */\n\t_restock?: boolean | null\n\t/** \n\t * Set of key-value pairs that you can use to add details about return reason.\n\t * @example ```{\"size\":\"was wrong\"}```\n\t */\n\treturn_reason?: Record<string, any> | null\n\t\n}\n\n\nclass ReturnLineItems extends ApiResource<ReturnLineItem> {\n\n\tstatic readonly TYPE: ReturnLineItemType = 'return_line_items' as const\n\n\tasync create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.create<ReturnLineItemCreate, ReturnLineItem>({ ...resource, type: ReturnLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ ...resource, type: ReturnLineItems.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: ReturnLineItems.TYPE } : id, options)\n\t}\n\n\tasync return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<Return>, options?: ResourcesConfig): Promise<Return> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<Return>({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options) as unknown as Return\n\t}\n\n\tasync line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _returnLineItemId = (returnLineItemId as ReturnLineItem).id || returnLineItemId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync _restock(id: string | ReturnLineItem, params?: QueryParamsRetrieve<ReturnLineItem>, options?: ResourcesConfig): Promise<ReturnLineItem> {\n\t\treturn this.resources.update<ReturnLineItemUpdate, ReturnLineItem>({ id: (typeof id === 'string')? id: id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options)\n\t}\n\n\n\tisReturnLineItem(resource: any): resource is ReturnLineItem {\n\t\treturn resource.type && (resource.type === ReturnLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ReturnLineItemRel {\n\t\treturn super.relationshipOneToOne<ReturnLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ReturnLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ReturnLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ReturnLineItemType {\n\t\treturn ReturnLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ReturnLineItems()\nexport default instance\n\nexport type { ReturnLineItems, ReturnLineItem, ReturnLineItemC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E,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"returns.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 { Return, ReturnCreate, ReturnUpdate, ReturnType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/returns.ts"],"names":["ApiResource"],"mappings":";;;;AA6MA,MAAM,gBAAgBA,oBAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO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qB,EAAA,YAAA,EAAsB,QAAsC,OAA4C,EAAA;AAC5I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC7J,EAEA,MAAM,YAAA,CAAa,EAAqB,EAAA,YAAA,EAAsB,QAAsC,OAA4C,EAAA;AAC/I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAChK,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"returns.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,4 +1,4 @@
1
- export { hf as Return, hg as ReturnCreate, hi as ReturnSort, jW as ReturnType, hh as ReturnUpdate, be as default } from '../api-DmIZO_Np.cjs';
1
+ export { jk as Return, jl as ReturnCreate, jn as ReturnSort, lZ as ReturnType, jm as ReturnUpdate, cK as Returns, cJ as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
- import '../interceptor-5MISI1yn.cjs';
3
+ import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { hf as Return, hg as ReturnCreate, hi as ReturnSort, jW as ReturnType, hh as ReturnUpdate, be as default } from '../api-DDgIE2i8.js';
1
+ export { jk as Return, jl as ReturnCreate, jn as ReturnSort, lZ as ReturnType, jm as ReturnUpdate, cK as Returns, cJ as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
- import '../interceptor-5MISI1yn.js';
3
+ import '../interceptor-k15jXzf0.js';
4
4
  import '../types.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/returns.ts"],"names":[],"mappings":";;AA6MA,MAAM,gBAAgB,WAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,E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MAAM,OAAQ,CAAA,IAAA,EAAM,sBAAsB,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACxK,EAEA,MAAM,SAAA,CAAU,EAAqB,EAAA,YAAA,EAAsB,QAAsC,OAA4C,EAAA;AAC5I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC7J,EAEA,MAAM,YAAA,CAAa,EAAqB,EAAA,YAAA,EAAsB,QAAsC,OAA4C,EAAA;AAC/I,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAChK,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"returns.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 { 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 { Return, ReturnCreate, ReturnUpdate, ReturnType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/returns.ts"],"names":[],"mappings":";;AA6MA,MAAM,gBAAgB,WAAoB,CAAA;AAAA,EAEzC,OAAgB,IAAmB,GAAA,SAAA;AAAA,EAEnC,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAA,CAAO,QAAwB,EAAA,MAAA,EAAsC,OAA4C,EAAA;AACtH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA6B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,OAAQ,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,OAAA,CAAQ,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,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,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,OAAQ,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAChK,EAGA,SAAS,QAAmC,EAAA;AAC3C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,OAAQ,CAAA,IAAA;AAAA;AACpD,EAGA,aAAa,EAA2C,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAgC,EAAE,CAAA;AAAA;AAChD,EAEA,sBAAsB,GAA4B,EAAA;AACjD,IAAO,OAAA,KAAA,CAAM,qBAAiC,CAAA,GAAG,GAAG,CAAA;AAAA;AACrD,EAGA,IAAmB,GAAA;AAClB,IAAA,OAAO,OAAQ,CAAA,IAAA;AAAA;AAGjB;AAGA,MAAM,QAAA,GAAW,IAAI,OAAQ,EAAA;AAC7B,IAAO,eAAQ,GAAA","file":"returns.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 { 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/resources/satispay_gateways.ts"],"names":["ApiResource"],"mappings":";;;;AAiFA,MAAM,yBA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AAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAqB,kBAAA,EAAA,kBAAkB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/H,EAEA,MAAM,iBAAA,CAAkB,iBAA6C,EAAA,MAAA,EAA2C,OAAmE,EAAA;AAClL,IAAM,MAAA,kBAAA,GAAsB,kBAAsC,EAAM,IAAA,iBAAA;AACxE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAuB,EAAE,IAAA,EAAM,mBAAoB,EAAA,EAAG,CAAqB,kBAAA,EAAA,kBAAkB,CAAsB,kBAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzJ,EAGA,kBAAkB,QAA4C,EAAA;AAC7D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,gBAAiB,CAAA,IAAA;AAAA;AAC7D,EAGA,aAAa,EAAoD,EAAA;AAChE,IAAO,OAAA,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA;AACzD,EAEA,sBAAsB,GAAqC,EAAA;AAC1D,IAAO,OAAA,KAAA,CAAM,qBAA0C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC9D,EAGA,IAA4B,GAAA;AAC3B,IAAA,OAAO,gBAAiB,CAAA,IAAA;AAAA;AAG1B;AAGA,MAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","file":"satispay_gateways.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { SatispayPayment, SatispayPaymentType } from './satispay_payments'\n\n\ntype SatispayGatewayType = 'satispay_gateways'\ntype SatispayGatewayRel = ResourceRel & { type: SatispayGatewayType }\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\n\n\nexport type SatispayGatewaySort = Pick<SatispayGateway, 'id' | 'name'> & ResourceSort\n// export type SatispayGatewayFilter = Pick<SatispayGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface SatispayGateway extends Resource {\n\t\n\treadonly type: SatispayGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\t/** \n\t * The Satispay API key auto generated basing on activation code.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tkey_id: string\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/satispay_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tsatispay_payments?: SatispayPayment[] | null\n\n}\n\n\ninterface SatispayGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\ninterface SatispayGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\nclass SatispayGateways extends ApiResource<SatispayGateway> {\n\n\tstatic readonly TYPE: SatispayGatewayType = 'satispay_gateways' as const\n\n\tasync create(resource: SatispayGatewayCreate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.create<SatispayGatewayCreate, SatispayGateway>({ ...resource, type: SatispayGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.update<SatispayGatewayUpdate, SatispayGateway>({ ...resource, type: SatispayGateways.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: SatispayGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<SatispayPayment>, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<SatispayPayment>({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options) as unknown as ListResponse<SatispayPayment>\n\t}\n\n\n\tisSatispayGateway(resource: any): resource is SatispayGateway {\n\t\treturn resource.type && (resource.type === SatispayGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayGatewayRel {\n\t\treturn super.relationshipOneToOne<SatispayGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayGatewayRel[] {\n\t\treturn super.relationshipOneToMany<SatispayGatewayRel>(...ids)\n\t}\n\n\n\ttype(): SatispayGatewayType {\n\t\treturn SatispayGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayGateways()\nexport default instance\n\nexport type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate, SatispayGatewayType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/satispay_gateways.ts"],"names":["ApiResource"],"mappings":";;;;AAiFA,MAAM,yBAAyBA,oBAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,gBAAA,CAAiB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,eAAA,CAAgB,iBAA6C,EAAA,MAAA,EAAyC,OAAi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A,OAAO,gBAAiB,CAAA,IAAA;AAAA;AAG1B;AAGA,MAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","file":"satispay_gateways.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { SatispayPayment, SatispayPaymentType } from './satispay_payments'\n\n\ntype SatispayGatewayType = 'satispay_gateways'\ntype SatispayGatewayRel = ResourceRel & { type: SatispayGatewayType }\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\n\n\nexport type SatispayGatewaySort = Pick<SatispayGateway, 'id' | 'name'> & ResourceSort\n// export type SatispayGatewayFilter = Pick<SatispayGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface SatispayGateway extends Resource {\n\t\n\treadonly type: SatispayGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\t/** \n\t * The Satispay API key auto generated basing on activation code.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tkey_id: string\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/satispay_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tsatispay_payments?: SatispayPayment[] | null\n\n}\n\n\ninterface SatispayGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\ninterface SatispayGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\nclass SatispayGateways extends ApiResource<SatispayGateway> {\n\n\tstatic readonly TYPE: SatispayGatewayType = 'satispay_gateways' as const\n\n\tasync create(resource: SatispayGatewayCreate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.create<SatispayGatewayCreate, SatispayGateway>({ ...resource, type: SatispayGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.update<SatispayGatewayUpdate, SatispayGateway>({ ...resource, type: SatispayGateways.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: SatispayGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<SatispayPayment>, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<SatispayPayment>({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options) as unknown as ListResponse<SatispayPayment>\n\t}\n\n\n\tisSatispayGateway(resource: any): resource is SatispayGateway {\n\t\treturn resource.type && (resource.type === SatispayGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayGatewayRel {\n\t\treturn super.relationshipOneToOne<SatispayGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayGatewayRel[] {\n\t\treturn super.relationshipOneToMany<SatispayGatewayRel>(...ids)\n\t}\n\n\n\ttype(): SatispayGatewayType {\n\t\treturn SatispayGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayGateways()\nexport default instance\n\nexport type { SatispayGateways, SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate, SatispayGatewayType }\n"]}
@@ -1,4 +1,4 @@
1
- export { hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, ln as SatispayGatewayType, hl as SatispayGatewayUpdate, bf as default } from '../api-DmIZO_Np.cjs';
1
+ export { jo as SatispayGateway, jp as SatispayGatewayCreate, jr as SatispayGatewaySort, nq as SatispayGatewayType, jq as SatispayGatewayUpdate, cM as SatispayGateways, cL as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
- import '../interceptor-5MISI1yn.cjs';
3
+ import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, ln as SatispayGatewayType, hl as SatispayGatewayUpdate, bf as default } from '../api-DDgIE2i8.js';
1
+ export { jo as SatispayGateway, jp as SatispayGatewayCreate, jr as SatispayGatewaySort, nq as SatispayGatewayType, jq as SatispayGatewayUpdate, cM as SatispayGateways, cL as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
- import '../interceptor-5MISI1yn.js';
3
+ import '../interceptor-k15jXzf0.js';
4
4
  import '../types.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/satispay_gateways.ts"],"names":[],"mappings":";;AAiFA,MAAM,yBAAyB,WAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,gBAAA,CAAiB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,eAAA,CAAgB,iBAA6C,EAAA,MAAA,EAAyC,OAAiE,EAAA;AAC5K,IAAM,MAAA,kBAAA,GAAsB,kBAAsC,EAAM,IAAA,iBAAA;AACxE,IAAO,OAAA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AACtC,IAAO,yBAAQ,GAAA","file":"satispay_gateways.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { SatispayPayment, SatispayPaymentType } from './satispay_payments'\n\n\ntype SatispayGatewayType = 'satispay_gateways'\ntype SatispayGatewayRel = ResourceRel & { type: SatispayGatewayType }\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\n\n\nexport type SatispayGatewaySort = Pick<SatispayGateway, 'id' | 'name'> & ResourceSort\n// export type SatispayGatewayFilter = Pick<SatispayGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface SatispayGateway extends Resource {\n\t\n\treadonly type: SatispayGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\t/** \n\t * The Satispay API key auto generated basing on activation code.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tkey_id: string\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/satispay_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tsatispay_payments?: SatispayPayment[] | null\n\n}\n\n\ninterface SatispayGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\ninterface SatispayGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\nclass SatispayGateways extends ApiResource<SatispayGateway> {\n\n\tstatic readonly TYPE: SatispayGatewayType = 'satispay_gateways' as const\n\n\tasync create(resource: SatispayGatewayCreate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.create<SatispayGatewayCreate, SatispayGateway>({ ...resource, type: SatispayGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.update<SatispayGatewayUpdate, SatispayGateway>({ ...resource, type: SatispayGateways.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: SatispayGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<SatispayPayment>, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<SatispayPayment>({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options) as unknown as ListResponse<SatispayPayment>\n\t}\n\n\n\tisSatispayGateway(resource: any): resource is SatispayGateway {\n\t\treturn resource.type && (resource.type === SatispayGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayGatewayRel {\n\t\treturn super.relationshipOneToOne<SatispayGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayGatewayRel[] {\n\t\treturn super.relationshipOneToMany<SatispayGatewayRel>(...ids)\n\t}\n\n\n\ttype(): SatispayGatewayType {\n\t\treturn SatispayGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayGateways()\nexport default instance\n\nexport type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate, SatispayGatewayType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/satispay_gateways.ts"],"names":[],"mappings":";;AAiFA,MAAM,yBAAyB,WAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA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7D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,gBAAiB,CAAA,IAAA;AAAA;AAC7D,EAGA,aAAa,EAAoD,EAAA;AAChE,IAAO,OAAA,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA;AACzD,EAEA,sBAAsB,GAAqC,EAAA;AAC1D,IAAO,OAAA,KAAA,CAAM,qBAA0C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC9D,EAGA,IAA4B,GAAA;AAC3B,IAAA,OAAO,gBAAiB,CAAA,IAAA;AAAA;AAG1B;AAGA,MAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","file":"satispay_gateways.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { SatispayPayment, SatispayPaymentType } from './satispay_payments'\n\n\ntype SatispayGatewayType = 'satispay_gateways'\ntype SatispayGatewayRel = ResourceRel & { type: SatispayGatewayType }\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\n\n\nexport type SatispayGatewaySort = Pick<SatispayGateway, 'id' | 'name'> & ResourceSort\n// export type SatispayGatewayFilter = Pick<SatispayGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface SatispayGateway extends Resource {\n\t\n\treadonly type: SatispayGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\t/** \n\t * The Satispay API key auto generated basing on activation code.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tkey_id: string\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/satispay_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tsatispay_payments?: SatispayPayment[] | null\n\n}\n\n\ninterface SatispayGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\ninterface SatispayGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\nclass SatispayGateways extends ApiResource<SatispayGateway> {\n\n\tstatic readonly TYPE: SatispayGatewayType = 'satispay_gateways' as const\n\n\tasync create(resource: SatispayGatewayCreate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.create<SatispayGatewayCreate, SatispayGateway>({ ...resource, type: SatispayGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.update<SatispayGatewayUpdate, SatispayGateway>({ ...resource, type: SatispayGateways.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: SatispayGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<SatispayPayment>, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<SatispayPayment>({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options) as unknown as ListResponse<SatispayPayment>\n\t}\n\n\n\tisSatispayGateway(resource: any): resource is SatispayGateway {\n\t\treturn resource.type && (resource.type === SatispayGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayGatewayRel {\n\t\treturn super.relationshipOneToOne<SatispayGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayGatewayRel[] {\n\t\treturn super.relationshipOneToMany<SatispayGatewayRel>(...ids)\n\t}\n\n\n\ttype(): SatispayGatewayType {\n\t\treturn SatispayGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayGateways()\nexport default instance\n\nexport type { SatispayGateways, SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate, SatispayGatewayType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/satispay_payments.ts"],"names":["ApiResource"],"mappings":";;;;AAqGA,MAAM,yBAAyBA,oBAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GA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esConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype SatispayPaymentType = 'satispay_payments'\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type SatispayPaymentSort = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceSort\n// export type SatispayPaymentFilter = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceFilter\n\n\ninterface SatispayPayment extends Resource {\n\t\n\treadonly type: SatispayPaymentType\n\n\t/** \n\t * The payment unique identifier.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The Satispay payment status.\n\t * @example ```\"PENDING\"```\n\t */\n\tstatus?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Redirect url to the payment page.\n\t * @example ```\"https://online.satispay.com/pay/xxxx-yyyy-zzzz?redirect_url={redirect_url}\"```\n\t */\n\tpayment_url?: string | null\n\t/** \n\t * The Satispay payment response, used to fetch internal data.\n\t * @example ```{\"foo\":\"bar\"}```\n\t */\n\tpayment_response?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface SatispayPaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface SatispayPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Send this attribute if you want to refresh all the pending transactions, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass SatispayPayments extends ApiResource<SatispayPayment> {\n\n\tstatic readonly TYPE: SatispayPaymentType = 'satispay_payments' as const\n\n\tasync create(resource: SatispayPaymentCreate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.create<SatispayPaymentCreate, SatispayPayment>({ ...resource, type: SatispayPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayPaymentUpdate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ ...resource, type: SatispayPayments.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: SatispayPayments.TYPE } : id, options)\n\t}\n\n\tasync order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `satispay_payments/${_satispayPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(satispayPaymentId: string | SatispayPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_payments/${_satispayPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _refresh(id: string | SatispayPayment, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ id: (typeof id === 'string')? id: id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisSatispayPayment(resource: any): resource is SatispayPayment {\n\t\treturn resource.type && (resource.type === SatispayPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayPaymentRel {\n\t\treturn super.relationshipOneToOne<SatispayPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayPaymentRel[] {\n\t\treturn super.relationshipOneToMany<SatispayPaymentRel>(...ids)\n\t}\n\n\n\ttype(): SatispayPaymentType {\n\t\treturn SatispayPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayPayments()\nexport default instance\n\nexport type { SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate, SatispayPaymentType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/satispay_payments.ts"],"names":["ApiResource"],"mappings":";;;;AAqGA,MAAM,yBAAyBA,oBAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mB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ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype SatispayPaymentType = 'satispay_payments'\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type SatispayPaymentSort = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceSort\n// export type SatispayPaymentFilter = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceFilter\n\n\ninterface SatispayPayment extends Resource {\n\t\n\treadonly type: SatispayPaymentType\n\n\t/** \n\t * The payment unique identifier.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The Satispay payment status.\n\t * @example ```\"PENDING\"```\n\t */\n\tstatus?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Redirect url to the payment page.\n\t * @example ```\"https://online.satispay.com/pay/xxxx-yyyy-zzzz?redirect_url={redirect_url}\"```\n\t */\n\tpayment_url?: string | null\n\t/** \n\t * The Satispay payment response, used to fetch internal data.\n\t * @example ```{\"foo\":\"bar\"}```\n\t */\n\tpayment_response?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface SatispayPaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface SatispayPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Send this attribute if you want to refresh all the pending transactions, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass SatispayPayments extends ApiResource<SatispayPayment> {\n\n\tstatic readonly TYPE: SatispayPaymentType = 'satispay_payments' as const\n\n\tasync create(resource: SatispayPaymentCreate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.create<SatispayPaymentCreate, SatispayPayment>({ ...resource, type: SatispayPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayPaymentUpdate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ ...resource, type: SatispayPayments.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: SatispayPayments.TYPE } : id, options)\n\t}\n\n\tasync order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `satispay_payments/${_satispayPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(satispayPaymentId: string | SatispayPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_payments/${_satispayPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _refresh(id: string | SatispayPayment, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ id: (typeof id === 'string')? id: id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisSatispayPayment(resource: any): resource is SatispayPayment {\n\t\treturn resource.type && (resource.type === SatispayPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayPaymentRel {\n\t\treturn super.relationshipOneToOne<SatispayPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayPaymentRel[] {\n\t\treturn super.relationshipOneToMany<SatispayPaymentRel>(...ids)\n\t}\n\n\n\ttype(): SatispayPaymentType {\n\t\treturn SatispayPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayPayments()\nexport default instance\n\nexport type { SatispayPayments, SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate, SatispayPaymentType }\n"]}
@@ -1,4 +1,4 @@
1
- export { hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, jJ as SatispayPaymentType, hp as SatispayPaymentUpdate, bg as default } from '../api-DmIZO_Np.cjs';
1
+ export { js as SatispayPayment, jt as SatispayPaymentCreate, jv as SatispayPaymentSort, lM as SatispayPaymentType, ju as SatispayPaymentUpdate, cO as SatispayPayments, cN as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
- import '../interceptor-5MISI1yn.cjs';
3
+ import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, jJ as SatispayPaymentType, hp as SatispayPaymentUpdate, bg as default } from '../api-DDgIE2i8.js';
1
+ export { js as SatispayPayment, jt as SatispayPaymentCreate, jv as SatispayPaymentSort, lM as SatispayPaymentType, ju as SatispayPaymentUpdate, cO as SatispayPayments, cN as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
- import '../interceptor-5MISI1yn.js';
3
+ import '../interceptor-k15jXzf0.js';
4
4
  import '../types.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/satispay_payments.ts"],"names":[],"mappings":";;AAqGA,MAAM,yBAAyB,WAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EA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AAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,gBAAiB,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC/K,EAGA,kBAAkB,QAA4C,EAAA;AAC7D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,gBAAiB,CAAA,IAAA;AAAA;AAC7D,EAGA,aAAa,EAAoD,EAAA;AAChE,IAAO,OAAA,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA;AACzD,EAEA,sBAAsB,GAAqC,EAAA;AAC1D,IAAO,OAAA,KAAA,CAAM,qBAA0C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC9D,EAGA,IAA4B,GAAA;AAC3B,IAAA,OAAO,gBAAiB,CAAA,IAAA;AAAA;AAG1B;AAGA,MAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","file":"satispay_payments.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype SatispayPaymentType = 'satispay_payments'\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type SatispayPaymentSort = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceSort\n// export type SatispayPaymentFilter = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceFilter\n\n\ninterface SatispayPayment extends Resource {\n\t\n\treadonly type: SatispayPaymentType\n\n\t/** \n\t * The payment unique identifier.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The Satispay payment status.\n\t * @example ```\"PENDING\"```\n\t */\n\tstatus?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Redirect url to the payment page.\n\t * @example ```\"https://online.satispay.com/pay/xxxx-yyyy-zzzz?redirect_url={redirect_url}\"```\n\t */\n\tpayment_url?: string | null\n\t/** \n\t * The Satispay payment response, used to fetch internal data.\n\t * @example ```{\"foo\":\"bar\"}```\n\t */\n\tpayment_response?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface SatispayPaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface SatispayPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Send this attribute if you want to refresh all the pending transactions, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass SatispayPayments extends ApiResource<SatispayPayment> {\n\n\tstatic readonly TYPE: SatispayPaymentType = 'satispay_payments' as const\n\n\tasync create(resource: SatispayPaymentCreate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.create<SatispayPaymentCreate, SatispayPayment>({ ...resource, type: SatispayPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayPaymentUpdate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ ...resource, type: SatispayPayments.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: SatispayPayments.TYPE } : id, options)\n\t}\n\n\tasync order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `satispay_payments/${_satispayPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(satispayPaymentId: string | SatispayPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_payments/${_satispayPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _refresh(id: string | SatispayPayment, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ id: (typeof id === 'string')? id: id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisSatispayPayment(resource: any): resource is SatispayPayment {\n\t\treturn resource.type && (resource.type === SatispayPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayPaymentRel {\n\t\treturn super.relationshipOneToOne<SatispayPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayPaymentRel[] {\n\t\treturn super.relationshipOneToMany<SatispayPaymentRel>(...ids)\n\t}\n\n\n\ttype(): SatispayPaymentType {\n\t\treturn SatispayPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayPayments()\nexport default instance\n\nexport type { SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate, SatispayPaymentType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/satispay_payments.ts"],"names":[],"mappings":";;AAqGA,MAAM,yBAAyB,WAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,gBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAA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O,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,gBAAiB,CAAA,IAAA,EAAM,UAAU,IAAK,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC/K,EAGA,kBAAkB,QAA4C,EAAA;AAC7D,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,gBAAiB,CAAA,IAAA;AAAA;AAC7D,EAGA,aAAa,EAAoD,EAAA;AAChE,IAAO,OAAA,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA;AACzD,EAEA,sBAAsB,GAAqC,EAAA;AAC1D,IAAO,OAAA,KAAA,CAAM,qBAA0C,CAAA,GAAG,GAAG,CAAA;AAAA;AAC9D,EAGA,IAA4B,GAAA;AAC3B,IAAA,OAAO,gBAAiB,CAAA,IAAA;AAAA;AAG1B;AAGA,MAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","file":"satispay_payments.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype SatispayPaymentType = 'satispay_payments'\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type SatispayPaymentSort = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceSort\n// export type SatispayPaymentFilter = Pick<SatispayPayment, 'id' | 'flow' | 'status'> & ResourceFilter\n\n\ninterface SatispayPayment extends Resource {\n\t\n\treadonly type: SatispayPaymentType\n\n\t/** \n\t * The payment unique identifier.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpayment_id?: string | null\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The Satispay payment status.\n\t * @example ```\"PENDING\"```\n\t */\n\tstatus?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Redirect url to the payment page.\n\t * @example ```\"https://online.satispay.com/pay/xxxx-yyyy-zzzz?redirect_url={redirect_url}\"```\n\t */\n\tpayment_url?: string | null\n\t/** \n\t * The Satispay payment response, used to fetch internal data.\n\t * @example ```{\"foo\":\"bar\"}```\n\t */\n\tpayment_response?: Record<string, any> | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface SatispayPaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The Satispay payment flow, inspect gateway API details for more information.\n\t * @example ```\"MATCH_CODE\"```\n\t */\n\tflow?: string | null\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface SatispayPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The url to redirect the customer after the payment flow is completed.\n\t * @example ```\"http://commercelayer.dev/satispay/redirect\"```\n\t */\n\tredirect_url?: string | null\n\t/** \n\t * Send this attribute if you want to refresh all the pending transactions, can be used as webhooks fallback logic.\n\t * @example ```true```\n\t */\n\t_refresh?: boolean | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass SatispayPayments extends ApiResource<SatispayPayment> {\n\n\tstatic readonly TYPE: SatispayPaymentType = 'satispay_payments' as const\n\n\tasync create(resource: SatispayPaymentCreate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.create<SatispayPaymentCreate, SatispayPayment>({ ...resource, type: SatispayPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayPaymentUpdate, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ ...resource, type: SatispayPayments.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: SatispayPayments.TYPE } : id, options)\n\t}\n\n\tasync order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `satispay_payments/${_satispayPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(satispayPaymentId: string | SatispayPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayPaymentId = (satispayPaymentId as SatispayPayment).id || satispayPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_payments/${_satispayPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _refresh(id: string | SatispayPayment, params?: QueryParamsRetrieve<SatispayPayment>, options?: ResourcesConfig): Promise<SatispayPayment> {\n\t\treturn this.resources.update<SatispayPaymentUpdate, SatispayPayment>({ id: (typeof id === 'string')? id: id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options)\n\t}\n\n\n\tisSatispayPayment(resource: any): resource is SatispayPayment {\n\t\treturn resource.type && (resource.type === SatispayPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayPaymentRel {\n\t\treturn super.relationshipOneToOne<SatispayPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayPaymentRel[] {\n\t\treturn super.relationshipOneToMany<SatispayPaymentRel>(...ids)\n\t}\n\n\n\ttype(): SatispayPaymentType {\n\t\treturn SatispayPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayPayments()\nexport default instance\n\nexport type { SatispayPayments, SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate, SatispayPaymentType }\n"]}