@commercelayer/sdk 7.0.0-rc.3 → 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 (564) 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 +1 -1
  5. package/lib/api.d.ts +1 -1
  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/commercelayer.cjs +2 -1
  13. package/lib/commercelayer.cjs.map +1 -1
  14. package/lib/commercelayer.d.cts +4 -4
  15. package/lib/commercelayer.d.ts +4 -4
  16. package/lib/commercelayer.js +2 -2
  17. package/lib/commercelayer.js.map +1 -1
  18. package/lib/enum.d.cts +1 -1
  19. package/lib/enum.d.ts +1 -1
  20. package/lib/index.d.cts +1 -1
  21. package/lib/index.d.ts +1 -1
  22. package/lib/jsonapi.d.cts +1 -1
  23. package/lib/jsonapi.d.ts +1 -1
  24. package/lib/model.d.cts +1 -1
  25. package/lib/model.d.ts +1 -1
  26. package/lib/query.d.cts +1 -1
  27. package/lib/query.d.ts +1 -1
  28. package/lib/resource.cjs +7 -6
  29. package/lib/resource.cjs.map +1 -1
  30. package/lib/resource.d.cts +1 -1
  31. package/lib/resource.d.ts +1 -1
  32. package/lib/resource.js +7 -6
  33. package/lib/resource.js.map +1 -1
  34. package/lib/resources/addresses.cjs.map +1 -1
  35. package/lib/resources/addresses.d.cts +1 -1
  36. package/lib/resources/addresses.d.ts +1 -1
  37. package/lib/resources/addresses.js.map +1 -1
  38. package/lib/resources/adjustments.cjs.map +1 -1
  39. package/lib/resources/adjustments.d.cts +1 -1
  40. package/lib/resources/adjustments.d.ts +1 -1
  41. package/lib/resources/adjustments.js.map +1 -1
  42. package/lib/resources/adyen_gateways.cjs.map +1 -1
  43. package/lib/resources/adyen_gateways.d.cts +1 -1
  44. package/lib/resources/adyen_gateways.d.ts +1 -1
  45. package/lib/resources/adyen_gateways.js.map +1 -1
  46. package/lib/resources/adyen_payments.cjs.map +1 -1
  47. package/lib/resources/adyen_payments.d.cts +1 -1
  48. package/lib/resources/adyen_payments.d.ts +1 -1
  49. package/lib/resources/adyen_payments.js.map +1 -1
  50. package/lib/resources/applications.cjs.map +1 -1
  51. package/lib/resources/applications.d.cts +1 -1
  52. package/lib/resources/applications.d.ts +1 -1
  53. package/lib/resources/applications.js.map +1 -1
  54. package/lib/resources/attachments.cjs.map +1 -1
  55. package/lib/resources/attachments.d.cts +1 -1
  56. package/lib/resources/attachments.d.ts +1 -1
  57. package/lib/resources/attachments.js.map +1 -1
  58. package/lib/resources/authorizations.cjs.map +1 -1
  59. package/lib/resources/authorizations.d.cts +1 -1
  60. package/lib/resources/authorizations.d.ts +1 -1
  61. package/lib/resources/authorizations.js.map +1 -1
  62. package/lib/resources/avalara_accounts.cjs.map +1 -1
  63. package/lib/resources/avalara_accounts.d.cts +1 -1
  64. package/lib/resources/avalara_accounts.d.ts +1 -1
  65. package/lib/resources/avalara_accounts.js.map +1 -1
  66. package/lib/resources/axerve_gateways.cjs.map +1 -1
  67. package/lib/resources/axerve_gateways.d.cts +1 -1
  68. package/lib/resources/axerve_gateways.d.ts +1 -1
  69. package/lib/resources/axerve_gateways.js.map +1 -1
  70. package/lib/resources/axerve_payments.cjs.map +1 -1
  71. package/lib/resources/axerve_payments.d.cts +1 -1
  72. package/lib/resources/axerve_payments.d.ts +1 -1
  73. package/lib/resources/axerve_payments.js.map +1 -1
  74. package/lib/resources/bing_geocoders.cjs.map +1 -1
  75. package/lib/resources/bing_geocoders.d.cts +1 -1
  76. package/lib/resources/bing_geocoders.d.ts +1 -1
  77. package/lib/resources/bing_geocoders.js.map +1 -1
  78. package/lib/resources/braintree_gateways.cjs.map +1 -1
  79. package/lib/resources/braintree_gateways.d.cts +1 -1
  80. package/lib/resources/braintree_gateways.d.ts +1 -1
  81. package/lib/resources/braintree_gateways.js.map +1 -1
  82. package/lib/resources/braintree_payments.cjs.map +1 -1
  83. package/lib/resources/braintree_payments.d.cts +1 -1
  84. package/lib/resources/braintree_payments.d.ts +1 -1
  85. package/lib/resources/braintree_payments.js.map +1 -1
  86. package/lib/resources/bundles.cjs.map +1 -1
  87. package/lib/resources/bundles.d.cts +1 -1
  88. package/lib/resources/bundles.d.ts +1 -1
  89. package/lib/resources/bundles.js.map +1 -1
  90. package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -1
  91. package/lib/resources/buy_x_pay_y_promotions.d.cts +1 -1
  92. package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
  93. package/lib/resources/buy_x_pay_y_promotions.js.map +1 -1
  94. package/lib/resources/captures.cjs.map +1 -1
  95. package/lib/resources/captures.d.cts +1 -1
  96. package/lib/resources/captures.d.ts +1 -1
  97. package/lib/resources/captures.js.map +1 -1
  98. package/lib/resources/carrier_accounts.cjs.map +1 -1
  99. package/lib/resources/carrier_accounts.d.cts +1 -1
  100. package/lib/resources/carrier_accounts.d.ts +1 -1
  101. package/lib/resources/carrier_accounts.js.map +1 -1
  102. package/lib/resources/checkout_com_gateways.cjs.map +1 -1
  103. package/lib/resources/checkout_com_gateways.d.cts +1 -1
  104. package/lib/resources/checkout_com_gateways.d.ts +1 -1
  105. package/lib/resources/checkout_com_gateways.js.map +1 -1
  106. package/lib/resources/checkout_com_payments.cjs.map +1 -1
  107. package/lib/resources/checkout_com_payments.d.cts +1 -1
  108. package/lib/resources/checkout_com_payments.d.ts +1 -1
  109. package/lib/resources/checkout_com_payments.js.map +1 -1
  110. package/lib/resources/cleanups.cjs.map +1 -1
  111. package/lib/resources/cleanups.d.cts +1 -1
  112. package/lib/resources/cleanups.d.ts +1 -1
  113. package/lib/resources/cleanups.js.map +1 -1
  114. package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -1
  115. package/lib/resources/coupon_codes_promotion_rules.d.cts +1 -1
  116. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
  117. package/lib/resources/coupon_codes_promotion_rules.js.map +1 -1
  118. package/lib/resources/coupon_recipients.cjs.map +1 -1
  119. package/lib/resources/coupon_recipients.d.cts +1 -1
  120. package/lib/resources/coupon_recipients.d.ts +1 -1
  121. package/lib/resources/coupon_recipients.js.map +1 -1
  122. package/lib/resources/coupons.cjs.map +1 -1
  123. package/lib/resources/coupons.d.cts +1 -1
  124. package/lib/resources/coupons.d.ts +1 -1
  125. package/lib/resources/coupons.js.map +1 -1
  126. package/lib/resources/custom_promotion_rules.cjs.map +1 -1
  127. package/lib/resources/custom_promotion_rules.d.cts +1 -1
  128. package/lib/resources/custom_promotion_rules.d.ts +1 -1
  129. package/lib/resources/custom_promotion_rules.js.map +1 -1
  130. package/lib/resources/customer_addresses.cjs.map +1 -1
  131. package/lib/resources/customer_addresses.d.cts +1 -1
  132. package/lib/resources/customer_addresses.d.ts +1 -1
  133. package/lib/resources/customer_addresses.js.map +1 -1
  134. package/lib/resources/customer_groups.cjs.map +1 -1
  135. package/lib/resources/customer_groups.d.cts +1 -1
  136. package/lib/resources/customer_groups.d.ts +1 -1
  137. package/lib/resources/customer_groups.js.map +1 -1
  138. package/lib/resources/customer_password_resets.cjs.map +1 -1
  139. package/lib/resources/customer_password_resets.d.cts +1 -1
  140. package/lib/resources/customer_password_resets.d.ts +1 -1
  141. package/lib/resources/customer_password_resets.js.map +1 -1
  142. package/lib/resources/customer_payment_sources.cjs.map +1 -1
  143. package/lib/resources/customer_payment_sources.d.cts +1 -1
  144. package/lib/resources/customer_payment_sources.d.ts +1 -1
  145. package/lib/resources/customer_payment_sources.js.map +1 -1
  146. package/lib/resources/customer_subscriptions.cjs.map +1 -1
  147. package/lib/resources/customer_subscriptions.d.cts +1 -1
  148. package/lib/resources/customer_subscriptions.d.ts +1 -1
  149. package/lib/resources/customer_subscriptions.js.map +1 -1
  150. package/lib/resources/customers.cjs.map +1 -1
  151. package/lib/resources/customers.d.cts +1 -1
  152. package/lib/resources/customers.d.ts +1 -1
  153. package/lib/resources/customers.js.map +1 -1
  154. package/lib/resources/delivery_lead_times.cjs.map +1 -1
  155. package/lib/resources/delivery_lead_times.d.cts +1 -1
  156. package/lib/resources/delivery_lead_times.d.ts +1 -1
  157. package/lib/resources/delivery_lead_times.js.map +1 -1
  158. package/lib/resources/discount_engine_items.cjs.map +1 -1
  159. package/lib/resources/discount_engine_items.d.cts +1 -1
  160. package/lib/resources/discount_engine_items.d.ts +1 -1
  161. package/lib/resources/discount_engine_items.js.map +1 -1
  162. package/lib/resources/discount_engines.cjs.map +1 -1
  163. package/lib/resources/discount_engines.d.cts +1 -1
  164. package/lib/resources/discount_engines.d.ts +1 -1
  165. package/lib/resources/discount_engines.js.map +1 -1
  166. package/lib/resources/easypost_pickups.cjs.map +1 -1
  167. package/lib/resources/easypost_pickups.d.cts +1 -1
  168. package/lib/resources/easypost_pickups.d.ts +1 -1
  169. package/lib/resources/easypost_pickups.js.map +1 -1
  170. package/lib/resources/event_callbacks.cjs.map +1 -1
  171. package/lib/resources/event_callbacks.d.cts +1 -1
  172. package/lib/resources/event_callbacks.d.ts +1 -1
  173. package/lib/resources/event_callbacks.js.map +1 -1
  174. package/lib/resources/events.cjs.map +1 -1
  175. package/lib/resources/events.d.cts +1 -1
  176. package/lib/resources/events.d.ts +1 -1
  177. package/lib/resources/events.js.map +1 -1
  178. package/lib/resources/exports.cjs.map +1 -1
  179. package/lib/resources/exports.d.cts +1 -1
  180. package/lib/resources/exports.d.ts +1 -1
  181. package/lib/resources/exports.js.map +1 -1
  182. package/lib/resources/external_gateways.cjs.map +1 -1
  183. package/lib/resources/external_gateways.d.cts +1 -1
  184. package/lib/resources/external_gateways.d.ts +1 -1
  185. package/lib/resources/external_gateways.js.map +1 -1
  186. package/lib/resources/external_payments.cjs.map +1 -1
  187. package/lib/resources/external_payments.d.cts +1 -1
  188. package/lib/resources/external_payments.d.ts +1 -1
  189. package/lib/resources/external_payments.js.map +1 -1
  190. package/lib/resources/external_promotions.cjs.map +1 -1
  191. package/lib/resources/external_promotions.d.cts +1 -1
  192. package/lib/resources/external_promotions.d.ts +1 -1
  193. package/lib/resources/external_promotions.js.map +1 -1
  194. package/lib/resources/external_tax_calculators.cjs.map +1 -1
  195. package/lib/resources/external_tax_calculators.d.cts +1 -1
  196. package/lib/resources/external_tax_calculators.d.ts +1 -1
  197. package/lib/resources/external_tax_calculators.js.map +1 -1
  198. package/lib/resources/fixed_amount_promotions.cjs.map +1 -1
  199. package/lib/resources/fixed_amount_promotions.d.cts +1 -1
  200. package/lib/resources/fixed_amount_promotions.d.ts +1 -1
  201. package/lib/resources/fixed_amount_promotions.js.map +1 -1
  202. package/lib/resources/fixed_price_promotions.cjs.map +1 -1
  203. package/lib/resources/fixed_price_promotions.d.cts +1 -1
  204. package/lib/resources/fixed_price_promotions.d.ts +1 -1
  205. package/lib/resources/fixed_price_promotions.js.map +1 -1
  206. package/lib/resources/flex_promotions.cjs.map +1 -1
  207. package/lib/resources/flex_promotions.d.cts +1 -1
  208. package/lib/resources/flex_promotions.d.ts +1 -1
  209. package/lib/resources/flex_promotions.js.map +1 -1
  210. package/lib/resources/free_gift_promotions.cjs.map +1 -1
  211. package/lib/resources/free_gift_promotions.d.cts +1 -1
  212. package/lib/resources/free_gift_promotions.d.ts +1 -1
  213. package/lib/resources/free_gift_promotions.js.map +1 -1
  214. package/lib/resources/free_shipping_promotions.cjs.map +1 -1
  215. package/lib/resources/free_shipping_promotions.d.cts +1 -1
  216. package/lib/resources/free_shipping_promotions.d.ts +1 -1
  217. package/lib/resources/free_shipping_promotions.js.map +1 -1
  218. package/lib/resources/geocoders.cjs.map +1 -1
  219. package/lib/resources/geocoders.d.cts +1 -1
  220. package/lib/resources/geocoders.d.ts +1 -1
  221. package/lib/resources/geocoders.js.map +1 -1
  222. package/lib/resources/gift_card_recipients.cjs.map +1 -1
  223. package/lib/resources/gift_card_recipients.d.cts +1 -1
  224. package/lib/resources/gift_card_recipients.d.ts +1 -1
  225. package/lib/resources/gift_card_recipients.js.map +1 -1
  226. package/lib/resources/gift_cards.cjs.map +1 -1
  227. package/lib/resources/gift_cards.d.cts +1 -1
  228. package/lib/resources/gift_cards.d.ts +1 -1
  229. package/lib/resources/gift_cards.js.map +1 -1
  230. package/lib/resources/google_geocoders.cjs.map +1 -1
  231. package/lib/resources/google_geocoders.d.cts +1 -1
  232. package/lib/resources/google_geocoders.d.ts +1 -1
  233. package/lib/resources/google_geocoders.js.map +1 -1
  234. package/lib/resources/imports.cjs.map +1 -1
  235. package/lib/resources/imports.d.cts +1 -1
  236. package/lib/resources/imports.d.ts +1 -1
  237. package/lib/resources/imports.js.map +1 -1
  238. package/lib/resources/in_stock_subscriptions.cjs.map +1 -1
  239. package/lib/resources/in_stock_subscriptions.d.cts +1 -1
  240. package/lib/resources/in_stock_subscriptions.d.ts +1 -1
  241. package/lib/resources/in_stock_subscriptions.js.map +1 -1
  242. package/lib/resources/inventory_models.cjs.map +1 -1
  243. package/lib/resources/inventory_models.d.cts +1 -1
  244. package/lib/resources/inventory_models.d.ts +1 -1
  245. package/lib/resources/inventory_models.js.map +1 -1
  246. package/lib/resources/inventory_return_locations.cjs.map +1 -1
  247. package/lib/resources/inventory_return_locations.d.cts +1 -1
  248. package/lib/resources/inventory_return_locations.d.ts +1 -1
  249. package/lib/resources/inventory_return_locations.js.map +1 -1
  250. package/lib/resources/inventory_stock_locations.cjs.map +1 -1
  251. package/lib/resources/inventory_stock_locations.d.cts +1 -1
  252. package/lib/resources/inventory_stock_locations.d.ts +1 -1
  253. package/lib/resources/inventory_stock_locations.js.map +1 -1
  254. package/lib/resources/klarna_gateways.cjs.map +1 -1
  255. package/lib/resources/klarna_gateways.d.cts +1 -1
  256. package/lib/resources/klarna_gateways.d.ts +1 -1
  257. package/lib/resources/klarna_gateways.js.map +1 -1
  258. package/lib/resources/klarna_payments.cjs.map +1 -1
  259. package/lib/resources/klarna_payments.d.cts +1 -1
  260. package/lib/resources/klarna_payments.d.ts +1 -1
  261. package/lib/resources/klarna_payments.js.map +1 -1
  262. package/lib/resources/line_item_options.cjs.map +1 -1
  263. package/lib/resources/line_item_options.d.cts +1 -1
  264. package/lib/resources/line_item_options.d.ts +1 -1
  265. package/lib/resources/line_item_options.js.map +1 -1
  266. package/lib/resources/line_items.cjs.map +1 -1
  267. package/lib/resources/line_items.d.cts +1 -1
  268. package/lib/resources/line_items.d.ts +1 -1
  269. package/lib/resources/line_items.js.map +1 -1
  270. package/lib/resources/links.cjs.map +1 -1
  271. package/lib/resources/links.d.cts +1 -1
  272. package/lib/resources/links.d.ts +1 -1
  273. package/lib/resources/links.js.map +1 -1
  274. package/lib/resources/manual_gateways.cjs.map +1 -1
  275. package/lib/resources/manual_gateways.d.cts +1 -1
  276. package/lib/resources/manual_gateways.d.ts +1 -1
  277. package/lib/resources/manual_gateways.js.map +1 -1
  278. package/lib/resources/manual_tax_calculators.cjs.map +1 -1
  279. package/lib/resources/manual_tax_calculators.d.cts +1 -1
  280. package/lib/resources/manual_tax_calculators.d.ts +1 -1
  281. package/lib/resources/manual_tax_calculators.js.map +1 -1
  282. package/lib/resources/markets.cjs +4 -0
  283. package/lib/resources/markets.cjs.map +1 -1
  284. package/lib/resources/markets.d.cts +1 -1
  285. package/lib/resources/markets.d.ts +1 -1
  286. package/lib/resources/markets.js +4 -0
  287. package/lib/resources/markets.js.map +1 -1
  288. package/lib/resources/merchants.cjs.map +1 -1
  289. package/lib/resources/merchants.d.cts +1 -1
  290. package/lib/resources/merchants.d.ts +1 -1
  291. package/lib/resources/merchants.js.map +1 -1
  292. package/lib/resources/notifications.cjs.map +1 -1
  293. package/lib/resources/notifications.d.cts +1 -1
  294. package/lib/resources/notifications.d.ts +1 -1
  295. package/lib/resources/notifications.js.map +1 -1
  296. package/lib/resources/order_amount_promotion_rules.cjs.map +1 -1
  297. package/lib/resources/order_amount_promotion_rules.d.cts +1 -1
  298. package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
  299. package/lib/resources/order_amount_promotion_rules.js.map +1 -1
  300. package/lib/resources/order_copies.cjs.map +1 -1
  301. package/lib/resources/order_copies.d.cts +1 -1
  302. package/lib/resources/order_copies.d.ts +1 -1
  303. package/lib/resources/order_copies.js.map +1 -1
  304. package/lib/resources/order_factories.cjs.map +1 -1
  305. package/lib/resources/order_factories.d.cts +1 -1
  306. package/lib/resources/order_factories.d.ts +1 -1
  307. package/lib/resources/order_factories.js.map +1 -1
  308. package/lib/resources/order_subscription_items.cjs.map +1 -1
  309. package/lib/resources/order_subscription_items.d.cts +1 -1
  310. package/lib/resources/order_subscription_items.d.ts +1 -1
  311. package/lib/resources/order_subscription_items.js.map +1 -1
  312. package/lib/resources/order_subscriptions.cjs.map +1 -1
  313. package/lib/resources/order_subscriptions.d.cts +1 -1
  314. package/lib/resources/order_subscriptions.d.ts +1 -1
  315. package/lib/resources/order_subscriptions.js.map +1 -1
  316. package/lib/resources/orders.cjs +4 -0
  317. package/lib/resources/orders.cjs.map +1 -1
  318. package/lib/resources/orders.d.cts +1 -1
  319. package/lib/resources/orders.d.ts +1 -1
  320. package/lib/resources/orders.js +4 -0
  321. package/lib/resources/orders.js.map +1 -1
  322. package/lib/resources/organizations.cjs.map +1 -1
  323. package/lib/resources/organizations.d.cts +1 -1
  324. package/lib/resources/organizations.d.ts +1 -1
  325. package/lib/resources/organizations.js.map +1 -1
  326. package/lib/resources/packages.cjs.map +1 -1
  327. package/lib/resources/packages.d.cts +1 -1
  328. package/lib/resources/packages.d.ts +1 -1
  329. package/lib/resources/packages.js.map +1 -1
  330. package/lib/resources/parcel_line_items.cjs.map +1 -1
  331. package/lib/resources/parcel_line_items.d.cts +1 -1
  332. package/lib/resources/parcel_line_items.d.ts +1 -1
  333. package/lib/resources/parcel_line_items.js.map +1 -1
  334. package/lib/resources/parcels.cjs.map +1 -1
  335. package/lib/resources/parcels.d.cts +1 -1
  336. package/lib/resources/parcels.d.ts +1 -1
  337. package/lib/resources/parcels.js.map +1 -1
  338. package/lib/resources/payment_gateways.cjs.map +1 -1
  339. package/lib/resources/payment_gateways.d.cts +1 -1
  340. package/lib/resources/payment_gateways.d.ts +1 -1
  341. package/lib/resources/payment_gateways.js.map +1 -1
  342. package/lib/resources/payment_methods.cjs.map +1 -1
  343. package/lib/resources/payment_methods.d.cts +1 -1
  344. package/lib/resources/payment_methods.d.ts +1 -1
  345. package/lib/resources/payment_methods.js.map +1 -1
  346. package/lib/resources/payment_options.cjs.map +1 -1
  347. package/lib/resources/payment_options.d.cts +1 -1
  348. package/lib/resources/payment_options.d.ts +1 -1
  349. package/lib/resources/payment_options.js.map +1 -1
  350. package/lib/resources/paypal_gateways.cjs.map +1 -1
  351. package/lib/resources/paypal_gateways.d.cts +1 -1
  352. package/lib/resources/paypal_gateways.d.ts +1 -1
  353. package/lib/resources/paypal_gateways.js.map +1 -1
  354. package/lib/resources/paypal_payments.cjs.map +1 -1
  355. package/lib/resources/paypal_payments.d.cts +1 -1
  356. package/lib/resources/paypal_payments.d.ts +1 -1
  357. package/lib/resources/paypal_payments.js.map +1 -1
  358. package/lib/resources/percentage_discount_promotions.cjs.map +1 -1
  359. package/lib/resources/percentage_discount_promotions.d.cts +1 -1
  360. package/lib/resources/percentage_discount_promotions.d.ts +1 -1
  361. package/lib/resources/percentage_discount_promotions.js.map +1 -1
  362. package/lib/resources/pickups.cjs.map +1 -1
  363. package/lib/resources/pickups.d.cts +1 -1
  364. package/lib/resources/pickups.d.ts +1 -1
  365. package/lib/resources/pickups.js.map +1 -1
  366. package/lib/resources/price_frequency_tiers.cjs.map +1 -1
  367. package/lib/resources/price_frequency_tiers.d.cts +1 -1
  368. package/lib/resources/price_frequency_tiers.d.ts +1 -1
  369. package/lib/resources/price_frequency_tiers.js.map +1 -1
  370. package/lib/resources/price_list_schedulers.cjs.map +1 -1
  371. package/lib/resources/price_list_schedulers.d.cts +1 -1
  372. package/lib/resources/price_list_schedulers.d.ts +1 -1
  373. package/lib/resources/price_list_schedulers.js.map +1 -1
  374. package/lib/resources/price_lists.cjs.map +1 -1
  375. package/lib/resources/price_lists.d.cts +1 -1
  376. package/lib/resources/price_lists.d.ts +1 -1
  377. package/lib/resources/price_lists.js.map +1 -1
  378. package/lib/resources/price_tiers.cjs.map +1 -1
  379. package/lib/resources/price_tiers.d.cts +1 -1
  380. package/lib/resources/price_tiers.d.ts +1 -1
  381. package/lib/resources/price_tiers.js.map +1 -1
  382. package/lib/resources/price_volume_tiers.cjs.map +1 -1
  383. package/lib/resources/price_volume_tiers.d.cts +1 -1
  384. package/lib/resources/price_volume_tiers.d.ts +1 -1
  385. package/lib/resources/price_volume_tiers.js.map +1 -1
  386. package/lib/resources/prices.cjs.map +1 -1
  387. package/lib/resources/prices.d.cts +1 -1
  388. package/lib/resources/prices.d.ts +1 -1
  389. package/lib/resources/prices.js.map +1 -1
  390. package/lib/resources/promotion_rules.cjs.map +1 -1
  391. package/lib/resources/promotion_rules.d.cts +1 -1
  392. package/lib/resources/promotion_rules.d.ts +1 -1
  393. package/lib/resources/promotion_rules.js.map +1 -1
  394. package/lib/resources/promotions.cjs.map +1 -1
  395. package/lib/resources/promotions.d.cts +1 -1
  396. package/lib/resources/promotions.d.ts +1 -1
  397. package/lib/resources/promotions.js.map +1 -1
  398. package/lib/resources/recurring_order_copies.cjs.map +1 -1
  399. package/lib/resources/recurring_order_copies.d.cts +1 -1
  400. package/lib/resources/recurring_order_copies.d.ts +1 -1
  401. package/lib/resources/recurring_order_copies.js.map +1 -1
  402. package/lib/resources/refunds.cjs.map +1 -1
  403. package/lib/resources/refunds.d.cts +1 -1
  404. package/lib/resources/refunds.d.ts +1 -1
  405. package/lib/resources/refunds.js.map +1 -1
  406. package/lib/resources/reserved_stocks.cjs.map +1 -1
  407. package/lib/resources/reserved_stocks.d.cts +1 -1
  408. package/lib/resources/reserved_stocks.d.ts +1 -1
  409. package/lib/resources/reserved_stocks.js.map +1 -1
  410. package/lib/resources/resource_errors.cjs.map +1 -1
  411. package/lib/resources/resource_errors.d.cts +1 -1
  412. package/lib/resources/resource_errors.d.ts +1 -1
  413. package/lib/resources/resource_errors.js.map +1 -1
  414. package/lib/resources/return_line_items.cjs.map +1 -1
  415. package/lib/resources/return_line_items.d.cts +1 -1
  416. package/lib/resources/return_line_items.d.ts +1 -1
  417. package/lib/resources/return_line_items.js.map +1 -1
  418. package/lib/resources/returns.cjs.map +1 -1
  419. package/lib/resources/returns.d.cts +1 -1
  420. package/lib/resources/returns.d.ts +1 -1
  421. package/lib/resources/returns.js.map +1 -1
  422. package/lib/resources/satispay_gateways.cjs.map +1 -1
  423. package/lib/resources/satispay_gateways.d.cts +1 -1
  424. package/lib/resources/satispay_gateways.d.ts +1 -1
  425. package/lib/resources/satispay_gateways.js.map +1 -1
  426. package/lib/resources/satispay_payments.cjs.map +1 -1
  427. package/lib/resources/satispay_payments.d.cts +1 -1
  428. package/lib/resources/satispay_payments.d.ts +1 -1
  429. package/lib/resources/satispay_payments.js.map +1 -1
  430. package/lib/resources/shipments.cjs.map +1 -1
  431. package/lib/resources/shipments.d.cts +1 -1
  432. package/lib/resources/shipments.d.ts +1 -1
  433. package/lib/resources/shipments.js.map +1 -1
  434. package/lib/resources/shipping_categories.cjs.map +1 -1
  435. package/lib/resources/shipping_categories.d.cts +1 -1
  436. package/lib/resources/shipping_categories.d.ts +1 -1
  437. package/lib/resources/shipping_categories.js.map +1 -1
  438. package/lib/resources/shipping_method_tiers.cjs.map +1 -1
  439. package/lib/resources/shipping_method_tiers.d.cts +1 -1
  440. package/lib/resources/shipping_method_tiers.d.ts +1 -1
  441. package/lib/resources/shipping_method_tiers.js.map +1 -1
  442. package/lib/resources/shipping_methods.cjs.map +1 -1
  443. package/lib/resources/shipping_methods.d.cts +1 -1
  444. package/lib/resources/shipping_methods.d.ts +1 -1
  445. package/lib/resources/shipping_methods.js.map +1 -1
  446. package/lib/resources/shipping_weight_tiers.cjs.map +1 -1
  447. package/lib/resources/shipping_weight_tiers.d.cts +1 -1
  448. package/lib/resources/shipping_weight_tiers.d.ts +1 -1
  449. package/lib/resources/shipping_weight_tiers.js.map +1 -1
  450. package/lib/resources/shipping_zones.cjs.map +1 -1
  451. package/lib/resources/shipping_zones.d.cts +1 -1
  452. package/lib/resources/shipping_zones.d.ts +1 -1
  453. package/lib/resources/shipping_zones.js.map +1 -1
  454. package/lib/resources/sku_list_items.cjs.map +1 -1
  455. package/lib/resources/sku_list_items.d.cts +1 -1
  456. package/lib/resources/sku_list_items.d.ts +1 -1
  457. package/lib/resources/sku_list_items.js.map +1 -1
  458. package/lib/resources/sku_list_promotion_rules.cjs.map +1 -1
  459. package/lib/resources/sku_list_promotion_rules.d.cts +1 -1
  460. package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
  461. package/lib/resources/sku_list_promotion_rules.js.map +1 -1
  462. package/lib/resources/sku_lists.cjs.map +1 -1
  463. package/lib/resources/sku_lists.d.cts +1 -1
  464. package/lib/resources/sku_lists.d.ts +1 -1
  465. package/lib/resources/sku_lists.js.map +1 -1
  466. package/lib/resources/sku_options.cjs.map +1 -1
  467. package/lib/resources/sku_options.d.cts +1 -1
  468. package/lib/resources/sku_options.d.ts +1 -1
  469. package/lib/resources/sku_options.js.map +1 -1
  470. package/lib/resources/skus.cjs.map +1 -1
  471. package/lib/resources/skus.d.cts +1 -1
  472. package/lib/resources/skus.d.ts +1 -1
  473. package/lib/resources/skus.js.map +1 -1
  474. package/lib/resources/stock_items.cjs.map +1 -1
  475. package/lib/resources/stock_items.d.cts +1 -1
  476. package/lib/resources/stock_items.d.ts +1 -1
  477. package/lib/resources/stock_items.js.map +1 -1
  478. package/lib/resources/stock_line_items.cjs.map +1 -1
  479. package/lib/resources/stock_line_items.d.cts +1 -1
  480. package/lib/resources/stock_line_items.d.ts +1 -1
  481. package/lib/resources/stock_line_items.js.map +1 -1
  482. package/lib/resources/stock_locations.cjs.map +1 -1
  483. package/lib/resources/stock_locations.d.cts +1 -1
  484. package/lib/resources/stock_locations.d.ts +1 -1
  485. package/lib/resources/stock_locations.js.map +1 -1
  486. package/lib/resources/stock_reservations.cjs.map +1 -1
  487. package/lib/resources/stock_reservations.d.cts +1 -1
  488. package/lib/resources/stock_reservations.d.ts +1 -1
  489. package/lib/resources/stock_reservations.js.map +1 -1
  490. package/lib/resources/stock_transfers.cjs.map +1 -1
  491. package/lib/resources/stock_transfers.d.cts +1 -1
  492. package/lib/resources/stock_transfers.d.ts +1 -1
  493. package/lib/resources/stock_transfers.js.map +1 -1
  494. package/lib/resources/stores.cjs.map +1 -1
  495. package/lib/resources/stores.d.cts +1 -1
  496. package/lib/resources/stores.d.ts +1 -1
  497. package/lib/resources/stores.js.map +1 -1
  498. package/lib/resources/stripe_gateways.cjs.map +1 -1
  499. package/lib/resources/stripe_gateways.d.cts +1 -1
  500. package/lib/resources/stripe_gateways.d.ts +1 -1
  501. package/lib/resources/stripe_gateways.js.map +1 -1
  502. package/lib/resources/stripe_payments.cjs.map +1 -1
  503. package/lib/resources/stripe_payments.d.cts +1 -1
  504. package/lib/resources/stripe_payments.d.ts +1 -1
  505. package/lib/resources/stripe_payments.js.map +1 -1
  506. package/lib/resources/stripe_tax_accounts.cjs.map +1 -1
  507. package/lib/resources/stripe_tax_accounts.d.cts +1 -1
  508. package/lib/resources/stripe_tax_accounts.d.ts +1 -1
  509. package/lib/resources/stripe_tax_accounts.js.map +1 -1
  510. package/lib/resources/subscription_models.cjs.map +1 -1
  511. package/lib/resources/subscription_models.d.cts +1 -1
  512. package/lib/resources/subscription_models.d.ts +1 -1
  513. package/lib/resources/subscription_models.js.map +1 -1
  514. package/lib/resources/tags.cjs.map +1 -1
  515. package/lib/resources/tags.d.cts +1 -1
  516. package/lib/resources/tags.d.ts +1 -1
  517. package/lib/resources/tags.js.map +1 -1
  518. package/lib/resources/talon_one_accounts.cjs.map +1 -1
  519. package/lib/resources/talon_one_accounts.d.cts +1 -1
  520. package/lib/resources/talon_one_accounts.d.ts +1 -1
  521. package/lib/resources/talon_one_accounts.js.map +1 -1
  522. package/lib/resources/tax_calculators.cjs.map +1 -1
  523. package/lib/resources/tax_calculators.d.cts +1 -1
  524. package/lib/resources/tax_calculators.d.ts +1 -1
  525. package/lib/resources/tax_calculators.js.map +1 -1
  526. package/lib/resources/tax_categories.cjs.map +1 -1
  527. package/lib/resources/tax_categories.d.cts +1 -1
  528. package/lib/resources/tax_categories.d.ts +1 -1
  529. package/lib/resources/tax_categories.js.map +1 -1
  530. package/lib/resources/tax_rules.cjs.map +1 -1
  531. package/lib/resources/tax_rules.d.cts +1 -1
  532. package/lib/resources/tax_rules.d.ts +1 -1
  533. package/lib/resources/tax_rules.js.map +1 -1
  534. package/lib/resources/taxjar_accounts.cjs.map +1 -1
  535. package/lib/resources/taxjar_accounts.d.cts +1 -1
  536. package/lib/resources/taxjar_accounts.d.ts +1 -1
  537. package/lib/resources/taxjar_accounts.js.map +1 -1
  538. package/lib/resources/transactions.cjs.map +1 -1
  539. package/lib/resources/transactions.d.cts +1 -1
  540. package/lib/resources/transactions.d.ts +1 -1
  541. package/lib/resources/transactions.js.map +1 -1
  542. package/lib/resources/versions.cjs.map +1 -1
  543. package/lib/resources/versions.d.cts +1 -1
  544. package/lib/resources/versions.d.ts +1 -1
  545. package/lib/resources/versions.js.map +1 -1
  546. package/lib/resources/vertex_accounts.cjs.map +1 -1
  547. package/lib/resources/vertex_accounts.d.cts +1 -1
  548. package/lib/resources/vertex_accounts.d.ts +1 -1
  549. package/lib/resources/vertex_accounts.js.map +1 -1
  550. package/lib/resources/voids.cjs.map +1 -1
  551. package/lib/resources/voids.d.cts +1 -1
  552. package/lib/resources/voids.d.ts +1 -1
  553. package/lib/resources/voids.js.map +1 -1
  554. package/lib/resources/webhooks.cjs.map +1 -1
  555. package/lib/resources/webhooks.d.cts +1 -1
  556. package/lib/resources/webhooks.d.ts +1 -1
  557. package/lib/resources/webhooks.js.map +1 -1
  558. package/lib/resources/wire_transfers.cjs.map +1 -1
  559. package/lib/resources/wire_transfers.d.cts +1 -1
  560. package/lib/resources/wire_transfers.d.ts +1 -1
  561. package/lib/resources/wire_transfers.js.map +1 -1
  562. package/lib/static.d.cts +1 -1
  563. package/lib/static.d.ts +1 -1
  564. package/package.json +15 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/flex_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA0NA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,2BAAA,CAA4B,eAAyC,EAAA,MAAA,EAAwD,OAA8D,EAAA;AAChM,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAgC,EAAE,IAAA,EAAM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AAA;AAAA;AAClL,EAEA,MAAM,YAAA,CAAa,EAA4B,EAAA,YAAA,EAAsB,QAA6C,OAAmD,EAAA;AACpK,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"flex_promotions.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 { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype FlexPromotionType = 'flex_promotions'\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FlexPromotionSort = Pick<FlexPromotion, 'id' | 'name' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FlexPromotionFilter = Pick<FlexPromotion, 'id' | 'name' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'rules' | 'disabled_at'> & ResourceFilter\n\n\ninterface FlexPromotion extends Resource {\n\t\n\treadonly type: FlexPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FlexPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FlexPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FlexPromotions extends ApiResource<FlexPromotion> {\n\n\tstatic readonly TYPE: FlexPromotionType = 'flex_promotions' as const\n\n\tasync create(resource: FlexPromotionCreate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.create<FlexPromotionCreate, FlexPromotion>({ ...resource, type: FlexPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FlexPromotionUpdate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ ...resource, type: FlexPromotions.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: FlexPromotions.TYPE } : id, options)\n\t}\n\n\tasync coupon_codes_promotion_rule(flexPromotionId: string | FlexPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `flex_promotions/${_flexPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync coupons(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `flex_promotions/${_flexPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `flex_promotions/${_flexPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `flex_promotions/${_flexPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `flex_promotions/${_flexPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `flex_promotions/${_flexPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFlexPromotion(resource: any): resource is FlexPromotion {\n\t\treturn resource.type && (resource.type === FlexPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FlexPromotionRel {\n\t\treturn super.relationshipOneToOne<FlexPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FlexPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FlexPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FlexPromotionType {\n\t\treturn FlexPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FlexPromotions()\nexport default instance\n\nexport type { FlexPromotion, FlexPromotionCreate, FlexPromotionUpdate, FlexPromotionType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/flex_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA0NA,MAAM,uBAAuBA,oBAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA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,OAAmD,EAAA;AACjK,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAClL,EAEA,MAAM,YAAA,CAAa,EAA4B,EAAA,YAAA,EAAsB,QAA6C,OAAmD,EAAA;AACpK,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"flex_promotions.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 { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype FlexPromotionType = 'flex_promotions'\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FlexPromotionSort = Pick<FlexPromotion, 'id' | 'name' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FlexPromotionFilter = Pick<FlexPromotion, 'id' | 'name' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'rules' | 'disabled_at'> & ResourceFilter\n\n\ninterface FlexPromotion extends Resource {\n\t\n\treadonly type: FlexPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FlexPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FlexPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FlexPromotions extends ApiResource<FlexPromotion> {\n\n\tstatic readonly TYPE: FlexPromotionType = 'flex_promotions' as const\n\n\tasync create(resource: FlexPromotionCreate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.create<FlexPromotionCreate, FlexPromotion>({ ...resource, type: FlexPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FlexPromotionUpdate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ ...resource, type: FlexPromotions.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: FlexPromotions.TYPE } : id, options)\n\t}\n\n\tasync coupon_codes_promotion_rule(flexPromotionId: string | FlexPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `flex_promotions/${_flexPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync coupons(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `flex_promotions/${_flexPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `flex_promotions/${_flexPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `flex_promotions/${_flexPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `flex_promotions/${_flexPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `flex_promotions/${_flexPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFlexPromotion(resource: any): resource is FlexPromotion {\n\t\treturn resource.type && (resource.type === FlexPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FlexPromotionRel {\n\t\treturn super.relationshipOneToOne<FlexPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FlexPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FlexPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FlexPromotionType {\n\t\treturn FlexPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FlexPromotions()\nexport default instance\n\nexport type { FlexPromotions, FlexPromotion, FlexPromotionCreate, FlexPromotionUpdate, FlexPromotionType }\n"]}
@@ -1,4 +1,4 @@
1
- export { ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, kh as FlexPromotionType, em as FlexPromotionUpdate, aq as default } from '../api-DmIZO_Np.cjs';
1
+ export { gn as FlexPromotion, go as FlexPromotionCreate, gq as FlexPromotionSort, mk as FlexPromotionType, gp as FlexPromotionUpdate, b6 as FlexPromotions, b5 as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
3
  import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, kh as FlexPromotionType, em as FlexPromotionUpdate, aq as default } from '../api-DDgIE2i8.js';
1
+ export { gn as FlexPromotion, go as FlexPromotionCreate, gq as FlexPromotionSort, mk as FlexPromotionType, gp as FlexPromotionUpdate, b6 as FlexPromotions, b5 as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
3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AO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"flex_promotions.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 { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype FlexPromotionType = 'flex_promotions'\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FlexPromotionSort = Pick<FlexPromotion, 'id' | 'name' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FlexPromotionFilter = Pick<FlexPromotion, 'id' | 'name' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'rules' | 'disabled_at'> & ResourceFilter\n\n\ninterface FlexPromotion extends Resource {\n\t\n\treadonly type: FlexPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FlexPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FlexPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FlexPromotions extends ApiResource<FlexPromotion> {\n\n\tstatic readonly TYPE: FlexPromotionType = 'flex_promotions' as const\n\n\tasync create(resource: FlexPromotionCreate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.create<FlexPromotionCreate, FlexPromotion>({ ...resource, type: FlexPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FlexPromotionUpdate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ ...resource, type: FlexPromotions.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: FlexPromotions.TYPE } : id, options)\n\t}\n\n\tasync coupon_codes_promotion_rule(flexPromotionId: string | FlexPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `flex_promotions/${_flexPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync coupons(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `flex_promotions/${_flexPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `flex_promotions/${_flexPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `flex_promotions/${_flexPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `flex_promotions/${_flexPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `flex_promotions/${_flexPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFlexPromotion(resource: any): resource is FlexPromotion {\n\t\treturn resource.type && (resource.type === FlexPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FlexPromotionRel {\n\t\treturn super.relationshipOneToOne<FlexPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FlexPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FlexPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FlexPromotionType {\n\t\treturn FlexPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FlexPromotions()\nexport default instance\n\nexport type { FlexPromotion, FlexPromotionCreate, FlexPromotionUpdate, FlexPromotionType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/flex_promotions.ts"],"names":[],"mappings":";;AA0NA,MAAM,uBAAuB,WAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA6C,OAAmD,EAAA;AAC3I,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,cAAe,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,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,cAAA,CAAe,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,2BAAA,CAA4B,eAAyC,EAAA,MAAA,EAAwD,OAA8D,EAAA;AAChM,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAA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YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAClL,EAEA,MAAM,YAAA,CAAa,EAA4B,EAAA,YAAA,EAAsB,QAA6C,OAAmD,EAAA;AACpK,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA2C,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,cAAe,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,cAAe,CAAA,IAAA;AAAA;AAGxB;AAGA,MAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","file":"flex_promotions.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 { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype FlexPromotionType = 'flex_promotions'\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FlexPromotionSort = Pick<FlexPromotion, 'id' | 'name' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FlexPromotionFilter = Pick<FlexPromotion, 'id' | 'name' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'rules' | 'disabled_at'> & ResourceFilter\n\n\ninterface FlexPromotion extends Resource {\n\t\n\treadonly type: FlexPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The rule outcomes.\n\t * @example ```{}```\n\t */\n\trule_outcomes?: Record<string, any> | null\n\t/** \n\t * The payload used to evaluate the rules.\n\t * @example ```{}```\n\t */\n\tresource_payload?: Record<string, any> | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FlexPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules: Record<string, any>\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FlexPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The discount rule to be applied.\n\t * @example ```{}```\n\t */\n\trules?: Record<string, any> | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FlexPromotions extends ApiResource<FlexPromotion> {\n\n\tstatic readonly TYPE: FlexPromotionType = 'flex_promotions' as const\n\n\tasync create(resource: FlexPromotionCreate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.create<FlexPromotionCreate, FlexPromotion>({ ...resource, type: FlexPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FlexPromotionUpdate, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ ...resource, type: FlexPromotions.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: FlexPromotions.TYPE } : id, options)\n\t}\n\n\tasync coupon_codes_promotion_rule(flexPromotionId: string | FlexPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `flex_promotions/${_flexPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync coupons(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `flex_promotions/${_flexPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `flex_promotions/${_flexPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `flex_promotions/${_flexPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `flex_promotions/${_flexPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(flexPromotionId: string | FlexPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _flexPromotionId = (flexPromotionId as FlexPromotion).id || flexPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `flex_promotions/${_flexPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FlexPromotion, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FlexPromotion, triggerValue: string, params?: QueryParamsRetrieve<FlexPromotion>, options?: ResourcesConfig): Promise<FlexPromotion> {\n\t\treturn this.resources.update<FlexPromotionUpdate, FlexPromotion>({ id: (typeof id === 'string')? id: id.id, type: FlexPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFlexPromotion(resource: any): resource is FlexPromotion {\n\t\treturn resource.type && (resource.type === FlexPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FlexPromotionRel {\n\t\treturn super.relationshipOneToOne<FlexPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FlexPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FlexPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FlexPromotionType {\n\t\treturn FlexPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FlexPromotions()\nexport default instance\n\nexport type { FlexPromotions, FlexPromotion, FlexPromotionCreate, FlexPromotionUpdate, FlexPromotionType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/free_gift_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA4PA,MAAM,2BAA2BA,oBAA+B,CAAA;AAAA,EAE/D,OAAgB,IAA8B,GAAA,sBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,kBAAmB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,EAEA,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,kBAAmB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,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,I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CAAA;AAAA;AACjM,EAGA,oBAAoB,QAA8C,EAAA;AACjE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,kBAAmB,CAAA,IAAA;AAAA;AAC/D,EAGA,aAAa,EAAsD,EAAA;AAClE,IAAO,OAAA,KAAA,CAAM,qBAA2C,EAAE,CAAA;AAAA;AAC3D,EAEA,sBAAsB,GAAuC,EAAA;AAC5D,IAAO,OAAA,KAAA,CAAM,qBAA4C,CAAA,GAAG,GAAG,CAAA;AAAA;AAChE,EAGA,IAA8B,GAAA;AAC7B,IAAA,OAAO,kBAAmB,CAAA,IAAA;AAAA;AAG5B;AAGA,MAAM,QAAA,GAAW,IAAI,kBAAmB,EAAA;AACxC,IAAO,4BAAQ,GAAA","file":"free_gift_promotions.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Sku } from './skus'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeGiftPromotionType = 'free_gift_promotions'\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeGiftPromotionSort = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeGiftPromotionFilter = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeGiftPromotion extends Resource {\n\t\n\treadonly type: FreeGiftPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tskus?: Sku[] | null\n\n}\n\n\ninterface FreeGiftPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list: SkuListRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeGiftPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {\n\n\tstatic readonly TYPE: FreeGiftPromotionType = 'free_gift_promotions' as const\n\n\tasync create(resource: FreeGiftPromotionCreate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.create<FreeGiftPromotionCreate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeGiftPromotionUpdate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.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: FreeGiftPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_gift_promotions/${_freeGiftPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_gift_promotions/${_freeGiftPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_gift_promotions/${_freeGiftPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Sku>, options?: ResourcesConfig): Promise<ListResponse<Sku>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options) as unknown as ListResponse<Sku>\n\t}\n\n\tasync _disable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeGiftPromotion(resource: any): resource is FreeGiftPromotion {\n\t\treturn resource.type && (resource.type === FreeGiftPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeGiftPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeGiftPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeGiftPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeGiftPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeGiftPromotionType {\n\t\treturn FreeGiftPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeGiftPromotions()\nexport default instance\n\nexport type { FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate, FreeGiftPromotionType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/free_gift_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA4PA,MAAM,2BAA2BA,oBAA+B,CAAA;AAAA,EAE/D,OAAgB,IAA8B,GAAA,sBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,G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C7K,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,kBAAmB,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC9L,EAEA,MAAM,YAAA,CAAa,EAAgC,EAAA,YAAA,EAAsB,QAAiD,OAAuD,EAAA;AAChL,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,kBAAmB,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjM,EAGA,oBAAoB,QAA8C,EAAA;AACjE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,kBAAmB,CAAA,IAAA;AAAA;AAC/D,EAGA,aAAa,EAAsD,EAAA;AAClE,IAAO,OAAA,KAAA,CAAM,qBAA2C,EAAE,CAAA;AAAA;AAC3D,EAEA,sBAAsB,GAAuC,EAAA;AAC5D,IAAO,OAAA,KAAA,CAAM,qBAA4C,CAAA,GAAG,GAAG,CAAA;AAAA;AAChE,EAGA,IAA8B,GAAA;AAC7B,IAAA,OAAO,kBAAmB,CAAA,IAAA;AAAA;AAG5B;AAGA,MAAM,QAAA,GAAW,IAAI,kBAAmB,EAAA;AACxC,IAAO,4BAAQ,GAAA","file":"free_gift_promotions.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Sku } from './skus'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeGiftPromotionType = 'free_gift_promotions'\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeGiftPromotionSort = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeGiftPromotionFilter = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeGiftPromotion extends Resource {\n\t\n\treadonly type: FreeGiftPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tskus?: Sku[] | null\n\n}\n\n\ninterface FreeGiftPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list: SkuListRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeGiftPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {\n\n\tstatic readonly TYPE: FreeGiftPromotionType = 'free_gift_promotions' as const\n\n\tasync create(resource: FreeGiftPromotionCreate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.create<FreeGiftPromotionCreate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeGiftPromotionUpdate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.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: FreeGiftPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_gift_promotions/${_freeGiftPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_gift_promotions/${_freeGiftPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_gift_promotions/${_freeGiftPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Sku>, options?: ResourcesConfig): Promise<ListResponse<Sku>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options) as unknown as ListResponse<Sku>\n\t}\n\n\tasync _disable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeGiftPromotion(resource: any): resource is FreeGiftPromotion {\n\t\treturn resource.type && (resource.type === FreeGiftPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeGiftPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeGiftPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeGiftPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeGiftPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeGiftPromotionType {\n\t\treturn FreeGiftPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeGiftPromotions()\nexport default instance\n\nexport type { FreeGiftPromotions, FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate, FreeGiftPromotionType }\n"]}
@@ -1,4 +1,4 @@
1
- export { eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, kl as FreeGiftPromotionType, eq as FreeGiftPromotionUpdate, ar as default } from '../api-DmIZO_Np.cjs';
1
+ export { gr as FreeGiftPromotion, gs as FreeGiftPromotionCreate, gu as FreeGiftPromotionSort, mo as FreeGiftPromotionType, gt as FreeGiftPromotionUpdate, b8 as FreeGiftPromotions, b7 as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
3
  import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, kl as FreeGiftPromotionType, eq as FreeGiftPromotionUpdate, ar as default } from '../api-DDgIE2i8.js';
1
+ export { gr as FreeGiftPromotion, gs as FreeGiftPromotionCreate, gu as FreeGiftPromotionSort, mo as FreeGiftPromotionType, gt as FreeGiftPromotionUpdate, b8 as FreeGiftPromotions, b7 as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
3
  import '../interceptor-k15jXzf0.js';
4
4
  import '../types.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/free_gift_promotions.ts"],"names":[],"mappings":";;AA4PA,MAAM,2BAA2B,WAA+B,CAAA;AAAA,EAE/D,OAAgB,IAA8B,GAAA,sBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,GAAG,QAAU,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OAAO,KAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,kBAAmB,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AAC9L,EAEA,MAAM,YAAA,CAAa,EAAgC,EAAA,YAAA,EAAsB,QAAiD,OAAuD,EAAA;AAChL,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,kBAAmB,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjM,EAGA,oBAAoB,QAA8C,EAAA;AACjE,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,kBAAmB,CAAA,IAAA;AAAA;AAC/D,EAGA,aAAa,EAAsD,EAAA;AAClE,IAAO,OAAA,KAAA,CAAM,qBAA2C,EAAE,CAAA;AAAA;AAC3D,EAEA,sBAAsB,GAAuC,EAAA;AAC5D,IAAO,OAAA,KAAA,CAAM,qBAA4C,CAAA,GAAG,GAAG,CAAA;AAAA;AAChE,EAGA,IAA8B,GAAA;AAC7B,IAAA,OAAO,kBAAmB,CAAA,IAAA;AAAA;AAG5B;AAGA,MAAM,QAAA,GAAW,IAAI,kBAAmB,EAAA;AACxC,IAAO,4BAAQ,GAAA","file":"free_gift_promotions.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Sku } from './skus'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeGiftPromotionType = 'free_gift_promotions'\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeGiftPromotionSort = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeGiftPromotionFilter = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeGiftPromotion extends Resource {\n\t\n\treadonly type: FreeGiftPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tskus?: Sku[] | null\n\n}\n\n\ninterface FreeGiftPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list: SkuListRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeGiftPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {\n\n\tstatic readonly TYPE: FreeGiftPromotionType = 'free_gift_promotions' as const\n\n\tasync create(resource: FreeGiftPromotionCreate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.create<FreeGiftPromotionCreate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeGiftPromotionUpdate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.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: FreeGiftPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_gift_promotions/${_freeGiftPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_gift_promotions/${_freeGiftPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_gift_promotions/${_freeGiftPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Sku>, options?: ResourcesConfig): Promise<ListResponse<Sku>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options) as unknown as ListResponse<Sku>\n\t}\n\n\tasync _disable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeGiftPromotion(resource: any): resource is FreeGiftPromotion {\n\t\treturn resource.type && (resource.type === FreeGiftPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeGiftPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeGiftPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeGiftPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeGiftPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeGiftPromotionType {\n\t\treturn FreeGiftPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeGiftPromotions()\nexport default instance\n\nexport type { FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate, FreeGiftPromotionType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/free_gift_promotions.ts"],"names":[],"mappings":";;AA4PA,MAAM,2BAA2B,WAA+B,CAAA;AAAA,EAE/D,OAAgB,IAA8B,GAAA,sBAAA;AAAA,EAE9C,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,kBAAmB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,EAEA,MAAM,MAAA,CAAO,QAAmC,EAAA,MAAA,EAAiD,OAAuD,EAAA;AACvJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAmD,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,kBAAmB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,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,kBAAA,CAAmB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC1G,EAEA,MAAM,MAAA,CAAO,mBAAiD,EAAA,MAAA,EAAsC,OAA4C,EAAA;AAC/I,IAAM,MAAA,oBAAA,GAAwB,oBAA0C,EAAM,IAAA,mBAAA;AAC9E,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAc,EAAE,IAAA,EAAM,SAAU,EAAA,EAA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AM,qBAA4C,CAAA,GAAG,GAAG,CAAA;AAAA;AAChE,EAGA,IAA8B,GAAA;AAC7B,IAAA,OAAO,kBAAmB,CAAA,IAAA;AAAA;AAG5B;AAGA,MAAM,QAAA,GAAW,IAAI,kBAAmB,EAAA;AACxC,IAAO,4BAAQ,GAAA","file":"free_gift_promotions.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Sku } from './skus'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeGiftPromotionType = 'free_gift_promotions'\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeGiftPromotionSort = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeGiftPromotionFilter = Pick<FreeGiftPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeGiftPromotion extends Resource {\n\t\n\treadonly type: FreeGiftPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tskus?: Sku[] | null\n\n}\n\n\ninterface FreeGiftPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list: SkuListRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeGiftPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\t/** \n\t * The max quantity of free gifts globally applicable by the promotion.\n\t * @example ```3```\n\t */\n\tmax_quantity?: number | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {\n\n\tstatic readonly TYPE: FreeGiftPromotionType = 'free_gift_promotions' as const\n\n\tasync create(resource: FreeGiftPromotionCreate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.create<FreeGiftPromotionCreate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeGiftPromotionUpdate, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ ...resource, type: FreeGiftPromotions.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: FreeGiftPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_gift_promotions/${_freeGiftPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_gift_promotions/${_freeGiftPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_gift_promotions/${_freeGiftPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList<Sku>, options?: ResourcesConfig): Promise<ListResponse<Sku>> {\n\t\tconst _freeGiftPromotionId = (freeGiftPromotionId as FreeGiftPromotion).id || freeGiftPromotionId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options) as unknown as ListResponse<Sku>\n\t}\n\n\tasync _disable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeGiftPromotion, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeGiftPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeGiftPromotion>, options?: ResourcesConfig): Promise<FreeGiftPromotion> {\n\t\treturn this.resources.update<FreeGiftPromotionUpdate, FreeGiftPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeGiftPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeGiftPromotion(resource: any): resource is FreeGiftPromotion {\n\t\treturn resource.type && (resource.type === FreeGiftPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeGiftPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeGiftPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeGiftPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeGiftPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeGiftPromotionType {\n\t\treturn FreeGiftPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeGiftPromotions()\nexport default instance\n\nexport type { FreeGiftPromotions, FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate, FreeGiftPromotionType }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/resources/free_shipping_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA2OA,MAAM,+BAA+BA,oBAAmC,CAAA;AAAA,EAEvE,OAAgB,IAAkC,GAAA,0BAAA;AAAA,EAElD,MAAM,MAAA,CAAO,QAAuC,EAAA,MAAA,EAAqD,OAA2D,EAAA;AACnK,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2D,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,sBAAuB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrJ,EAEA,MAAM,MAAA,CAAO,QAAuC,EAAA,MAAA,EAAqD,OAA2D,EAAA;AACnK,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2D,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,sBAAuB,CA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AA,IAAA,KAAS,sBAAuB,CAAA,IAAA;AAAA;AACnE,EAGA,aAAa,EAA0D,EAAA;AACtE,IAAO,OAAA,KAAA,CAAM,qBAA+C,EAAE,CAAA;AAAA;AAC/D,EAEA,sBAAsB,GAA2C,EAAA;AAChE,IAAO,OAAA,KAAA,CAAM,qBAAgD,CAAA,GAAG,GAAG,CAAA;AAAA;AACpE,EAGA,IAAkC,GAAA;AACjC,IAAA,OAAO,sBAAuB,CAAA,IAAA;AAAA;AAGhC;AAGA,MAAM,QAAA,GAAW,IAAI,sBAAuB,EAAA;AAC5C,IAAO,gCAAQ,GAAA","file":"free_shipping_promotions.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeShippingPromotionType = 'free_shipping_promotions'\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeShippingPromotionSort = Pick<FreeShippingPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeShippingPromotionFilter = Pick<FreeShippingPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeShippingPromotion extends Resource {\n\t\n\treadonly type: FreeShippingPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FreeShippingPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeShippingPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {\n\n\tstatic readonly TYPE: FreeShippingPromotionType = 'free_shipping_promotions' as const\n\n\tasync create(resource: FreeShippingPromotionCreate, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.create<FreeShippingPromotionCreate, FreeShippingPromotion>({ ...resource, type: FreeShippingPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeShippingPromotionUpdate, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ ...resource, type: FreeShippingPromotions.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: FreeShippingPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_shipping_promotions/${_freeShippingPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_shipping_promotions/${_freeShippingPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_shipping_promotions/${_freeShippingPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_shipping_promotions/${_freeShippingPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FreeShippingPromotion, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeShippingPromotion, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeShippingPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeShippingPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeShippingPromotion(resource: any): resource is FreeShippingPromotion {\n\t\treturn resource.type && (resource.type === FreeShippingPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeShippingPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeShippingPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeShippingPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeShippingPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeShippingPromotionType {\n\t\treturn FreeShippingPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeShippingPromotions()\nexport default instance\n\nexport type { FreeShippingPromotion, FreeShippingPromotionCreate, FreeShippingPromotionUpdate, FreeShippingPromotionType }\n"]}
1
+ {"version":3,"sources":["../../src/resources/free_shipping_promotions.ts"],"names":["ApiResource"],"mappings":";;;;AA2OA,MAAM,+BAA+BA,oBAAmC,CAAA;AAAA,EAEvE,OAAgB,IAAkC,GAAA,0BAAA;AAAA,EAElD,MAAM,MAAA,CAAO,QAAuC,EAAA,MAAA,EAAqD,OAA2D,EAAA;AACnK,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2D,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,sBAAuB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrJ,EAEA,MAAM,MAAA,CAAO,QAAuC,EAAA,MAAA,EAAqD,OAA2D,EAAA;AACnK,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA2D,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,sBAAuB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACrJ,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,sBAAA,CAAuB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC9G,EAEA,MAAM,MAAA,CAAO,uBAAyD,EAAA,MAAA,EAA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sBAAuB,EAAA;AAC5C,IAAO,gCAAQ,GAAA","file":"free_shipping_promotions.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market, MarketType } from './markets'\nimport type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules'\nimport type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules'\nimport type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules'\nimport type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules'\nimport type { SkuList, SkuListType } from './sku_lists'\nimport type { Coupon } from './coupons'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { PromotionRule } from './promotion_rules'\n\n\ntype FreeShippingPromotionType = 'free_shipping_promotions'\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype MarketRel = ResourceRel & { type: MarketType }\ntype OrderAmountPromotionRuleRel = ResourceRel & { type: OrderAmountPromotionRuleType }\ntype SkuListPromotionRuleRel = ResourceRel & { type: SkuListPromotionRuleType }\ntype CouponCodesPromotionRuleRel = ResourceRel & { type: CouponCodesPromotionRuleType }\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype SkuListRel = ResourceRel & { type: SkuListType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type FreeShippingPromotionSort = Pick<FreeShippingPromotion, 'id' | 'name' | 'currency_code' | 'exclusive' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceSort\n// export type FreeShippingPromotionFilter = Pick<FreeShippingPromotion, 'id' | 'name' | 'currency_code' | 'priority' | 'starts_at' | 'expires_at' | 'total_usage_limit' | 'total_usage_count' | 'disabled_at'> & ResourceFilter\n\n\ninterface FreeShippingPromotion extends Resource {\n\t\n\treadonly type: FreeShippingPromotionType\n\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * The number of times this promotion has been applied.\n\t * @example ```2```\n\t */\n\ttotal_usage_count?: number | null\n\t/** \n\t * Indicates if the promotion is active (enabled and not expired).\n\t * @example ```true```\n\t */\n\tactive?: boolean | null\n\t/** \n\t * The promotion status. One of 'disabled', 'expired', 'pending', 'active', or 'inactive'.\n\t * @example ```\"pending\"```\n\t */\n\tstatus?: 'disabled' | 'expired' | 'pending' | 'active' | 'inactive' | null\n\t/** \n\t * Time at which this resource was disabled.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tdisabled_at?: string | null\n\n\tmarket?: Market | null\n\tpromotion_rules?: PromotionRule[] | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRule | null\n\tsku_list_promotion_rule?: SkuListPromotionRule | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRule | null\n\tcustom_promotion_rule?: CustomPromotionRule | null\n\tsku_list?: SkuList | null\n\tcoupons?: Coupon[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface FreeShippingPromotionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname: string\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at: string\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface FreeShippingPromotionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The promotion's internal name.\n\t * @example ```\"Personal promotion\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The international 3-letter currency code as defined by the ISO 4217 standard.\n\t * @example ```\"EUR\"```\n\t */\n\tcurrency_code?: string | null\n\t/** \n\t * Indicates if the promotion will be applied exclusively, based on its priority score.\n\t * @example ```true```\n\t */\n\texclusive?: boolean | null\n\t/** \n\t * The priority assigned to the promotion (lower means higher priority).\n\t * @example ```2```\n\t */\n\tpriority?: number | null\n\t/** \n\t * The activation date/time of this promotion.\n\t * @example ```\"2018-01-01T12:00:00.000Z\"```\n\t */\n\tstarts_at?: string | null\n\t/** \n\t * The expiration date/time of this promotion (must be after starts_at).\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at?: string | null\n\t/** \n\t * The total number of times this promotion can be applied. When 'null' it means promotion can be applied infinite times.\n\t * @example ```5```\n\t */\n\ttotal_usage_limit?: number | null\n\t/** \n\t * Send this attribute if you want to mark this resource as disabled.\n\t * @example ```true```\n\t */\n\t_disable?: boolean | null\n\t/** \n\t * Send this attribute if you want to mark this resource as enabled.\n\t * @example ```true```\n\t */\n\t_enable?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tmarket?: MarketRel | null\n\torder_amount_promotion_rule?: OrderAmountPromotionRuleRel | null\n\tsku_list_promotion_rule?: SkuListPromotionRuleRel | null\n\tcoupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null\n\tcustom_promotion_rule?: CustomPromotionRuleRel | null\n\tsku_list?: SkuListRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {\n\n\tstatic readonly TYPE: FreeShippingPromotionType = 'free_shipping_promotions' as const\n\n\tasync create(resource: FreeShippingPromotionCreate, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.create<FreeShippingPromotionCreate, FreeShippingPromotion>({ ...resource, type: FreeShippingPromotions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: FreeShippingPromotionUpdate, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ ...resource, type: FreeShippingPromotions.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: FreeShippingPromotions.TYPE } : id, options)\n\t}\n\n\tasync market(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<Market>, options?: ResourcesConfig): Promise<Market> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `free_shipping_promotions/${_freeShippingPromotionId}/market`, params, options) as unknown as Market\n\t}\n\n\tasync order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<OrderAmountPromotionRule>, options?: ResourcesConfig): Promise<OrderAmountPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<OrderAmountPromotionRule>({ type: 'order_amount_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/order_amount_promotion_rule`, params, options) as unknown as OrderAmountPromotionRule\n\t}\n\n\tasync sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<SkuListPromotionRule>, options?: ResourcesConfig): Promise<SkuListPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<SkuListPromotionRule>({ type: 'sku_list_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list_promotion_rule`, params, options) as unknown as SkuListPromotionRule\n\t}\n\n\tasync coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<CouponCodesPromotionRule>, options?: ResourcesConfig): Promise<CouponCodesPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<CouponCodesPromotionRule>({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options) as unknown as CouponCodesPromotionRule\n\t}\n\n\tasync custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<CustomPromotionRule>({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options) as unknown as CustomPromotionRule\n\t}\n\n\tasync sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve<SkuList>, options?: ResourcesConfig): Promise<SkuList> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options) as unknown as SkuList\n\t}\n\n\tasync coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Coupon>, options?: ResourcesConfig): Promise<ListResponse<Coupon>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Coupon>({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options) as unknown as ListResponse<Coupon>\n\t}\n\n\tasync attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `free_shipping_promotions/${_freeShippingPromotionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `free_shipping_promotions/${_freeShippingPromotionId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _freeShippingPromotionId = (freeShippingPromotionId as FreeShippingPromotion).id || freeShippingPromotionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `free_shipping_promotions/${_freeShippingPromotionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _disable(id: string | FreeShippingPromotion, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _disable: true }, params, options)\n\t}\n\n\tasync _enable(id: string | FreeShippingPromotion, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _enable: true }, params, options)\n\t}\n\n\tasync _add_tags(id: string | FreeShippingPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | FreeShippingPromotion, triggerValue: string, params?: QueryParamsRetrieve<FreeShippingPromotion>, options?: ResourcesConfig): Promise<FreeShippingPromotion> {\n\t\treturn this.resources.update<FreeShippingPromotionUpdate, FreeShippingPromotion>({ id: (typeof id === 'string')? id: id.id, type: FreeShippingPromotions.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisFreeShippingPromotion(resource: any): resource is FreeShippingPromotion {\n\t\treturn resource.type && (resource.type === FreeShippingPromotions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): FreeShippingPromotionRel {\n\t\treturn super.relationshipOneToOne<FreeShippingPromotionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): FreeShippingPromotionRel[] {\n\t\treturn super.relationshipOneToMany<FreeShippingPromotionRel>(...ids)\n\t}\n\n\n\ttype(): FreeShippingPromotionType {\n\t\treturn FreeShippingPromotions.TYPE\n\t}\n\n}\n\n\nconst instance = new FreeShippingPromotions()\nexport default instance\n\nexport type { FreeShippingPromotions, FreeShippingPromotion, FreeShippingPromotionCreate, FreeShippingPromotionUpdate, FreeShippingPromotionType }\n"]}
@@ -1,4 +1,4 @@
1
- export { es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, kp as FreeShippingPromotionType, eu as FreeShippingPromotionUpdate, as as default } from '../api-DmIZO_Np.cjs';
1
+ export { gv as FreeShippingPromotion, gw as FreeShippingPromotionCreate, gy as FreeShippingPromotionSort, ms as FreeShippingPromotionType, gx as FreeShippingPromotionUpdate, ba as FreeShippingPromotions, b9 as default } from '../api-IwWtsAqE.cjs';
2
2
  import '../client.cjs';
3
3
  import '../interceptor-k15jXzf0.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, kp as FreeShippingPromotionType, eu as FreeShippingPromotionUpdate, as as default } from '../api-DDgIE2i8.js';
1
+ export { gv as FreeShippingPromotion, gw as FreeShippingPromotionCreate, gy as FreeShippingPromotionSort, ms as FreeShippingPromotionType, gx as FreeShippingPromotionUpdate, ba as FreeShippingPromotions, b9 as default } from '../api-F1F37Dud.js';
2
2
  import '../client.js';
3
3
  import '../interceptor-k15jXzf0.js';
4
4
  import '../types.js';