@commercelayer/sdk 5.37.0 → 5.38.0

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 (547) hide show
  1. package/lib/cjs/api.d.ts +1 -164
  2. package/lib/cjs/api.js +1 -387
  3. package/lib/cjs/client.d.ts +1 -39
  4. package/lib/cjs/client.js +1 -154
  5. package/lib/cjs/commercelayer.d.ts +1 -153
  6. package/lib/cjs/commercelayer.js +1 -253
  7. package/lib/cjs/common.d.ts +1 -5
  8. package/lib/cjs/common.js +1 -23
  9. package/lib/cjs/config.d.ts +1 -15
  10. package/lib/cjs/config.js +1 -19
  11. package/lib/cjs/debug.d.ts +1 -3
  12. package/lib/cjs/debug.js +1 -38
  13. package/lib/cjs/error.d.ts +1 -31
  14. package/lib/cjs/error.js +1 -77
  15. package/lib/cjs/index.d.ts +1 -7
  16. package/lib/cjs/index.js +1 -13
  17. package/lib/cjs/interceptor.d.ts +1 -25
  18. package/lib/cjs/interceptor.js +1 -2
  19. package/lib/cjs/jsonapi.d.ts +1 -6
  20. package/lib/cjs/jsonapi.js +1 -94
  21. package/lib/cjs/model.d.ts +1 -124
  22. package/lib/cjs/model.js +1 -3
  23. package/lib/cjs/query.d.ts +1 -17
  24. package/lib/cjs/query.js +1 -69
  25. package/lib/cjs/resource.d.ts +1 -89
  26. package/lib/cjs/resource.js +1 -198
  27. package/lib/cjs/resources/addresses.d.ts +1 -103
  28. package/lib/cjs/resources/addresses.js +1 -41
  29. package/lib/cjs/resources/adjustments.d.ts +1 -42
  30. package/lib/cjs/resources/adjustments.js +1 -29
  31. package/lib/cjs/resources/adyen_gateways.d.ts +1 -60
  32. package/lib/cjs/resources/adyen_gateways.js +1 -37
  33. package/lib/cjs/resources/adyen_payments.d.ts +1 -51
  34. package/lib/cjs/resources/adyen_payments.js +1 -40
  35. package/lib/cjs/resources/application.d.ts +1 -22
  36. package/lib/cjs/resources/application.js +1 -16
  37. package/lib/cjs/resources/attachments.d.ts +1 -157
  38. package/lib/cjs/resources/attachments.js +1 -25
  39. package/lib/cjs/resources/authorizations.d.ts +1 -70
  40. package/lib/cjs/resources/authorizations.js +1 -52
  41. package/lib/cjs/resources/avalara_accounts.d.ts +1 -59
  42. package/lib/cjs/resources/avalara_accounts.js +1 -41
  43. package/lib/cjs/resources/axerve_gateways.d.ts +1 -48
  44. package/lib/cjs/resources/axerve_gateways.js +1 -37
  45. package/lib/cjs/resources/axerve_payments.d.ts +1 -54
  46. package/lib/cjs/resources/axerve_payments.js +1 -40
  47. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -39
  48. package/lib/cjs/resources/billing_info_validation_rules.js +1 -37
  49. package/lib/cjs/resources/bing_geocoders.d.ts +1 -36
  50. package/lib/cjs/resources/bing_geocoders.js +1 -33
  51. package/lib/cjs/resources/braintree_gateways.d.ts +1 -60
  52. package/lib/cjs/resources/braintree_gateways.js +1 -37
  53. package/lib/cjs/resources/braintree_payments.d.ts +1 -52
  54. package/lib/cjs/resources/braintree_payments.js +1 -37
  55. package/lib/cjs/resources/bundles.d.ts +1 -93
  56. package/lib/cjs/resources/bundles.js +1 -59
  57. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -137
  58. package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -79
  59. package/lib/cjs/resources/captures.d.ts +1 -60
  60. package/lib/cjs/resources/captures.js +1 -49
  61. package/lib/cjs/resources/carrier_accounts.d.ts +1 -30
  62. package/lib/cjs/resources/carrier_accounts.js +1 -28
  63. package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -49
  64. package/lib/cjs/resources/checkout_com_gateways.js +1 -37
  65. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -65
  66. package/lib/cjs/resources/checkout_com_payments.js +1 -43
  67. package/lib/cjs/resources/cleanups.d.ts +1 -40
  68. package/lib/cjs/resources/cleanups.js +1 -30
  69. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -67
  70. package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -33
  71. package/lib/cjs/resources/coupon_recipients.d.ts +1 -48
  72. package/lib/cjs/resources/coupon_recipients.js +1 -37
  73. package/lib/cjs/resources/coupons.d.ts +1 -71
  74. package/lib/cjs/resources/coupons.js +1 -45
  75. package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -62
  76. package/lib/cjs/resources/custom_promotion_rules.js +1 -29
  77. package/lib/cjs/resources/customer_addresses.d.ts +1 -50
  78. package/lib/cjs/resources/customer_addresses.js +1 -41
  79. package/lib/cjs/resources/customer_groups.d.ts +1 -40
  80. package/lib/cjs/resources/customer_groups.js +1 -41
  81. package/lib/cjs/resources/customer_password_resets.d.ts +1 -38
  82. package/lib/cjs/resources/customer_password_resets.js +1 -36
  83. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -86
  84. package/lib/cjs/resources/customer_payment_sources.js +1 -37
  85. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -35
  86. package/lib/cjs/resources/customer_subscriptions.js +1 -37
  87. package/lib/cjs/resources/customers.d.ts +1 -76
  88. package/lib/cjs/resources/customers.js +1 -69
  89. package/lib/cjs/resources/delivery_lead_times.d.ts +1 -55
  90. package/lib/cjs/resources/delivery_lead_times.js +1 -41
  91. package/lib/cjs/resources/event_callbacks.d.ts +1 -25
  92. package/lib/cjs/resources/event_callbacks.js +1 -20
  93. package/lib/cjs/resources/events.d.ts +1 -25
  94. package/lib/cjs/resources/events.js +1 -24
  95. package/lib/cjs/resources/exports.d.ts +1 -41
  96. package/lib/cjs/resources/exports.js +1 -26
  97. package/lib/cjs/resources/external_gateways.d.ts +1 -57
  98. package/lib/cjs/resources/external_gateways.js +1 -40
  99. package/lib/cjs/resources/external_payments.d.ts +1 -48
  100. package/lib/cjs/resources/external_payments.js +1 -41
  101. package/lib/cjs/resources/external_promotions.d.ts +1 -136
  102. package/lib/cjs/resources/external_promotions.js +1 -82
  103. package/lib/cjs/resources/external_tax_calculators.d.ts +1 -45
  104. package/lib/cjs/resources/external_tax_calculators.js +1 -40
  105. package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -133
  106. package/lib/cjs/resources/fixed_amount_promotions.js +1 -79
  107. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -133
  108. package/lib/cjs/resources/fixed_price_promotions.js +1 -79
  109. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -131
  110. package/lib/cjs/resources/free_gift_promotions.js +1 -79
  111. package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -125
  112. package/lib/cjs/resources/free_shipping_promotions.js +1 -75
  113. package/lib/cjs/resources/geocoders.d.ts +1 -25
  114. package/lib/cjs/resources/geocoders.js +1 -24
  115. package/lib/cjs/resources/gift_card_recipients.d.ts +1 -48
  116. package/lib/cjs/resources/gift_card_recipients.js +1 -37
  117. package/lib/cjs/resources/gift_cards.d.ts +1 -104
  118. package/lib/cjs/resources/gift_cards.js +1 -61
  119. package/lib/cjs/resources/google_geocoders.d.ts +1 -36
  120. package/lib/cjs/resources/google_geocoders.js +1 -33
  121. package/lib/cjs/resources/imports.d.ts +1 -44
  122. package/lib/cjs/resources/imports.js +1 -26
  123. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -68
  124. package/lib/cjs/resources/in_stock_subscriptions.js +1 -51
  125. package/lib/cjs/resources/inventory_models.d.ts +1 -55
  126. package/lib/cjs/resources/inventory_models.js +1 -41
  127. package/lib/cjs/resources/inventory_return_locations.d.ts +1 -47
  128. package/lib/cjs/resources/inventory_return_locations.js +1 -37
  129. package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -50
  130. package/lib/cjs/resources/inventory_stock_locations.js +1 -37
  131. package/lib/cjs/resources/klarna_gateways.d.ts +1 -48
  132. package/lib/cjs/resources/klarna_gateways.js +1 -37
  133. package/lib/cjs/resources/klarna_payments.d.ts +1 -48
  134. package/lib/cjs/resources/klarna_payments.js +1 -40
  135. package/lib/cjs/resources/line_item_options.d.ts +1 -69
  136. package/lib/cjs/resources/line_item_options.js +1 -41
  137. package/lib/cjs/resources/line_items.d.ts +1 -170
  138. package/lib/cjs/resources/line_items.js +1 -66
  139. package/lib/cjs/resources/manual_gateways.d.ts +1 -34
  140. package/lib/cjs/resources/manual_gateways.js +1 -33
  141. package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -45
  142. package/lib/cjs/resources/manual_tax_calculators.js +1 -41
  143. package/lib/cjs/resources/markets.d.ts +1 -107
  144. package/lib/cjs/resources/markets.js +1 -63
  145. package/lib/cjs/resources/merchants.d.ts +1 -42
  146. package/lib/cjs/resources/merchants.js +1 -37
  147. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -67
  148. package/lib/cjs/resources/order_amount_promotion_rules.js +1 -29
  149. package/lib/cjs/resources/order_copies.d.ts +1 -51
  150. package/lib/cjs/resources/order_copies.js +1 -41
  151. package/lib/cjs/resources/order_factories.d.ts +1 -34
  152. package/lib/cjs/resources/order_factories.js +1 -28
  153. package/lib/cjs/resources/order_subscription_items.d.ts +1 -72
  154. package/lib/cjs/resources/order_subscription_items.js +1 -33
  155. package/lib/cjs/resources/order_subscriptions.d.ts +1 -98
  156. package/lib/cjs/resources/order_subscriptions.js +1 -78
  157. package/lib/cjs/resources/order_validation_rules.d.ts +1 -27
  158. package/lib/cjs/resources/order_validation_rules.js +1 -28
  159. package/lib/cjs/resources/orders.d.ts +1 -389
  160. package/lib/cjs/resources/orders.js +1 -236
  161. package/lib/cjs/resources/organization.d.ts +1 -34
  162. package/lib/cjs/resources/organization.js +1 -16
  163. package/lib/cjs/resources/packages.d.ts +1 -60
  164. package/lib/cjs/resources/packages.js +1 -41
  165. package/lib/cjs/resources/parcel_line_items.d.ts +1 -47
  166. package/lib/cjs/resources/parcel_line_items.js +1 -37
  167. package/lib/cjs/resources/parcels.d.ts +1 -126
  168. package/lib/cjs/resources/parcels.js +1 -49
  169. package/lib/cjs/resources/payment_gateways.d.ts +1 -25
  170. package/lib/cjs/resources/payment_gateways.js +1 -24
  171. package/lib/cjs/resources/payment_methods.d.ts +1 -83
  172. package/lib/cjs/resources/payment_methods.js +1 -47
  173. package/lib/cjs/resources/payment_options.d.ts +1 -44
  174. package/lib/cjs/resources/payment_options.js +1 -33
  175. package/lib/cjs/resources/paypal_gateways.d.ts +1 -41
  176. package/lib/cjs/resources/paypal_gateways.js +1 -37
  177. package/lib/cjs/resources/paypal_payments.d.ts +1 -53
  178. package/lib/cjs/resources/paypal_payments.js +1 -37
  179. package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -131
  180. package/lib/cjs/resources/percentage_discount_promotions.js +1 -79
  181. package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -53
  182. package/lib/cjs/resources/price_frequency_tiers.js +1 -41
  183. package/lib/cjs/resources/price_lists.d.ts +1 -46
  184. package/lib/cjs/resources/price_lists.js +1 -37
  185. package/lib/cjs/resources/price_tiers.d.ts +1 -32
  186. package/lib/cjs/resources/price_tiers.js +1 -28
  187. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -53
  188. package/lib/cjs/resources/price_volume_tiers.js +1 -41
  189. package/lib/cjs/resources/prices.d.ts +1 -84
  190. package/lib/cjs/resources/prices.js +1 -65
  191. package/lib/cjs/resources/promotion_rules.d.ts +1 -29
  192. package/lib/cjs/resources/promotion_rules.js +1 -20
  193. package/lib/cjs/resources/promotions.d.ts +1 -63
  194. package/lib/cjs/resources/promotions.js +1 -60
  195. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -53
  196. package/lib/cjs/resources/recurring_order_copies.js +1 -41
  197. package/lib/cjs/resources/refunds.d.ts +1 -44
  198. package/lib/cjs/resources/refunds.js +1 -36
  199. package/lib/cjs/resources/reserved_stocks.d.ts +1 -28
  200. package/lib/cjs/resources/reserved_stocks.js +1 -28
  201. package/lib/cjs/resources/resource_errors.d.ts +1 -22
  202. package/lib/cjs/resources/resource_errors.js +1 -16
  203. package/lib/cjs/resources/return_line_items.d.ts +1 -52
  204. package/lib/cjs/resources/return_line_items.js +1 -36
  205. package/lib/cjs/resources/returns.d.ts +1 -96
  206. package/lib/cjs/resources/returns.js +1 -92
  207. package/lib/cjs/resources/satispay_gateways.d.ts +1 -46
  208. package/lib/cjs/resources/satispay_gateways.js +1 -37
  209. package/lib/cjs/resources/satispay_payments.d.ts +1 -50
  210. package/lib/cjs/resources/satispay_payments.js +1 -40
  211. package/lib/cjs/resources/shipments.d.ts +1 -151
  212. package/lib/cjs/resources/shipments.js +1 -130
  213. package/lib/cjs/resources/shipping_categories.d.ts +1 -40
  214. package/lib/cjs/resources/shipping_categories.js +1 -37
  215. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -32
  216. package/lib/cjs/resources/shipping_method_tiers.js +1 -28
  217. package/lib/cjs/resources/shipping_methods.d.ts +1 -125
  218. package/lib/cjs/resources/shipping_methods.js +1 -70
  219. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -50
  220. package/lib/cjs/resources/shipping_weight_tiers.js +1 -37
  221. package/lib/cjs/resources/shipping_zones.d.ts +1 -52
  222. package/lib/cjs/resources/shipping_zones.js +1 -33
  223. package/lib/cjs/resources/sku_list_items.d.ts +1 -51
  224. package/lib/cjs/resources/sku_list_items.js +1 -37
  225. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -76
  226. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -37
  227. package/lib/cjs/resources/sku_lists.d.ts +1 -64
  228. package/lib/cjs/resources/sku_lists.js +1 -49
  229. package/lib/cjs/resources/sku_options.d.ts +1 -71
  230. package/lib/cjs/resources/sku_options.js +1 -45
  231. package/lib/cjs/resources/skus.d.ts +1 -96
  232. package/lib/cjs/resources/skus.js +1 -65
  233. package/lib/cjs/resources/stock_items.d.ts +1 -61
  234. package/lib/cjs/resources/stock_items.js +1 -52
  235. package/lib/cjs/resources/stock_line_items.d.ts +1 -73
  236. package/lib/cjs/resources/stock_line_items.js +1 -54
  237. package/lib/cjs/resources/stock_locations.d.ts +1 -64
  238. package/lib/cjs/resources/stock_locations.js +1 -53
  239. package/lib/cjs/resources/stock_reservations.d.ts +1 -51
  240. package/lib/cjs/resources/stock_reservations.js +1 -48
  241. package/lib/cjs/resources/stock_transfers.d.ts +1 -86
  242. package/lib/cjs/resources/stock_transfers.js +1 -71
  243. package/lib/cjs/resources/stripe_gateways.d.ts +1 -45
  244. package/lib/cjs/resources/stripe_gateways.js +1 -37
  245. package/lib/cjs/resources/stripe_payments.d.ts +1 -59
  246. package/lib/cjs/resources/stripe_payments.js +1 -43
  247. package/lib/cjs/resources/subscription_models.d.ts +1 -49
  248. package/lib/cjs/resources/subscription_models.js +1 -37
  249. package/lib/cjs/resources/tags.d.ts +1 -28
  250. package/lib/cjs/resources/tags.js +1 -25
  251. package/lib/cjs/resources/tax_calculators.d.ts +1 -28
  252. package/lib/cjs/resources/tax_calculators.js +1 -28
  253. package/lib/cjs/resources/tax_categories.d.ts +1 -63
  254. package/lib/cjs/resources/tax_categories.js +1 -37
  255. package/lib/cjs/resources/tax_rules.d.ts +1 -73
  256. package/lib/cjs/resources/tax_rules.js +1 -33
  257. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -47
  258. package/lib/cjs/resources/taxjar_accounts.js +1 -41
  259. package/lib/cjs/resources/transactions.d.ts +1 -41
  260. package/lib/cjs/resources/transactions.js +1 -32
  261. package/lib/cjs/resources/versions.d.ts +1 -22
  262. package/lib/cjs/resources/versions.js +1 -16
  263. package/lib/cjs/resources/voids.d.ts +1 -44
  264. package/lib/cjs/resources/voids.js +1 -36
  265. package/lib/cjs/resources/webhooks.d.ts +1 -55
  266. package/lib/cjs/resources/webhooks.js +1 -42
  267. package/lib/cjs/resources/wire_transfers.d.ts +1 -37
  268. package/lib/cjs/resources/wire_transfers.js +1 -33
  269. package/lib/cjs/static.d.ts +1 -12
  270. package/lib/cjs/static.js +1 -51
  271. package/lib/cjs/util.d.ts +1 -4
  272. package/lib/cjs/util.js +1 -16
  273. package/lib/esm/api.d.ts +1 -164
  274. package/lib/esm/api.js +1 -258
  275. package/lib/esm/client.d.ts +1 -39
  276. package/lib/esm/client.js +1 -149
  277. package/lib/esm/commercelayer.d.ts +1 -153
  278. package/lib/esm/commercelayer.js +1 -224
  279. package/lib/esm/common.d.ts +1 -5
  280. package/lib/esm/common.js +1 -19
  281. package/lib/esm/config.d.ts +1 -15
  282. package/lib/esm/config.js +1 -17
  283. package/lib/esm/debug.d.ts +1 -3
  284. package/lib/esm/debug.js +1 -36
  285. package/lib/esm/error.d.ts +1 -31
  286. package/lib/esm/error.js +1 -69
  287. package/lib/esm/index.d.ts +1 -7
  288. package/lib/esm/index.js +1 -4
  289. package/lib/esm/interceptor.d.ts +1 -25
  290. package/lib/esm/interceptor.js +1 -1
  291. package/lib/esm/jsonapi.d.ts +1 -6
  292. package/lib/esm/jsonapi.js +1 -87
  293. package/lib/esm/model.d.ts +1 -124
  294. package/lib/esm/model.js +1 -2
  295. package/lib/esm/query.d.ts +1 -17
  296. package/lib/esm/query.js +1 -62
  297. package/lib/esm/resource.d.ts +1 -89
  298. package/lib/esm/resource.js +1 -191
  299. package/lib/esm/resources/addresses.d.ts +1 -103
  300. package/lib/esm/resources/addresses.js +1 -39
  301. package/lib/esm/resources/adjustments.d.ts +1 -42
  302. package/lib/esm/resources/adjustments.js +1 -27
  303. package/lib/esm/resources/adyen_gateways.d.ts +1 -60
  304. package/lib/esm/resources/adyen_gateways.js +1 -35
  305. package/lib/esm/resources/adyen_payments.d.ts +1 -51
  306. package/lib/esm/resources/adyen_payments.js +1 -38
  307. package/lib/esm/resources/application.d.ts +1 -22
  308. package/lib/esm/resources/application.js +1 -14
  309. package/lib/esm/resources/attachments.d.ts +1 -157
  310. package/lib/esm/resources/attachments.js +1 -23
  311. package/lib/esm/resources/authorizations.d.ts +1 -70
  312. package/lib/esm/resources/authorizations.js +1 -50
  313. package/lib/esm/resources/avalara_accounts.d.ts +1 -59
  314. package/lib/esm/resources/avalara_accounts.js +1 -39
  315. package/lib/esm/resources/axerve_gateways.d.ts +1 -48
  316. package/lib/esm/resources/axerve_gateways.js +1 -35
  317. package/lib/esm/resources/axerve_payments.d.ts +1 -54
  318. package/lib/esm/resources/axerve_payments.js +1 -38
  319. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -39
  320. package/lib/esm/resources/billing_info_validation_rules.js +1 -35
  321. package/lib/esm/resources/bing_geocoders.d.ts +1 -36
  322. package/lib/esm/resources/bing_geocoders.js +1 -31
  323. package/lib/esm/resources/braintree_gateways.d.ts +1 -60
  324. package/lib/esm/resources/braintree_gateways.js +1 -35
  325. package/lib/esm/resources/braintree_payments.d.ts +1 -52
  326. package/lib/esm/resources/braintree_payments.js +1 -35
  327. package/lib/esm/resources/bundles.d.ts +1 -93
  328. package/lib/esm/resources/bundles.js +1 -57
  329. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -137
  330. package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -77
  331. package/lib/esm/resources/captures.d.ts +1 -60
  332. package/lib/esm/resources/captures.js +1 -47
  333. package/lib/esm/resources/carrier_accounts.d.ts +1 -30
  334. package/lib/esm/resources/carrier_accounts.js +1 -26
  335. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -49
  336. package/lib/esm/resources/checkout_com_gateways.js +1 -35
  337. package/lib/esm/resources/checkout_com_payments.d.ts +1 -65
  338. package/lib/esm/resources/checkout_com_payments.js +1 -41
  339. package/lib/esm/resources/cleanups.d.ts +1 -40
  340. package/lib/esm/resources/cleanups.js +1 -28
  341. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -67
  342. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -31
  343. package/lib/esm/resources/coupon_recipients.d.ts +1 -48
  344. package/lib/esm/resources/coupon_recipients.js +1 -35
  345. package/lib/esm/resources/coupons.d.ts +1 -71
  346. package/lib/esm/resources/coupons.js +1 -43
  347. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -62
  348. package/lib/esm/resources/custom_promotion_rules.js +1 -27
  349. package/lib/esm/resources/customer_addresses.d.ts +1 -50
  350. package/lib/esm/resources/customer_addresses.js +1 -39
  351. package/lib/esm/resources/customer_groups.d.ts +1 -40
  352. package/lib/esm/resources/customer_groups.js +1 -39
  353. package/lib/esm/resources/customer_password_resets.d.ts +1 -38
  354. package/lib/esm/resources/customer_password_resets.js +1 -34
  355. package/lib/esm/resources/customer_payment_sources.d.ts +1 -86
  356. package/lib/esm/resources/customer_payment_sources.js +1 -35
  357. package/lib/esm/resources/customer_subscriptions.d.ts +1 -35
  358. package/lib/esm/resources/customer_subscriptions.js +1 -35
  359. package/lib/esm/resources/customers.d.ts +1 -76
  360. package/lib/esm/resources/customers.js +1 -67
  361. package/lib/esm/resources/delivery_lead_times.d.ts +1 -55
  362. package/lib/esm/resources/delivery_lead_times.js +1 -39
  363. package/lib/esm/resources/event_callbacks.d.ts +1 -25
  364. package/lib/esm/resources/event_callbacks.js +1 -18
  365. package/lib/esm/resources/events.d.ts +1 -25
  366. package/lib/esm/resources/events.js +1 -22
  367. package/lib/esm/resources/exports.d.ts +1 -41
  368. package/lib/esm/resources/exports.js +1 -24
  369. package/lib/esm/resources/external_gateways.d.ts +1 -57
  370. package/lib/esm/resources/external_gateways.js +1 -38
  371. package/lib/esm/resources/external_payments.d.ts +1 -48
  372. package/lib/esm/resources/external_payments.js +1 -39
  373. package/lib/esm/resources/external_promotions.d.ts +1 -136
  374. package/lib/esm/resources/external_promotions.js +1 -80
  375. package/lib/esm/resources/external_tax_calculators.d.ts +1 -45
  376. package/lib/esm/resources/external_tax_calculators.js +1 -38
  377. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -133
  378. package/lib/esm/resources/fixed_amount_promotions.js +1 -77
  379. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -133
  380. package/lib/esm/resources/fixed_price_promotions.js +1 -77
  381. package/lib/esm/resources/free_gift_promotions.d.ts +1 -131
  382. package/lib/esm/resources/free_gift_promotions.js +1 -77
  383. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -125
  384. package/lib/esm/resources/free_shipping_promotions.js +1 -73
  385. package/lib/esm/resources/geocoders.d.ts +1 -25
  386. package/lib/esm/resources/geocoders.js +1 -22
  387. package/lib/esm/resources/gift_card_recipients.d.ts +1 -48
  388. package/lib/esm/resources/gift_card_recipients.js +1 -35
  389. package/lib/esm/resources/gift_cards.d.ts +1 -104
  390. package/lib/esm/resources/gift_cards.js +1 -59
  391. package/lib/esm/resources/google_geocoders.d.ts +1 -36
  392. package/lib/esm/resources/google_geocoders.js +1 -31
  393. package/lib/esm/resources/imports.d.ts +1 -44
  394. package/lib/esm/resources/imports.js +1 -24
  395. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -68
  396. package/lib/esm/resources/in_stock_subscriptions.js +1 -49
  397. package/lib/esm/resources/inventory_models.d.ts +1 -55
  398. package/lib/esm/resources/inventory_models.js +1 -39
  399. package/lib/esm/resources/inventory_return_locations.d.ts +1 -47
  400. package/lib/esm/resources/inventory_return_locations.js +1 -35
  401. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -50
  402. package/lib/esm/resources/inventory_stock_locations.js +1 -35
  403. package/lib/esm/resources/klarna_gateways.d.ts +1 -48
  404. package/lib/esm/resources/klarna_gateways.js +1 -35
  405. package/lib/esm/resources/klarna_payments.d.ts +1 -48
  406. package/lib/esm/resources/klarna_payments.js +1 -38
  407. package/lib/esm/resources/line_item_options.d.ts +1 -69
  408. package/lib/esm/resources/line_item_options.js +1 -39
  409. package/lib/esm/resources/line_items.d.ts +1 -170
  410. package/lib/esm/resources/line_items.js +1 -64
  411. package/lib/esm/resources/manual_gateways.d.ts +1 -34
  412. package/lib/esm/resources/manual_gateways.js +1 -31
  413. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -45
  414. package/lib/esm/resources/manual_tax_calculators.js +1 -39
  415. package/lib/esm/resources/markets.d.ts +1 -107
  416. package/lib/esm/resources/markets.js +1 -61
  417. package/lib/esm/resources/merchants.d.ts +1 -42
  418. package/lib/esm/resources/merchants.js +1 -35
  419. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -67
  420. package/lib/esm/resources/order_amount_promotion_rules.js +1 -27
  421. package/lib/esm/resources/order_copies.d.ts +1 -51
  422. package/lib/esm/resources/order_copies.js +1 -39
  423. package/lib/esm/resources/order_factories.d.ts +1 -34
  424. package/lib/esm/resources/order_factories.js +1 -26
  425. package/lib/esm/resources/order_subscription_items.d.ts +1 -72
  426. package/lib/esm/resources/order_subscription_items.js +1 -31
  427. package/lib/esm/resources/order_subscriptions.d.ts +1 -98
  428. package/lib/esm/resources/order_subscriptions.js +1 -76
  429. package/lib/esm/resources/order_validation_rules.d.ts +1 -27
  430. package/lib/esm/resources/order_validation_rules.js +1 -26
  431. package/lib/esm/resources/orders.d.ts +1 -389
  432. package/lib/esm/resources/orders.js +1 -234
  433. package/lib/esm/resources/organization.d.ts +1 -34
  434. package/lib/esm/resources/organization.js +1 -14
  435. package/lib/esm/resources/packages.d.ts +1 -60
  436. package/lib/esm/resources/packages.js +1 -39
  437. package/lib/esm/resources/parcel_line_items.d.ts +1 -47
  438. package/lib/esm/resources/parcel_line_items.js +1 -35
  439. package/lib/esm/resources/parcels.d.ts +1 -126
  440. package/lib/esm/resources/parcels.js +1 -47
  441. package/lib/esm/resources/payment_gateways.d.ts +1 -25
  442. package/lib/esm/resources/payment_gateways.js +1 -22
  443. package/lib/esm/resources/payment_methods.d.ts +1 -83
  444. package/lib/esm/resources/payment_methods.js +1 -45
  445. package/lib/esm/resources/payment_options.d.ts +1 -44
  446. package/lib/esm/resources/payment_options.js +1 -31
  447. package/lib/esm/resources/paypal_gateways.d.ts +1 -41
  448. package/lib/esm/resources/paypal_gateways.js +1 -35
  449. package/lib/esm/resources/paypal_payments.d.ts +1 -53
  450. package/lib/esm/resources/paypal_payments.js +1 -35
  451. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -131
  452. package/lib/esm/resources/percentage_discount_promotions.js +1 -77
  453. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -53
  454. package/lib/esm/resources/price_frequency_tiers.js +1 -39
  455. package/lib/esm/resources/price_lists.d.ts +1 -46
  456. package/lib/esm/resources/price_lists.js +1 -35
  457. package/lib/esm/resources/price_tiers.d.ts +1 -32
  458. package/lib/esm/resources/price_tiers.js +1 -26
  459. package/lib/esm/resources/price_volume_tiers.d.ts +1 -53
  460. package/lib/esm/resources/price_volume_tiers.js +1 -39
  461. package/lib/esm/resources/prices.d.ts +1 -84
  462. package/lib/esm/resources/prices.js +1 -63
  463. package/lib/esm/resources/promotion_rules.d.ts +1 -29
  464. package/lib/esm/resources/promotion_rules.js +1 -18
  465. package/lib/esm/resources/promotions.d.ts +1 -63
  466. package/lib/esm/resources/promotions.js +1 -58
  467. package/lib/esm/resources/recurring_order_copies.d.ts +1 -53
  468. package/lib/esm/resources/recurring_order_copies.js +1 -39
  469. package/lib/esm/resources/refunds.d.ts +1 -44
  470. package/lib/esm/resources/refunds.js +1 -34
  471. package/lib/esm/resources/reserved_stocks.d.ts +1 -28
  472. package/lib/esm/resources/reserved_stocks.js +1 -26
  473. package/lib/esm/resources/resource_errors.d.ts +1 -22
  474. package/lib/esm/resources/resource_errors.js +1 -14
  475. package/lib/esm/resources/return_line_items.d.ts +1 -52
  476. package/lib/esm/resources/return_line_items.js +1 -34
  477. package/lib/esm/resources/returns.d.ts +1 -96
  478. package/lib/esm/resources/returns.js +1 -90
  479. package/lib/esm/resources/satispay_gateways.d.ts +1 -46
  480. package/lib/esm/resources/satispay_gateways.js +1 -35
  481. package/lib/esm/resources/satispay_payments.d.ts +1 -50
  482. package/lib/esm/resources/satispay_payments.js +1 -38
  483. package/lib/esm/resources/shipments.d.ts +1 -151
  484. package/lib/esm/resources/shipments.js +1 -128
  485. package/lib/esm/resources/shipping_categories.d.ts +1 -40
  486. package/lib/esm/resources/shipping_categories.js +1 -35
  487. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -32
  488. package/lib/esm/resources/shipping_method_tiers.js +1 -26
  489. package/lib/esm/resources/shipping_methods.d.ts +1 -125
  490. package/lib/esm/resources/shipping_methods.js +1 -68
  491. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -50
  492. package/lib/esm/resources/shipping_weight_tiers.js +1 -35
  493. package/lib/esm/resources/shipping_zones.d.ts +1 -52
  494. package/lib/esm/resources/shipping_zones.js +1 -31
  495. package/lib/esm/resources/sku_list_items.d.ts +1 -51
  496. package/lib/esm/resources/sku_list_items.js +1 -35
  497. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -76
  498. package/lib/esm/resources/sku_list_promotion_rules.js +1 -35
  499. package/lib/esm/resources/sku_lists.d.ts +1 -64
  500. package/lib/esm/resources/sku_lists.js +1 -47
  501. package/lib/esm/resources/sku_options.d.ts +1 -71
  502. package/lib/esm/resources/sku_options.js +1 -43
  503. package/lib/esm/resources/skus.d.ts +1 -96
  504. package/lib/esm/resources/skus.js +1 -63
  505. package/lib/esm/resources/stock_items.d.ts +1 -61
  506. package/lib/esm/resources/stock_items.js +1 -50
  507. package/lib/esm/resources/stock_line_items.d.ts +1 -73
  508. package/lib/esm/resources/stock_line_items.js +1 -52
  509. package/lib/esm/resources/stock_locations.d.ts +1 -64
  510. package/lib/esm/resources/stock_locations.js +1 -51
  511. package/lib/esm/resources/stock_reservations.d.ts +1 -51
  512. package/lib/esm/resources/stock_reservations.js +1 -46
  513. package/lib/esm/resources/stock_transfers.d.ts +1 -86
  514. package/lib/esm/resources/stock_transfers.js +1 -69
  515. package/lib/esm/resources/stripe_gateways.d.ts +1 -45
  516. package/lib/esm/resources/stripe_gateways.js +1 -35
  517. package/lib/esm/resources/stripe_payments.d.ts +1 -59
  518. package/lib/esm/resources/stripe_payments.js +1 -41
  519. package/lib/esm/resources/subscription_models.d.ts +1 -49
  520. package/lib/esm/resources/subscription_models.js +1 -35
  521. package/lib/esm/resources/tags.d.ts +1 -28
  522. package/lib/esm/resources/tags.js +1 -23
  523. package/lib/esm/resources/tax_calculators.d.ts +1 -28
  524. package/lib/esm/resources/tax_calculators.js +1 -26
  525. package/lib/esm/resources/tax_categories.d.ts +1 -63
  526. package/lib/esm/resources/tax_categories.js +1 -35
  527. package/lib/esm/resources/tax_rules.d.ts +1 -73
  528. package/lib/esm/resources/tax_rules.js +1 -31
  529. package/lib/esm/resources/taxjar_accounts.d.ts +1 -47
  530. package/lib/esm/resources/taxjar_accounts.js +1 -39
  531. package/lib/esm/resources/transactions.d.ts +1 -41
  532. package/lib/esm/resources/transactions.js +1 -30
  533. package/lib/esm/resources/versions.d.ts +1 -22
  534. package/lib/esm/resources/versions.js +1 -14
  535. package/lib/esm/resources/voids.d.ts +1 -44
  536. package/lib/esm/resources/voids.js +1 -34
  537. package/lib/esm/resources/webhooks.d.ts +1 -55
  538. package/lib/esm/resources/webhooks.js +1 -40
  539. package/lib/esm/resources/wire_transfers.d.ts +1 -37
  540. package/lib/esm/resources/wire_transfers.js +1 -31
  541. package/lib/esm/static.d.ts +1 -12
  542. package/lib/esm/static.js +1 -25
  543. package/lib/esm/util.d.ts +1 -4
  544. package/lib/esm/util.js +1 -37
  545. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  546. package/lib/tsconfig.tsbuildinfo +1 -1
  547. package/package.json +2 -2
@@ -1,53 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class StockLocations extends resource_1.ApiResource {
5
- async create(resource, params, options) {
6
- return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
7
- }
8
- async update(resource, params, options) {
9
- return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
10
- }
11
- async delete(id, options) {
12
- await this.resources.delete((typeof id === 'string') ? { id, type: StockLocations.TYPE } : id, options);
13
- }
14
- async address(stockLocationId, params, options) {
15
- const _stockLocationId = stockLocationId.id || stockLocationId;
16
- return this.resources.fetch({ type: 'addresses' }, `stock_locations/${_stockLocationId}/address`, params, options);
17
- }
18
- async inventory_stock_locations(stockLocationId, params, options) {
19
- const _stockLocationId = stockLocationId.id || stockLocationId;
20
- return this.resources.fetch({ type: 'inventory_stock_locations' }, `stock_locations/${_stockLocationId}/inventory_stock_locations`, params, options);
21
- }
22
- async inventory_return_locations(stockLocationId, params, options) {
23
- const _stockLocationId = stockLocationId.id || stockLocationId;
24
- return this.resources.fetch({ type: 'inventory_return_locations' }, `stock_locations/${_stockLocationId}/inventory_return_locations`, params, options);
25
- }
26
- async stock_items(stockLocationId, params, options) {
27
- const _stockLocationId = stockLocationId.id || stockLocationId;
28
- return this.resources.fetch({ type: 'stock_items' }, `stock_locations/${_stockLocationId}/stock_items`, params, options);
29
- }
30
- async stock_transfers(stockLocationId, params, options) {
31
- const _stockLocationId = stockLocationId.id || stockLocationId;
32
- return this.resources.fetch({ type: 'stock_transfers' }, `stock_locations/${_stockLocationId}/stock_transfers`, params, options);
33
- }
34
- async attachments(stockLocationId, params, options) {
35
- const _stockLocationId = stockLocationId.id || stockLocationId;
36
- return this.resources.fetch({ type: 'attachments' }, `stock_locations/${_stockLocationId}/attachments`, params, options);
37
- }
38
- async versions(stockLocationId, params, options) {
39
- const _stockLocationId = stockLocationId.id || stockLocationId;
40
- return this.resources.fetch({ type: 'versions' }, `stock_locations/${_stockLocationId}/versions`, params, options);
41
- }
42
- isStockLocation(resource) {
43
- return resource.type && (resource.type === StockLocations.TYPE);
44
- }
45
- relationship(id) {
46
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockLocations.TYPE } : { id: id.id, type: StockLocations.TYPE };
47
- }
48
- type() {
49
- return StockLocations.TYPE;
50
- }
51
- }
52
- StockLocations.TYPE = 'stock_locations';
53
- exports.default = StockLocations;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StockLocations extends resource_1.ApiResource{async create(t,e,s){return this.resources.create({...t,type:StockLocations.TYPE},e,s)}async update(t,e,s){return this.resources.update({...t,type:StockLocations.TYPE},e,s)}async delete(t,e){await this.resources.delete(typeof t=="string"?{id:t,type:StockLocations.TYPE}:t,e)}async address(t,e,s){const r=t.id||t;return this.resources.fetch({type:"addresses"},`stock_locations/${r}/address`,e,s)}async inventory_stock_locations(t,e,s){const r=t.id||t;return this.resources.fetch({type:"inventory_stock_locations"},`stock_locations/${r}/inventory_stock_locations`,e,s)}async inventory_return_locations(t,e,s){const r=t.id||t;return this.resources.fetch({type:"inventory_return_locations"},`stock_locations/${r}/inventory_return_locations`,e,s)}async stock_items(t,e,s){const r=t.id||t;return this.resources.fetch({type:"stock_items"},`stock_locations/${r}/stock_items`,e,s)}async stock_transfers(t,e,s){const r=t.id||t;return this.resources.fetch({type:"stock_transfers"},`stock_locations/${r}/stock_transfers`,e,s)}async attachments(t,e,s){const r=t.id||t;return this.resources.fetch({type:"attachments"},`stock_locations/${r}/attachments`,e,s)}async versions(t,e,s){const r=t.id||t;return this.resources.fetch({type:"versions"},`stock_locations/${r}/versions`,e,s)}isStockLocation(t){return t.type&&t.type===StockLocations.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:StockLocations.TYPE}:{id:t.id,type:StockLocations.TYPE}}type(){return StockLocations.TYPE}}StockLocations.TYPE="stock_locations",exports.default=StockLocations;
@@ -1,51 +1 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
4
- import type { LineItem } from './line_items';
5
- import type { Order } from './orders';
6
- import type { StockItem, StockItemType } from './stock_items';
7
- import type { ReservedStock } from './reserved_stocks';
8
- import type { Sku } from './skus';
9
- type StockReservationType = 'stock_reservations';
10
- type StockReservationRel = ResourceRel & {
11
- type: StockReservationType;
12
- };
13
- type StockItemRel = ResourceRel & {
14
- type: StockItemType;
15
- };
16
- interface StockReservation extends Resource {
17
- readonly type: StockReservationType;
18
- status: 'draft' | 'pending';
19
- quantity: number;
20
- expires_at: string;
21
- line_item?: LineItem | null;
22
- order?: Order | null;
23
- stock_item?: StockItem | null;
24
- reserved_stock?: ReservedStock | null;
25
- sku?: Sku | null;
26
- }
27
- interface StockReservationCreate extends ResourceCreate {
28
- quantity: number;
29
- stock_item: StockItemRel;
30
- }
31
- interface StockReservationUpdate extends ResourceUpdate {
32
- quantity?: number | null;
33
- _pending?: boolean | null;
34
- }
35
- declare class StockReservations extends ApiResource<StockReservation> {
36
- static readonly TYPE: StockReservationType;
37
- create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
38
- update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
39
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
40
- line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
41
- order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
42
- stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
43
- reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
44
- sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
45
- _pending(id: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
46
- isStockReservation(resource: any): resource is StockReservation;
47
- relationship(id: string | ResourceId | null): StockReservationRel;
48
- type(): StockReservationType;
49
- }
50
- export default StockReservations;
51
- export type { StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType };
1
+ import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel}from'../resource';import type{QueryParamsRetrieve}from'../query';import type{LineItem}from'./line_items';import type{Order}from'./orders';import type{StockItem,StockItemType}from'./stock_items';import type{ReservedStock}from'./reserved_stocks';import type{Sku}from'./skus';type StockReservationType='stock_reservations';type StockReservationRel=ResourceRel&{type:StockReservationType;};type StockItemRel=ResourceRel&{type:StockItemType;};interface StockReservation extends Resource{readonly type:StockReservationType;status:'draft'|'pending';quantity:number;expires_at:string;line_item?:LineItem|null;order?:Order|null;stock_item?:StockItem|null;reserved_stock?:ReservedStock|null;sku?:Sku|null;}interface StockReservationCreate extends ResourceCreate{quantity:number;stock_item:StockItemRel;}interface StockReservationUpdate extends ResourceUpdate{quantity?:number|null;_pending?:boolean|null;}declare class StockReservations extends ApiResource<StockReservation>{static readonly TYPE:StockReservationType;create(resource:StockReservationCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockReservation>;update(resource:StockReservationUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockReservation>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;line_item(stockReservationId:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;order(stockReservationId:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;stock_item(stockReservationId:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;reserved_stock(stockReservationId:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReservedStock>;sku(stockReservationId:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;_pending(id:string|StockReservation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockReservation>;isStockReservation(resource:any):resource is StockReservation;relationship(id:string|ResourceId|null):StockReservationRel;type():StockReservationType;}export default StockReservations;export type{StockReservation,StockReservationCreate,StockReservationUpdate,StockReservationType};
@@ -1,48 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class StockReservations extends resource_1.ApiResource {
5
- async create(resource, params, options) {
6
- return this.resources.create({ ...resource, type: StockReservations.TYPE }, params, options);
7
- }
8
- async update(resource, params, options) {
9
- return this.resources.update({ ...resource, type: StockReservations.TYPE }, params, options);
10
- }
11
- async delete(id, options) {
12
- await this.resources.delete((typeof id === 'string') ? { id, type: StockReservations.TYPE } : id, options);
13
- }
14
- async line_item(stockReservationId, params, options) {
15
- const _stockReservationId = stockReservationId.id || stockReservationId;
16
- return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
17
- }
18
- async order(stockReservationId, params, options) {
19
- const _stockReservationId = stockReservationId.id || stockReservationId;
20
- return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
21
- }
22
- async stock_item(stockReservationId, params, options) {
23
- const _stockReservationId = stockReservationId.id || stockReservationId;
24
- return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
25
- }
26
- async reserved_stock(stockReservationId, params, options) {
27
- const _stockReservationId = stockReservationId.id || stockReservationId;
28
- return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
29
- }
30
- async sku(stockReservationId, params, options) {
31
- const _stockReservationId = stockReservationId.id || stockReservationId;
32
- return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
33
- }
34
- async _pending(id, params, options) {
35
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockReservations.TYPE, _pending: true }, params, options);
36
- }
37
- isStockReservation(resource) {
38
- return resource.type && (resource.type === StockReservations.TYPE);
39
- }
40
- relationship(id) {
41
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
42
- }
43
- type() {
44
- return StockReservations.TYPE;
45
- }
46
- }
47
- StockReservations.TYPE = 'stock_reservations';
48
- exports.default = StockReservations;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StockReservations extends resource_1.ApiResource{async create(e,t,s){return this.resources.create({...e,type:StockReservations.TYPE},t,s)}async update(e,t,s){return this.resources.update({...e,type:StockReservations.TYPE},t,s)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:StockReservations.TYPE}:e,t)}async line_item(e,t,s){const r=e.id||e;return this.resources.fetch({type:"line_items"},`stock_reservations/${r}/line_item`,t,s)}async order(e,t,s){const r=e.id||e;return this.resources.fetch({type:"orders"},`stock_reservations/${r}/order`,t,s)}async stock_item(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_items"},`stock_reservations/${r}/stock_item`,t,s)}async reserved_stock(e,t,s){const r=e.id||e;return this.resources.fetch({type:"reserved_stocks"},`stock_reservations/${r}/reserved_stock`,t,s)}async sku(e,t,s){const r=e.id||e;return this.resources.fetch({type:"skus"},`stock_reservations/${r}/sku`,t,s)}async _pending(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockReservations.TYPE,_pending:!0},t,s)}isStockReservation(e){return e.type&&e.type===StockReservations.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:StockReservations.TYPE}:{id:e.id,type:StockReservations.TYPE}}type(){return StockReservations.TYPE}}StockReservations.TYPE="stock_reservations",exports.default=StockReservations;
@@ -1,86 +1 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { Sku, SkuType } from './skus';
5
- import type { StockLocation, StockLocationType } from './stock_locations';
6
- import type { Shipment, ShipmentType } from './shipments';
7
- import type { LineItem, LineItemType } from './line_items';
8
- import type { Event } from './events';
9
- import type { Version } from './versions';
10
- type StockTransferType = 'stock_transfers';
11
- type StockTransferRel = ResourceRel & {
12
- type: StockTransferType;
13
- };
14
- type SkuRel = ResourceRel & {
15
- type: SkuType;
16
- };
17
- type StockLocationRel = ResourceRel & {
18
- type: StockLocationType;
19
- };
20
- type ShipmentRel = ResourceRel & {
21
- type: ShipmentType;
22
- };
23
- type LineItemRel = ResourceRel & {
24
- type: LineItemType;
25
- };
26
- interface StockTransfer extends Resource {
27
- readonly type: StockTransferType;
28
- number?: string | null;
29
- sku_code?: string | null;
30
- status: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
31
- quantity: number;
32
- completed_at?: string | null;
33
- cancelled_at?: string | null;
34
- sku?: Sku | null;
35
- origin_stock_location?: StockLocation | null;
36
- destination_stock_location?: StockLocation | null;
37
- shipment?: Shipment | null;
38
- line_item?: LineItem | null;
39
- events?: Event[] | null;
40
- versions?: Version[] | null;
41
- }
42
- interface StockTransferCreate extends ResourceCreate {
43
- sku_code?: string | null;
44
- quantity: number;
45
- sku: SkuRel;
46
- origin_stock_location: StockLocationRel;
47
- destination_stock_location: StockLocationRel;
48
- shipment?: ShipmentRel | null;
49
- line_item?: LineItemRel | null;
50
- }
51
- interface StockTransferUpdate extends ResourceUpdate {
52
- sku_code?: string | null;
53
- _upcoming?: boolean | null;
54
- _on_hold?: boolean | null;
55
- _picking?: boolean | null;
56
- _in_transit?: boolean | null;
57
- _complete?: boolean | null;
58
- _cancel?: boolean | null;
59
- sku?: SkuRel | null;
60
- origin_stock_location?: StockLocationRel | null;
61
- destination_stock_location?: StockLocationRel | null;
62
- }
63
- declare class StockTransfers extends ApiResource<StockTransfer> {
64
- static readonly TYPE: StockTransferType;
65
- create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
66
- update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
67
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
68
- sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
69
- origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
70
- destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
71
- shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
72
- line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
73
- events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
74
- versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
75
- _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
76
- _on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
77
- _picking(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
78
- _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
79
- _complete(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
80
- _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
81
- isStockTransfer(resource: any): resource is StockTransfer;
82
- relationship(id: string | ResourceId | null): StockTransferRel;
83
- type(): StockTransferType;
84
- }
85
- export default StockTransfers;
86
- export type { StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType };
1
+ import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Sku,SkuType}from'./skus';import type{StockLocation,StockLocationType}from'./stock_locations';import type{Shipment,ShipmentType}from'./shipments';import type{LineItem,LineItemType}from'./line_items';import type{Event}from'./events';import type{Version}from'./versions';type StockTransferType='stock_transfers';type StockTransferRel=ResourceRel&{type:StockTransferType;};type SkuRel=ResourceRel&{type:SkuType;};type StockLocationRel=ResourceRel&{type:StockLocationType;};type ShipmentRel=ResourceRel&{type:ShipmentType;};type LineItemRel=ResourceRel&{type:LineItemType;};interface StockTransfer extends Resource{readonly type:StockTransferType;number?:string|null;sku_code?:string|null;status:'draft'|'upcoming'|'on_hold'|'picking'|'in_transit'|'completed'|'cancelled';quantity:number;completed_at?:string|null;cancelled_at?:string|null;sku?:Sku|null;origin_stock_location?:StockLocation|null;destination_stock_location?:StockLocation|null;shipment?:Shipment|null;line_item?:LineItem|null;events?:Event[]|null;versions?:Version[]|null;}interface StockTransferCreate extends ResourceCreate{sku_code?:string|null;quantity:number;sku:SkuRel;origin_stock_location:StockLocationRel;destination_stock_location:StockLocationRel;shipment?:ShipmentRel|null;line_item?:LineItemRel|null;}interface StockTransferUpdate extends ResourceUpdate{sku_code?:string|null;_upcoming?:boolean|null;_on_hold?:boolean|null;_picking?:boolean|null;_in_transit?:boolean|null;_complete?:boolean|null;_cancel?:boolean|null;sku?:SkuRel|null;origin_stock_location?:StockLocationRel|null;destination_stock_location?:StockLocationRel|null;}declare class StockTransfers extends ApiResource<StockTransfer>{static readonly TYPE:StockTransferType;create(resource:StockTransferCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;update(resource:StockTransferUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;sku(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;origin_stock_location(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;destination_stock_location(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;shipment(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;line_item(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;events(stockTransferId:string|StockTransfer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;versions(stockTransferId:string|StockTransfer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;_upcoming(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;_on_hold(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;_picking(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;_in_transit(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;_complete(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;_cancel(id:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;isStockTransfer(resource:any):resource is StockTransfer;relationship(id:string|ResourceId|null):StockTransferRel;type():StockTransferType;}export default StockTransfers;export type{StockTransfer,StockTransferCreate,StockTransferUpdate,StockTransferType};
@@ -1,71 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class StockTransfers extends resource_1.ApiResource {
5
- async create(resource, params, options) {
6
- return this.resources.create({ ...resource, type: StockTransfers.TYPE }, params, options);
7
- }
8
- async update(resource, params, options) {
9
- return this.resources.update({ ...resource, type: StockTransfers.TYPE }, params, options);
10
- }
11
- async delete(id, options) {
12
- await this.resources.delete((typeof id === 'string') ? { id, type: StockTransfers.TYPE } : id, options);
13
- }
14
- async sku(stockTransferId, params, options) {
15
- const _stockTransferId = stockTransferId.id || stockTransferId;
16
- return this.resources.fetch({ type: 'skus' }, `stock_transfers/${_stockTransferId}/sku`, params, options);
17
- }
18
- async origin_stock_location(stockTransferId, params, options) {
19
- const _stockTransferId = stockTransferId.id || stockTransferId;
20
- return this.resources.fetch({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/origin_stock_location`, params, options);
21
- }
22
- async destination_stock_location(stockTransferId, params, options) {
23
- const _stockTransferId = stockTransferId.id || stockTransferId;
24
- return this.resources.fetch({ type: 'stock_locations' }, `stock_transfers/${_stockTransferId}/destination_stock_location`, params, options);
25
- }
26
- async shipment(stockTransferId, params, options) {
27
- const _stockTransferId = stockTransferId.id || stockTransferId;
28
- return this.resources.fetch({ type: 'shipments' }, `stock_transfers/${_stockTransferId}/shipment`, params, options);
29
- }
30
- async line_item(stockTransferId, params, options) {
31
- const _stockTransferId = stockTransferId.id || stockTransferId;
32
- return this.resources.fetch({ type: 'line_items' }, `stock_transfers/${_stockTransferId}/line_item`, params, options);
33
- }
34
- async events(stockTransferId, params, options) {
35
- const _stockTransferId = stockTransferId.id || stockTransferId;
36
- return this.resources.fetch({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options);
37
- }
38
- async versions(stockTransferId, params, options) {
39
- const _stockTransferId = stockTransferId.id || stockTransferId;
40
- return this.resources.fetch({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options);
41
- }
42
- async _upcoming(id, params, options) {
43
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options);
44
- }
45
- async _on_hold(id, params, options) {
46
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options);
47
- }
48
- async _picking(id, params, options) {
49
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _picking: true }, params, options);
50
- }
51
- async _in_transit(id, params, options) {
52
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options);
53
- }
54
- async _complete(id, params, options) {
55
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _complete: true }, params, options);
56
- }
57
- async _cancel(id, params, options) {
58
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _cancel: true }, params, options);
59
- }
60
- isStockTransfer(resource) {
61
- return resource.type && (resource.type === StockTransfers.TYPE);
62
- }
63
- relationship(id) {
64
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockTransfers.TYPE } : { id: id.id, type: StockTransfers.TYPE };
65
- }
66
- type() {
67
- return StockTransfers.TYPE;
68
- }
69
- }
70
- StockTransfers.TYPE = 'stock_transfers';
71
- exports.default = StockTransfers;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StockTransfers extends resource_1.ApiResource{async create(e,t,s){return this.resources.create({...e,type:StockTransfers.TYPE},t,s)}async update(e,t,s){return this.resources.update({...e,type:StockTransfers.TYPE},t,s)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:StockTransfers.TYPE}:e,t)}async sku(e,t,s){const r=e.id||e;return this.resources.fetch({type:"skus"},`stock_transfers/${r}/sku`,t,s)}async origin_stock_location(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_locations"},`stock_transfers/${r}/origin_stock_location`,t,s)}async destination_stock_location(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_locations"},`stock_transfers/${r}/destination_stock_location`,t,s)}async shipment(e,t,s){const r=e.id||e;return this.resources.fetch({type:"shipments"},`stock_transfers/${r}/shipment`,t,s)}async line_item(e,t,s){const r=e.id||e;return this.resources.fetch({type:"line_items"},`stock_transfers/${r}/line_item`,t,s)}async events(e,t,s){const r=e.id||e;return this.resources.fetch({type:"events"},`stock_transfers/${r}/events`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`stock_transfers/${r}/versions`,t,s)}async _upcoming(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_upcoming:!0},t,s)}async _on_hold(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_on_hold:!0},t,s)}async _picking(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_picking:!0},t,s)}async _in_transit(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_in_transit:!0},t,s)}async _complete(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_complete:!0},t,s)}async _cancel(e,t,s){return this.resources.update({id:typeof e=="string"?e:e.id,type:StockTransfers.TYPE,_cancel:!0},t,s)}isStockTransfer(e){return e.type&&e.type===StockTransfers.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:StockTransfers.TYPE}:{id:e.id,type:StockTransfers.TYPE}}type(){return StockTransfers.TYPE}}StockTransfers.TYPE="stock_transfers",exports.default=StockTransfers;
@@ -1,45 +1 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { PaymentMethod } from './payment_methods';
5
- import type { Version } from './versions';
6
- import type { StripePayment } from './stripe_payments';
7
- type StripeGatewayType = 'stripe_gateways';
8
- type StripeGatewayRel = ResourceRel & {
9
- type: StripeGatewayType;
10
- };
11
- interface StripeGateway extends Resource {
12
- readonly type: StripeGatewayType;
13
- name: string;
14
- auto_payments?: boolean | null;
15
- webhook_endpoint_id?: string | null;
16
- webhook_endpoint_secret?: string | null;
17
- webhook_endpoint_url?: string | null;
18
- payment_methods?: PaymentMethod[] | null;
19
- versions?: Version[] | null;
20
- stripe_payments?: StripePayment[] | null;
21
- }
22
- interface StripeGatewayCreate extends ResourceCreate {
23
- name: string;
24
- login: string;
25
- publishable_key?: string | null;
26
- auto_payments?: boolean | null;
27
- }
28
- interface StripeGatewayUpdate extends ResourceUpdate {
29
- name?: string | null;
30
- auto_payments?: boolean | null;
31
- }
32
- declare class StripeGateways extends ApiResource<StripeGateway> {
33
- static readonly TYPE: StripeGatewayType;
34
- create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
35
- update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
36
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
37
- payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
38
- versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
39
- stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
40
- isStripeGateway(resource: any): resource is StripeGateway;
41
- relationship(id: string | ResourceId | null): StripeGatewayRel;
42
- type(): StripeGatewayType;
43
- }
44
- export default StripeGateways;
45
- export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType };
1
+ import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{PaymentMethod}from'./payment_methods';import type{Version}from'./versions';import type{StripePayment}from'./stripe_payments';type StripeGatewayType='stripe_gateways';type StripeGatewayRel=ResourceRel&{type:StripeGatewayType;};interface StripeGateway extends Resource{readonly type:StripeGatewayType;name:string;auto_payments?:boolean|null;webhook_endpoint_id?:string|null;webhook_endpoint_secret?:string|null;webhook_endpoint_url?:string|null;payment_methods?:PaymentMethod[]|null;versions?:Version[]|null;stripe_payments?:StripePayment[]|null;}interface StripeGatewayCreate extends ResourceCreate{name:string;login:string;publishable_key?:string|null;auto_payments?:boolean|null;}interface StripeGatewayUpdate extends ResourceUpdate{name?:string|null;auto_payments?:boolean|null;}declare class StripeGateways extends ApiResource<StripeGateway>{static readonly TYPE:StripeGatewayType;create(resource:StripeGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripeGateway>;update(resource:StripeGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripeGateway>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;payment_methods(stripeGatewayId:string|StripeGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;versions(stripeGatewayId:string|StripeGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;stripe_payments(stripeGatewayId:string|StripeGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StripePayment>>;isStripeGateway(resource:any):resource is StripeGateway;relationship(id:string|ResourceId|null):StripeGatewayRel;type():StripeGatewayType;}export default StripeGateways;export type{StripeGateway,StripeGatewayCreate,StripeGatewayUpdate,StripeGatewayType};
@@ -1,37 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class StripeGateways extends resource_1.ApiResource {
5
- async create(resource, params, options) {
6
- return this.resources.create({ ...resource, type: StripeGateways.TYPE }, params, options);
7
- }
8
- async update(resource, params, options) {
9
- return this.resources.update({ ...resource, type: StripeGateways.TYPE }, params, options);
10
- }
11
- async delete(id, options) {
12
- await this.resources.delete((typeof id === 'string') ? { id, type: StripeGateways.TYPE } : id, options);
13
- }
14
- async payment_methods(stripeGatewayId, params, options) {
15
- const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
16
- return this.resources.fetch({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options);
17
- }
18
- async versions(stripeGatewayId, params, options) {
19
- const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
20
- return this.resources.fetch({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options);
21
- }
22
- async stripe_payments(stripeGatewayId, params, options) {
23
- const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
24
- return this.resources.fetch({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options);
25
- }
26
- isStripeGateway(resource) {
27
- return resource.type && (resource.type === StripeGateways.TYPE);
28
- }
29
- relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: StripeGateways.TYPE } : { id: id.id, type: StripeGateways.TYPE };
31
- }
32
- type() {
33
- return StripeGateways.TYPE;
34
- }
35
- }
36
- StripeGateways.TYPE = 'stripe_gateways';
37
- exports.default = StripeGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripeGateways extends resource_1.ApiResource{async create(e,t,s){return this.resources.create({...e,type:StripeGateways.TYPE},t,s)}async update(e,t,s){return this.resources.update({...e,type:StripeGateways.TYPE},t,s)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:StripeGateways.TYPE}:e,t)}async payment_methods(e,t,s){const r=e.id||e;return this.resources.fetch({type:"payment_methods"},`stripe_gateways/${r}/payment_methods`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`stripe_gateways/${r}/versions`,t,s)}async stripe_payments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stripe_payments"},`stripe_gateways/${r}/stripe_payments`,t,s)}isStripeGateway(e){return e.type&&e.type===StripeGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:StripeGateways.TYPE}:{id:e.id,type:StripeGateways.TYPE}}type(){return StripeGateways.TYPE}}StripeGateways.TYPE="stripe_gateways",exports.default=StripeGateways;
@@ -1,59 +1 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { Order, OrderType } from './orders';
5
- import type { PaymentGateway } from './payment_gateways';
6
- import type { Version } from './versions';
7
- type StripePaymentType = 'stripe_payments';
8
- type StripePaymentRel = ResourceRel & {
9
- type: StripePaymentType;
10
- };
11
- type OrderRel = ResourceRel & {
12
- type: OrderType;
13
- };
14
- interface StripePayment extends Resource {
15
- readonly type: StripePaymentType;
16
- stripe_id?: string | null;
17
- client_secret?: string | null;
18
- publishable_key?: string | null;
19
- options?: Record<string, any> | null;
20
- payment_method?: Record<string, any> | null;
21
- mismatched_amounts?: boolean | null;
22
- return_url?: string | null;
23
- receipt_email?: string | null;
24
- payment_instrument?: Record<string, any> | null;
25
- order?: Order | null;
26
- payment_gateway?: PaymentGateway | null;
27
- versions?: Version[] | null;
28
- }
29
- interface StripePaymentCreate extends ResourceCreate {
30
- stripe_id?: string | null;
31
- client_secret?: string | null;
32
- options?: Record<string, any> | null;
33
- return_url?: string | null;
34
- receipt_email?: string | null;
35
- order: OrderRel;
36
- }
37
- interface StripePaymentUpdate extends ResourceUpdate {
38
- options?: Record<string, any> | null;
39
- return_url?: string | null;
40
- _update?: boolean | null;
41
- _refresh?: boolean | null;
42
- order?: OrderRel | null;
43
- }
44
- declare class StripePayments extends ApiResource<StripePayment> {
45
- static readonly TYPE: StripePaymentType;
46
- create(resource: StripePaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
47
- update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
48
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
49
- order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
50
- payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
51
- versions(stripePaymentId: string | StripePayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
52
- _update(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
53
- _refresh(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
54
- isStripePayment(resource: any): resource is StripePayment;
55
- relationship(id: string | ResourceId | null): StripePaymentRel;
56
- type(): StripePaymentType;
57
- }
58
- export default StripePayments;
59
- export type { StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType };
1
+ import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Order,OrderType}from'./orders';import type{PaymentGateway}from'./payment_gateways';import type{Version}from'./versions';type StripePaymentType='stripe_payments';type StripePaymentRel=ResourceRel&{type:StripePaymentType;};type OrderRel=ResourceRel&{type:OrderType;};interface StripePayment extends Resource{readonly type:StripePaymentType;stripe_id?:string|null;client_secret?:string|null;publishable_key?:string|null;options?:Record<string,any>|null;payment_method?:Record<string,any>|null;mismatched_amounts?:boolean|null;return_url?:string|null;receipt_email?:string|null;payment_instrument?:Record<string,any>|null;order?:Order|null;payment_gateway?:PaymentGateway|null;versions?:Version[]|null;}interface StripePaymentCreate extends ResourceCreate{stripe_id?:string|null;client_secret?:string|null;options?:Record<string,any>|null;return_url?:string|null;receipt_email?:string|null;order:OrderRel;}interface StripePaymentUpdate extends ResourceUpdate{options?:Record<string,any>|null;return_url?:string|null;_update?:boolean|null;_refresh?:boolean|null;order?:OrderRel|null;}declare class StripePayments extends ApiResource<StripePayment>{static readonly TYPE:StripePaymentType;create(resource:StripePaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;update(resource:StripePaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;order(stripePaymentId:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(stripePaymentId:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;versions(stripePaymentId:string|StripePayment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;_update(id:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;_refresh(id:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;isStripePayment(resource:any):resource is StripePayment;relationship(id:string|ResourceId|null):StripePaymentRel;type():StripePaymentType;}export default StripePayments;export type{StripePayment,StripePaymentCreate,StripePaymentUpdate,StripePaymentType};
@@ -1,43 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class StripePayments extends resource_1.ApiResource {
5
- async create(resource, params, options) {
6
- return this.resources.create({ ...resource, type: StripePayments.TYPE }, params, options);
7
- }
8
- async update(resource, params, options) {
9
- return this.resources.update({ ...resource, type: StripePayments.TYPE }, params, options);
10
- }
11
- async delete(id, options) {
12
- await this.resources.delete((typeof id === 'string') ? { id, type: StripePayments.TYPE } : id, options);
13
- }
14
- async order(stripePaymentId, params, options) {
15
- const _stripePaymentId = stripePaymentId.id || stripePaymentId;
16
- return this.resources.fetch({ type: 'orders' }, `stripe_payments/${_stripePaymentId}/order`, params, options);
17
- }
18
- async payment_gateway(stripePaymentId, params, options) {
19
- const _stripePaymentId = stripePaymentId.id || stripePaymentId;
20
- return this.resources.fetch({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options);
21
- }
22
- async versions(stripePaymentId, params, options) {
23
- const _stripePaymentId = stripePaymentId.id || stripePaymentId;
24
- return this.resources.fetch({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options);
25
- }
26
- async _update(id, params, options) {
27
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _update: true }, params, options);
28
- }
29
- async _refresh(id, params, options) {
30
- return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _refresh: true }, params, options);
31
- }
32
- isStripePayment(resource) {
33
- return resource.type && (resource.type === StripePayments.TYPE);
34
- }
35
- relationship(id) {
36
- return ((id === null) || (typeof id === 'string')) ? { id, type: StripePayments.TYPE } : { id: id.id, type: StripePayments.TYPE };
37
- }
38
- type() {
39
- return StripePayments.TYPE;
40
- }
41
- }
42
- StripePayments.TYPE = 'stripe_payments';
43
- exports.default = StripePayments;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripePayments extends resource_1.ApiResource{async create(e,t,r){return this.resources.create({...e,type:StripePayments.TYPE},t,r)}async update(e,t,r){return this.resources.update({...e,type:StripePayments.TYPE},t,r)}async delete(e,t){await this.resources.delete(typeof e=="string"?{id:e,type:StripePayments.TYPE}:e,t)}async order(e,t,r){const s=e.id||e;return this.resources.fetch({type:"orders"},`stripe_payments/${s}/order`,t,r)}async payment_gateway(e,t,r){const s=e.id||e;return this.resources.fetch({type:"payment_gateways"},`stripe_payments/${s}/payment_gateway`,t,r)}async versions(e,t,r){const s=e.id||e;return this.resources.fetch({type:"versions"},`stripe_payments/${s}/versions`,t,r)}async _update(e,t,r){return this.resources.update({id:typeof e=="string"?e:e.id,type:StripePayments.TYPE,_update:!0},t,r)}async _refresh(e,t,r){return this.resources.update({id:typeof e=="string"?e:e.id,type:StripePayments.TYPE,_refresh:!0},t,r)}isStripePayment(e){return e.type&&e.type===StripePayments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:StripePayments.TYPE}:{id:e.id,type:StripePayments.TYPE}}type(){return StripePayments.TYPE}}StripePayments.TYPE="stripe_payments",exports.default=StripePayments;
@@ -1,49 +1 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { Market } from './markets';
5
- import type { OrderSubscription } from './order_subscriptions';
6
- import type { Attachment } from './attachments';
7
- type SubscriptionModelType = 'subscription_models';
8
- type SubscriptionModelRel = ResourceRel & {
9
- type: SubscriptionModelType;
10
- };
11
- interface SubscriptionModel extends Resource {
12
- readonly type: SubscriptionModelType;
13
- name: string;
14
- strategy?: string | null;
15
- frequencies: string[];
16
- auto_activate?: boolean | null;
17
- auto_cancel?: boolean | null;
18
- markets?: Market[] | null;
19
- order_subscriptions?: OrderSubscription[] | null;
20
- attachments?: Attachment[] | null;
21
- }
22
- interface SubscriptionModelCreate extends ResourceCreate {
23
- name: string;
24
- strategy?: string | null;
25
- frequencies: string[];
26
- auto_activate?: boolean | null;
27
- auto_cancel?: boolean | null;
28
- }
29
- interface SubscriptionModelUpdate extends ResourceUpdate {
30
- name?: string | null;
31
- strategy?: string | null;
32
- frequencies?: string[] | null;
33
- auto_activate?: boolean | null;
34
- auto_cancel?: boolean | null;
35
- }
36
- declare class SubscriptionModels extends ApiResource<SubscriptionModel> {
37
- static readonly TYPE: SubscriptionModelType;
38
- create(resource: SubscriptionModelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
39
- update(resource: SubscriptionModelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
40
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
41
- markets(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
42
- order_subscriptions(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
43
- attachments(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
44
- isSubscriptionModel(resource: any): resource is SubscriptionModel;
45
- relationship(id: string | ResourceId | null): SubscriptionModelRel;
46
- type(): SubscriptionModelType;
47
- }
48
- export default SubscriptionModels;
49
- export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate, SubscriptionModelType };
1
+ import{ApiResource}from'../resource';import type{Resource,ResourceCreate,ResourceUpdate,ResourceId,ResourcesConfig,ResourceRel,ListResponse}from'../resource';import type{QueryParamsRetrieve,QueryParamsList}from'../query';import type{Market}from'./markets';import type{OrderSubscription}from'./order_subscriptions';import type{Attachment}from'./attachments';type SubscriptionModelType='subscription_models';type SubscriptionModelRel=ResourceRel&{type:SubscriptionModelType;};interface SubscriptionModel extends Resource{readonly type:SubscriptionModelType;name:string;strategy?:string|null;frequencies:string[];auto_activate?:boolean|null;auto_cancel?:boolean|null;markets?:Market[]|null;order_subscriptions?:OrderSubscription[]|null;attachments?:Attachment[]|null;}interface SubscriptionModelCreate extends ResourceCreate{name:string;strategy?:string|null;frequencies:string[];auto_activate?:boolean|null;auto_cancel?:boolean|null;}interface SubscriptionModelUpdate extends ResourceUpdate{name?:string|null;strategy?:string|null;frequencies?:string[]|null;auto_activate?:boolean|null;auto_cancel?:boolean|null;}declare class SubscriptionModels extends ApiResource<SubscriptionModel>{static readonly TYPE:SubscriptionModelType;create(resource:SubscriptionModelCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SubscriptionModel>;update(resource:SubscriptionModelUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SubscriptionModel>;delete(id:string|ResourceId,options?:ResourcesConfig):Promise<void>;markets(subscriptionModelId:string|SubscriptionModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;order_subscriptions(subscriptionModelId:string|SubscriptionModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderSubscription>>;attachments(subscriptionModelId:string|SubscriptionModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isSubscriptionModel(resource:any):resource is SubscriptionModel;relationship(id:string|ResourceId|null):SubscriptionModelRel;type():SubscriptionModelType;}export default SubscriptionModels;export type{SubscriptionModel,SubscriptionModelCreate,SubscriptionModelUpdate,SubscriptionModelType};