@commercelayer/sdk 4.48.0 → 4.50.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 (551) hide show
  1. package/lib/cjs/api.d.ts +1 -126
  2. package/lib/cjs/api.js +1 -394
  3. package/lib/cjs/client.d.ts +1 -31
  4. package/lib/cjs/client.js +1 -123
  5. package/lib/cjs/commercelayer.d.ts +1 -152
  6. package/lib/cjs/commercelayer.js +1 -243
  7. package/lib/cjs/common.d.ts +1 -4
  8. package/lib/cjs/common.js +1 -14
  9. package/lib/cjs/config.d.ts +1 -11
  10. package/lib/cjs/config.js +1 -13
  11. package/lib/cjs/debug.d.ts +1 -3
  12. package/lib/cjs/debug.js +1 -42
  13. package/lib/cjs/error.d.ts +1 -28
  14. package/lib/cjs/error.js +1 -43
  15. package/lib/cjs/index.d.ts +1 -7
  16. package/lib/cjs/index.js +1 -29
  17. package/lib/cjs/interceptor.d.ts +1 -21
  18. package/lib/cjs/interceptor.js +1 -2
  19. package/lib/cjs/jsonapi.d.ts +1 -5
  20. package/lib/cjs/jsonapi.js +1 -82
  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 -23
  24. package/lib/cjs/query.js +1 -51
  25. package/lib/cjs/resource.d.ts +1 -75
  26. package/lib/cjs/resource.js +1 -145
  27. package/lib/cjs/resources/addresses.d.ts +1 -102
  28. package/lib/cjs/resources/addresses.js +1 -49
  29. package/lib/cjs/resources/adjustments.d.ts +1 -41
  30. package/lib/cjs/resources/adjustments.js +1 -37
  31. package/lib/cjs/resources/adyen_gateways.d.ts +1 -59
  32. package/lib/cjs/resources/adyen_gateways.js +1 -45
  33. package/lib/cjs/resources/adyen_payments.d.ts +1 -49
  34. package/lib/cjs/resources/adyen_payments.js +1 -45
  35. package/lib/cjs/resources/application.d.ts +1 -21
  36. package/lib/cjs/resources/application.js +1 -21
  37. package/lib/cjs/resources/attachments.d.ts +1 -156
  38. package/lib/cjs/resources/attachments.js +1 -33
  39. package/lib/cjs/resources/authorizations.d.ts +1 -66
  40. package/lib/cjs/resources/authorizations.js +1 -51
  41. package/lib/cjs/resources/avalara_accounts.d.ts +1 -58
  42. package/lib/cjs/resources/avalara_accounts.js +1 -49
  43. package/lib/cjs/resources/axerve_gateways.d.ts +1 -47
  44. package/lib/cjs/resources/axerve_gateways.js +1 -45
  45. package/lib/cjs/resources/axerve_payments.d.ts +1 -52
  46. package/lib/cjs/resources/axerve_payments.js +1 -45
  47. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -38
  48. package/lib/cjs/resources/billing_info_validation_rules.js +1 -45
  49. package/lib/cjs/resources/bing_geocoders.d.ts +1 -35
  50. package/lib/cjs/resources/bing_geocoders.js +1 -41
  51. package/lib/cjs/resources/braintree_gateways.d.ts +1 -59
  52. package/lib/cjs/resources/braintree_gateways.js +1 -45
  53. package/lib/cjs/resources/braintree_payments.d.ts +1 -51
  54. package/lib/cjs/resources/braintree_payments.js +1 -45
  55. package/lib/cjs/resources/bundles.d.ts +1 -90
  56. package/lib/cjs/resources/bundles.js +1 -61
  57. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -134
  58. package/lib/cjs/resources/buy_x_pay_y_promotions.js +1 -81
  59. package/lib/cjs/resources/captures.d.ts +1 -57
  60. package/lib/cjs/resources/captures.js +1 -51
  61. package/lib/cjs/resources/carrier_accounts.d.ts +1 -29
  62. package/lib/cjs/resources/carrier_accounts.js +1 -36
  63. package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -48
  64. package/lib/cjs/resources/checkout_com_gateways.js +1 -45
  65. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -62
  66. package/lib/cjs/resources/checkout_com_payments.js +1 -45
  67. package/lib/cjs/resources/cleanups.d.ts +1 -39
  68. package/lib/cjs/resources/cleanups.js +1 -38
  69. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -66
  70. package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -41
  71. package/lib/cjs/resources/coupon_recipients.d.ts +1 -47
  72. package/lib/cjs/resources/coupon_recipients.js +1 -45
  73. package/lib/cjs/resources/coupons.d.ts +1 -70
  74. package/lib/cjs/resources/coupons.js +1 -53
  75. package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -61
  76. package/lib/cjs/resources/custom_promotion_rules.js +1 -37
  77. package/lib/cjs/resources/customer_addresses.d.ts +1 -49
  78. package/lib/cjs/resources/customer_addresses.js +1 -49
  79. package/lib/cjs/resources/customer_groups.d.ts +1 -39
  80. package/lib/cjs/resources/customer_groups.js +1 -49
  81. package/lib/cjs/resources/customer_password_resets.d.ts +1 -36
  82. package/lib/cjs/resources/customer_password_resets.js +1 -41
  83. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -85
  84. package/lib/cjs/resources/customer_payment_sources.js +1 -45
  85. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -34
  86. package/lib/cjs/resources/customer_subscriptions.js +1 -45
  87. package/lib/cjs/resources/customers.d.ts +1 -75
  88. package/lib/cjs/resources/customers.js +1 -77
  89. package/lib/cjs/resources/delivery_lead_times.d.ts +1 -54
  90. package/lib/cjs/resources/delivery_lead_times.js +1 -49
  91. package/lib/cjs/resources/event_callbacks.d.ts +1 -24
  92. package/lib/cjs/resources/event_callbacks.js +1 -28
  93. package/lib/cjs/resources/events.d.ts +1 -24
  94. package/lib/cjs/resources/events.js +1 -32
  95. package/lib/cjs/resources/exports.d.ts +1 -40
  96. package/lib/cjs/resources/exports.js +1 -34
  97. package/lib/cjs/resources/external_gateways.d.ts +1 -55
  98. package/lib/cjs/resources/external_gateways.js +1 -45
  99. package/lib/cjs/resources/external_payments.d.ts +1 -47
  100. package/lib/cjs/resources/external_payments.js +1 -49
  101. package/lib/cjs/resources/external_promotions.d.ts +1 -132
  102. package/lib/cjs/resources/external_promotions.js +1 -81
  103. package/lib/cjs/resources/external_tax_calculators.d.ts +1 -43
  104. package/lib/cjs/resources/external_tax_calculators.js +1 -45
  105. package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -130
  106. package/lib/cjs/resources/fixed_amount_promotions.js +1 -81
  107. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -130
  108. package/lib/cjs/resources/fixed_price_promotions.js +1 -81
  109. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -128
  110. package/lib/cjs/resources/free_gift_promotions.js +1 -81
  111. package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -122
  112. package/lib/cjs/resources/free_shipping_promotions.js +1 -77
  113. package/lib/cjs/resources/geocoders.d.ts +1 -24
  114. package/lib/cjs/resources/geocoders.js +1 -32
  115. package/lib/cjs/resources/gift_card_recipients.d.ts +1 -47
  116. package/lib/cjs/resources/gift_card_recipients.js +1 -45
  117. package/lib/cjs/resources/gift_cards.d.ts +1 -99
  118. package/lib/cjs/resources/gift_cards.js +1 -57
  119. package/lib/cjs/resources/google_geocoders.d.ts +1 -35
  120. package/lib/cjs/resources/google_geocoders.js +1 -41
  121. package/lib/cjs/resources/imports.d.ts +1 -43
  122. package/lib/cjs/resources/imports.js +1 -34
  123. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -65
  124. package/lib/cjs/resources/in_stock_subscriptions.js +1 -53
  125. package/lib/cjs/resources/inventory_models.d.ts +1 -54
  126. package/lib/cjs/resources/inventory_models.js +1 -49
  127. package/lib/cjs/resources/inventory_return_locations.d.ts +1 -46
  128. package/lib/cjs/resources/inventory_return_locations.js +1 -45
  129. package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -49
  130. package/lib/cjs/resources/inventory_stock_locations.js +1 -45
  131. package/lib/cjs/resources/klarna_gateways.d.ts +1 -47
  132. package/lib/cjs/resources/klarna_gateways.js +1 -45
  133. package/lib/cjs/resources/klarna_payments.d.ts +1 -46
  134. package/lib/cjs/resources/klarna_payments.js +1 -45
  135. package/lib/cjs/resources/line_item_options.d.ts +1 -68
  136. package/lib/cjs/resources/line_item_options.js +1 -49
  137. package/lib/cjs/resources/line_items.d.ts +1 -166
  138. package/lib/cjs/resources/line_items.js +1 -65
  139. package/lib/cjs/resources/manual_gateways.d.ts +1 -33
  140. package/lib/cjs/resources/manual_gateways.js +1 -41
  141. package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -44
  142. package/lib/cjs/resources/manual_tax_calculators.js +1 -49
  143. package/lib/cjs/resources/markets.d.ts +1 -104
  144. package/lib/cjs/resources/markets.js +1 -65
  145. package/lib/cjs/resources/merchants.d.ts +1 -41
  146. package/lib/cjs/resources/merchants.js +1 -45
  147. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -66
  148. package/lib/cjs/resources/order_amount_promotion_rules.js +1 -37
  149. package/lib/cjs/resources/order_copies.d.ts +1 -50
  150. package/lib/cjs/resources/order_copies.js +1 -49
  151. package/lib/cjs/resources/order_factories.d.ts +1 -33
  152. package/lib/cjs/resources/order_factories.js +1 -36
  153. package/lib/cjs/resources/order_subscription_items.d.ts +1 -71
  154. package/lib/cjs/resources/order_subscription_items.js +1 -41
  155. package/lib/cjs/resources/order_subscriptions.d.ts +1 -94
  156. package/lib/cjs/resources/order_subscriptions.js +1 -77
  157. package/lib/cjs/resources/order_validation_rules.d.ts +1 -26
  158. package/lib/cjs/resources/order_validation_rules.js +1 -36
  159. package/lib/cjs/resources/orders.d.ts +1 -359
  160. package/lib/cjs/resources/orders.js +1 -157
  161. package/lib/cjs/resources/organization.d.ts +1 -33
  162. package/lib/cjs/resources/organization.js +1 -21
  163. package/lib/cjs/resources/packages.d.ts +1 -59
  164. package/lib/cjs/resources/packages.js +1 -49
  165. package/lib/cjs/resources/parcel_line_items.d.ts +1 -46
  166. package/lib/cjs/resources/parcel_line_items.js +1 -45
  167. package/lib/cjs/resources/parcels.d.ts +1 -125
  168. package/lib/cjs/resources/parcels.js +1 -57
  169. package/lib/cjs/resources/payment_gateways.d.ts +1 -24
  170. package/lib/cjs/resources/payment_gateways.js +1 -32
  171. package/lib/cjs/resources/payment_methods.d.ts +1 -80
  172. package/lib/cjs/resources/payment_methods.js +1 -49
  173. package/lib/cjs/resources/payment_options.d.ts +1 -43
  174. package/lib/cjs/resources/payment_options.js +1 -41
  175. package/lib/cjs/resources/paypal_gateways.d.ts +1 -40
  176. package/lib/cjs/resources/paypal_gateways.js +1 -45
  177. package/lib/cjs/resources/paypal_payments.d.ts +1 -52
  178. package/lib/cjs/resources/paypal_payments.js +1 -45
  179. package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -128
  180. package/lib/cjs/resources/percentage_discount_promotions.js +1 -81
  181. package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -52
  182. package/lib/cjs/resources/price_frequency_tiers.js +1 -49
  183. package/lib/cjs/resources/price_list_schedulers.d.ts +1 -0
  184. package/lib/cjs/resources/price_list_schedulers.js +1 -0
  185. package/lib/cjs/resources/price_lists.d.ts +1 -45
  186. package/lib/cjs/resources/price_lists.js +1 -45
  187. package/lib/cjs/resources/price_tiers.d.ts +1 -31
  188. package/lib/cjs/resources/price_tiers.js +1 -36
  189. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -52
  190. package/lib/cjs/resources/price_volume_tiers.js +1 -49
  191. package/lib/cjs/resources/prices.d.ts +1 -83
  192. package/lib/cjs/resources/prices.js +1 -73
  193. package/lib/cjs/resources/promotion_rules.d.ts +1 -28
  194. package/lib/cjs/resources/promotion_rules.js +1 -28
  195. package/lib/cjs/resources/promotions.d.ts +1 -62
  196. package/lib/cjs/resources/promotions.js +1 -68
  197. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -52
  198. package/lib/cjs/resources/recurring_order_copies.js +1 -49
  199. package/lib/cjs/resources/refunds.d.ts +1 -43
  200. package/lib/cjs/resources/refunds.js +1 -44
  201. package/lib/cjs/resources/reserved_stocks.d.ts +1 -27
  202. package/lib/cjs/resources/reserved_stocks.js +1 -36
  203. package/lib/cjs/resources/resource_errors.d.ts +1 -22
  204. package/lib/cjs/resources/resource_errors.js +1 -24
  205. package/lib/cjs/resources/return_line_items.d.ts +1 -50
  206. package/lib/cjs/resources/return_line_items.js +1 -41
  207. package/lib/cjs/resources/returns.d.ts +1 -86
  208. package/lib/cjs/resources/returns.js +1 -73
  209. package/lib/cjs/resources/satispay_gateways.d.ts +1 -45
  210. package/lib/cjs/resources/satispay_gateways.js +1 -45
  211. package/lib/cjs/resources/satispay_payments.d.ts +1 -48
  212. package/lib/cjs/resources/satispay_payments.js +1 -45
  213. package/lib/cjs/resources/shipments.d.ts +1 -139
  214. package/lib/cjs/resources/shipments.js +1 -105
  215. package/lib/cjs/resources/shipping_categories.d.ts +1 -39
  216. package/lib/cjs/resources/shipping_categories.js +1 -45
  217. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -31
  218. package/lib/cjs/resources/shipping_method_tiers.js +1 -36
  219. package/lib/cjs/resources/shipping_methods.d.ts +1 -121
  220. package/lib/cjs/resources/shipping_methods.js +1 -69
  221. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -49
  222. package/lib/cjs/resources/shipping_weight_tiers.js +1 -45
  223. package/lib/cjs/resources/shipping_zones.d.ts +1 -51
  224. package/lib/cjs/resources/shipping_zones.js +1 -41
  225. package/lib/cjs/resources/sku_list_items.d.ts +1 -50
  226. package/lib/cjs/resources/sku_list_items.js +1 -45
  227. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -75
  228. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -45
  229. package/lib/cjs/resources/sku_lists.d.ts +1 -63
  230. package/lib/cjs/resources/sku_lists.js +1 -57
  231. package/lib/cjs/resources/sku_options.d.ts +1 -70
  232. package/lib/cjs/resources/sku_options.js +1 -53
  233. package/lib/cjs/resources/skus.d.ts +1 -95
  234. package/lib/cjs/resources/skus.js +1 -73
  235. package/lib/cjs/resources/stock_items.d.ts +1 -59
  236. package/lib/cjs/resources/stock_items.js +1 -57
  237. package/lib/cjs/resources/stock_line_items.d.ts +1 -69
  238. package/lib/cjs/resources/stock_line_items.js +1 -53
  239. package/lib/cjs/resources/stock_locations.d.ts +1 -63
  240. package/lib/cjs/resources/stock_locations.js +1 -61
  241. package/lib/cjs/resources/stock_reservations.d.ts +1 -49
  242. package/lib/cjs/resources/stock_reservations.js +1 -53
  243. package/lib/cjs/resources/stock_transfers.d.ts +1 -79
  244. package/lib/cjs/resources/stock_transfers.js +1 -61
  245. package/lib/cjs/resources/stripe_gateways.d.ts +1 -44
  246. package/lib/cjs/resources/stripe_gateways.js +1 -45
  247. package/lib/cjs/resources/stripe_payments.d.ts +1 -56
  248. package/lib/cjs/resources/stripe_payments.js +1 -45
  249. package/lib/cjs/resources/subscription_models.d.ts +1 -48
  250. package/lib/cjs/resources/subscription_models.js +1 -45
  251. package/lib/cjs/resources/tags.d.ts +1 -27
  252. package/lib/cjs/resources/tags.js +1 -33
  253. package/lib/cjs/resources/tax_calculators.d.ts +1 -27
  254. package/lib/cjs/resources/tax_calculators.js +1 -36
  255. package/lib/cjs/resources/tax_categories.d.ts +1 -62
  256. package/lib/cjs/resources/tax_categories.js +1 -45
  257. package/lib/cjs/resources/tax_rules.d.ts +1 -72
  258. package/lib/cjs/resources/tax_rules.js +1 -41
  259. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -46
  260. package/lib/cjs/resources/taxjar_accounts.js +1 -49
  261. package/lib/cjs/resources/transactions.d.ts +1 -40
  262. package/lib/cjs/resources/transactions.js +1 -40
  263. package/lib/cjs/resources/versions.d.ts +1 -22
  264. package/lib/cjs/resources/versions.js +1 -24
  265. package/lib/cjs/resources/voids.d.ts +1 -43
  266. package/lib/cjs/resources/voids.js +1 -44
  267. package/lib/cjs/resources/webhooks.d.ts +1 -51
  268. package/lib/cjs/resources/webhooks.js +1 -41
  269. package/lib/cjs/resources/wire_transfers.d.ts +1 -36
  270. package/lib/cjs/resources/wire_transfers.js +1 -41
  271. package/lib/cjs/static.d.ts +1 -9
  272. package/lib/cjs/static.js +1 -45
  273. package/lib/cjs/util.d.ts +1 -6
  274. package/lib/cjs/util.js +1 -15
  275. package/lib/esm/api.d.ts +1 -126
  276. package/lib/esm/api.js +1 -265
  277. package/lib/esm/client.d.ts +1 -31
  278. package/lib/esm/client.js +1 -118
  279. package/lib/esm/commercelayer.d.ts +1 -152
  280. package/lib/esm/commercelayer.js +1 -214
  281. package/lib/esm/common.d.ts +1 -4
  282. package/lib/esm/common.js +1 -10
  283. package/lib/esm/config.d.ts +1 -11
  284. package/lib/esm/config.js +1 -11
  285. package/lib/esm/debug.d.ts +1 -3
  286. package/lib/esm/debug.js +1 -40
  287. package/lib/esm/error.d.ts +1 -28
  288. package/lib/esm/error.js +1 -38
  289. package/lib/esm/index.d.ts +1 -7
  290. package/lib/esm/index.js +1 -6
  291. package/lib/esm/interceptor.d.ts +1 -21
  292. package/lib/esm/interceptor.js +1 -1
  293. package/lib/esm/jsonapi.d.ts +1 -5
  294. package/lib/esm/jsonapi.js +1 -75
  295. package/lib/esm/model.d.ts +1 -124
  296. package/lib/esm/model.js +1 -2
  297. package/lib/esm/query.d.ts +1 -23
  298. package/lib/esm/query.js +1 -45
  299. package/lib/esm/resource.d.ts +1 -75
  300. package/lib/esm/resource.js +1 -139
  301. package/lib/esm/resources/addresses.d.ts +1 -102
  302. package/lib/esm/resources/addresses.js +1 -47
  303. package/lib/esm/resources/adjustments.d.ts +1 -41
  304. package/lib/esm/resources/adjustments.js +1 -35
  305. package/lib/esm/resources/adyen_gateways.d.ts +1 -59
  306. package/lib/esm/resources/adyen_gateways.js +1 -43
  307. package/lib/esm/resources/adyen_payments.d.ts +1 -49
  308. package/lib/esm/resources/adyen_payments.js +1 -43
  309. package/lib/esm/resources/application.d.ts +1 -21
  310. package/lib/esm/resources/application.js +1 -19
  311. package/lib/esm/resources/attachments.d.ts +1 -156
  312. package/lib/esm/resources/attachments.js +1 -31
  313. package/lib/esm/resources/authorizations.d.ts +1 -66
  314. package/lib/esm/resources/authorizations.js +1 -49
  315. package/lib/esm/resources/avalara_accounts.d.ts +1 -58
  316. package/lib/esm/resources/avalara_accounts.js +1 -47
  317. package/lib/esm/resources/axerve_gateways.d.ts +1 -47
  318. package/lib/esm/resources/axerve_gateways.js +1 -43
  319. package/lib/esm/resources/axerve_payments.d.ts +1 -52
  320. package/lib/esm/resources/axerve_payments.js +1 -43
  321. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -38
  322. package/lib/esm/resources/billing_info_validation_rules.js +1 -43
  323. package/lib/esm/resources/bing_geocoders.d.ts +1 -35
  324. package/lib/esm/resources/bing_geocoders.js +1 -39
  325. package/lib/esm/resources/braintree_gateways.d.ts +1 -59
  326. package/lib/esm/resources/braintree_gateways.js +1 -43
  327. package/lib/esm/resources/braintree_payments.d.ts +1 -51
  328. package/lib/esm/resources/braintree_payments.js +1 -43
  329. package/lib/esm/resources/bundles.d.ts +1 -90
  330. package/lib/esm/resources/bundles.js +1 -59
  331. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -134
  332. package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -79
  333. package/lib/esm/resources/captures.d.ts +1 -57
  334. package/lib/esm/resources/captures.js +1 -49
  335. package/lib/esm/resources/carrier_accounts.d.ts +1 -29
  336. package/lib/esm/resources/carrier_accounts.js +1 -34
  337. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -48
  338. package/lib/esm/resources/checkout_com_gateways.js +1 -43
  339. package/lib/esm/resources/checkout_com_payments.d.ts +1 -62
  340. package/lib/esm/resources/checkout_com_payments.js +1 -43
  341. package/lib/esm/resources/cleanups.d.ts +1 -39
  342. package/lib/esm/resources/cleanups.js +1 -36
  343. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -66
  344. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -39
  345. package/lib/esm/resources/coupon_recipients.d.ts +1 -47
  346. package/lib/esm/resources/coupon_recipients.js +1 -43
  347. package/lib/esm/resources/coupons.d.ts +1 -70
  348. package/lib/esm/resources/coupons.js +1 -51
  349. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -61
  350. package/lib/esm/resources/custom_promotion_rules.js +1 -35
  351. package/lib/esm/resources/customer_addresses.d.ts +1 -49
  352. package/lib/esm/resources/customer_addresses.js +1 -47
  353. package/lib/esm/resources/customer_groups.d.ts +1 -39
  354. package/lib/esm/resources/customer_groups.js +1 -47
  355. package/lib/esm/resources/customer_password_resets.d.ts +1 -36
  356. package/lib/esm/resources/customer_password_resets.js +1 -39
  357. package/lib/esm/resources/customer_payment_sources.d.ts +1 -85
  358. package/lib/esm/resources/customer_payment_sources.js +1 -43
  359. package/lib/esm/resources/customer_subscriptions.d.ts +1 -34
  360. package/lib/esm/resources/customer_subscriptions.js +1 -43
  361. package/lib/esm/resources/customers.d.ts +1 -75
  362. package/lib/esm/resources/customers.js +1 -75
  363. package/lib/esm/resources/delivery_lead_times.d.ts +1 -54
  364. package/lib/esm/resources/delivery_lead_times.js +1 -47
  365. package/lib/esm/resources/event_callbacks.d.ts +1 -24
  366. package/lib/esm/resources/event_callbacks.js +1 -26
  367. package/lib/esm/resources/events.d.ts +1 -24
  368. package/lib/esm/resources/events.js +1 -30
  369. package/lib/esm/resources/exports.d.ts +1 -40
  370. package/lib/esm/resources/exports.js +1 -32
  371. package/lib/esm/resources/external_gateways.d.ts +1 -55
  372. package/lib/esm/resources/external_gateways.js +1 -43
  373. package/lib/esm/resources/external_payments.d.ts +1 -47
  374. package/lib/esm/resources/external_payments.js +1 -47
  375. package/lib/esm/resources/external_promotions.d.ts +1 -132
  376. package/lib/esm/resources/external_promotions.js +1 -79
  377. package/lib/esm/resources/external_tax_calculators.d.ts +1 -43
  378. package/lib/esm/resources/external_tax_calculators.js +1 -43
  379. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -130
  380. package/lib/esm/resources/fixed_amount_promotions.js +1 -79
  381. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -130
  382. package/lib/esm/resources/fixed_price_promotions.js +1 -79
  383. package/lib/esm/resources/free_gift_promotions.d.ts +1 -128
  384. package/lib/esm/resources/free_gift_promotions.js +1 -79
  385. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -122
  386. package/lib/esm/resources/free_shipping_promotions.js +1 -75
  387. package/lib/esm/resources/geocoders.d.ts +1 -24
  388. package/lib/esm/resources/geocoders.js +1 -30
  389. package/lib/esm/resources/gift_card_recipients.d.ts +1 -47
  390. package/lib/esm/resources/gift_card_recipients.js +1 -43
  391. package/lib/esm/resources/gift_cards.d.ts +1 -99
  392. package/lib/esm/resources/gift_cards.js +1 -55
  393. package/lib/esm/resources/google_geocoders.d.ts +1 -35
  394. package/lib/esm/resources/google_geocoders.js +1 -39
  395. package/lib/esm/resources/imports.d.ts +1 -43
  396. package/lib/esm/resources/imports.js +1 -32
  397. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -65
  398. package/lib/esm/resources/in_stock_subscriptions.js +1 -51
  399. package/lib/esm/resources/inventory_models.d.ts +1 -54
  400. package/lib/esm/resources/inventory_models.js +1 -47
  401. package/lib/esm/resources/inventory_return_locations.d.ts +1 -46
  402. package/lib/esm/resources/inventory_return_locations.js +1 -43
  403. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -49
  404. package/lib/esm/resources/inventory_stock_locations.js +1 -43
  405. package/lib/esm/resources/klarna_gateways.d.ts +1 -47
  406. package/lib/esm/resources/klarna_gateways.js +1 -43
  407. package/lib/esm/resources/klarna_payments.d.ts +1 -46
  408. package/lib/esm/resources/klarna_payments.js +1 -43
  409. package/lib/esm/resources/line_item_options.d.ts +1 -68
  410. package/lib/esm/resources/line_item_options.js +1 -47
  411. package/lib/esm/resources/line_items.d.ts +1 -166
  412. package/lib/esm/resources/line_items.js +1 -63
  413. package/lib/esm/resources/manual_gateways.d.ts +1 -33
  414. package/lib/esm/resources/manual_gateways.js +1 -39
  415. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -44
  416. package/lib/esm/resources/manual_tax_calculators.js +1 -47
  417. package/lib/esm/resources/markets.d.ts +1 -104
  418. package/lib/esm/resources/markets.js +1 -63
  419. package/lib/esm/resources/merchants.d.ts +1 -41
  420. package/lib/esm/resources/merchants.js +1 -43
  421. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -66
  422. package/lib/esm/resources/order_amount_promotion_rules.js +1 -35
  423. package/lib/esm/resources/order_copies.d.ts +1 -50
  424. package/lib/esm/resources/order_copies.js +1 -47
  425. package/lib/esm/resources/order_factories.d.ts +1 -33
  426. package/lib/esm/resources/order_factories.js +1 -34
  427. package/lib/esm/resources/order_subscription_items.d.ts +1 -71
  428. package/lib/esm/resources/order_subscription_items.js +1 -39
  429. package/lib/esm/resources/order_subscriptions.d.ts +1 -94
  430. package/lib/esm/resources/order_subscriptions.js +1 -75
  431. package/lib/esm/resources/order_validation_rules.d.ts +1 -26
  432. package/lib/esm/resources/order_validation_rules.js +1 -34
  433. package/lib/esm/resources/orders.d.ts +1 -359
  434. package/lib/esm/resources/orders.js +1 -155
  435. package/lib/esm/resources/organization.d.ts +1 -33
  436. package/lib/esm/resources/organization.js +1 -19
  437. package/lib/esm/resources/packages.d.ts +1 -59
  438. package/lib/esm/resources/packages.js +1 -47
  439. package/lib/esm/resources/parcel_line_items.d.ts +1 -46
  440. package/lib/esm/resources/parcel_line_items.js +1 -43
  441. package/lib/esm/resources/parcels.d.ts +1 -125
  442. package/lib/esm/resources/parcels.js +1 -55
  443. package/lib/esm/resources/payment_gateways.d.ts +1 -24
  444. package/lib/esm/resources/payment_gateways.js +1 -30
  445. package/lib/esm/resources/payment_methods.d.ts +1 -80
  446. package/lib/esm/resources/payment_methods.js +1 -47
  447. package/lib/esm/resources/payment_options.d.ts +1 -43
  448. package/lib/esm/resources/payment_options.js +1 -39
  449. package/lib/esm/resources/paypal_gateways.d.ts +1 -40
  450. package/lib/esm/resources/paypal_gateways.js +1 -43
  451. package/lib/esm/resources/paypal_payments.d.ts +1 -52
  452. package/lib/esm/resources/paypal_payments.js +1 -43
  453. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -128
  454. package/lib/esm/resources/percentage_discount_promotions.js +1 -79
  455. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -52
  456. package/lib/esm/resources/price_frequency_tiers.js +1 -47
  457. package/lib/esm/resources/price_list_schedulers.d.ts +1 -0
  458. package/lib/esm/resources/price_list_schedulers.js +1 -0
  459. package/lib/esm/resources/price_lists.d.ts +1 -45
  460. package/lib/esm/resources/price_lists.js +1 -43
  461. package/lib/esm/resources/price_tiers.d.ts +1 -31
  462. package/lib/esm/resources/price_tiers.js +1 -34
  463. package/lib/esm/resources/price_volume_tiers.d.ts +1 -52
  464. package/lib/esm/resources/price_volume_tiers.js +1 -47
  465. package/lib/esm/resources/prices.d.ts +1 -83
  466. package/lib/esm/resources/prices.js +1 -71
  467. package/lib/esm/resources/promotion_rules.d.ts +1 -28
  468. package/lib/esm/resources/promotion_rules.js +1 -26
  469. package/lib/esm/resources/promotions.d.ts +1 -62
  470. package/lib/esm/resources/promotions.js +1 -66
  471. package/lib/esm/resources/recurring_order_copies.d.ts +1 -52
  472. package/lib/esm/resources/recurring_order_copies.js +1 -47
  473. package/lib/esm/resources/refunds.d.ts +1 -43
  474. package/lib/esm/resources/refunds.js +1 -42
  475. package/lib/esm/resources/reserved_stocks.d.ts +1 -27
  476. package/lib/esm/resources/reserved_stocks.js +1 -34
  477. package/lib/esm/resources/resource_errors.d.ts +1 -22
  478. package/lib/esm/resources/resource_errors.js +1 -22
  479. package/lib/esm/resources/return_line_items.d.ts +1 -50
  480. package/lib/esm/resources/return_line_items.js +1 -39
  481. package/lib/esm/resources/returns.d.ts +1 -86
  482. package/lib/esm/resources/returns.js +1 -71
  483. package/lib/esm/resources/satispay_gateways.d.ts +1 -45
  484. package/lib/esm/resources/satispay_gateways.js +1 -43
  485. package/lib/esm/resources/satispay_payments.d.ts +1 -48
  486. package/lib/esm/resources/satispay_payments.js +1 -43
  487. package/lib/esm/resources/shipments.d.ts +1 -139
  488. package/lib/esm/resources/shipments.js +1 -103
  489. package/lib/esm/resources/shipping_categories.d.ts +1 -39
  490. package/lib/esm/resources/shipping_categories.js +1 -43
  491. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -31
  492. package/lib/esm/resources/shipping_method_tiers.js +1 -34
  493. package/lib/esm/resources/shipping_methods.d.ts +1 -121
  494. package/lib/esm/resources/shipping_methods.js +1 -67
  495. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -49
  496. package/lib/esm/resources/shipping_weight_tiers.js +1 -43
  497. package/lib/esm/resources/shipping_zones.d.ts +1 -51
  498. package/lib/esm/resources/shipping_zones.js +1 -39
  499. package/lib/esm/resources/sku_list_items.d.ts +1 -50
  500. package/lib/esm/resources/sku_list_items.js +1 -43
  501. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -75
  502. package/lib/esm/resources/sku_list_promotion_rules.js +1 -43
  503. package/lib/esm/resources/sku_lists.d.ts +1 -63
  504. package/lib/esm/resources/sku_lists.js +1 -55
  505. package/lib/esm/resources/sku_options.d.ts +1 -70
  506. package/lib/esm/resources/sku_options.js +1 -51
  507. package/lib/esm/resources/skus.d.ts +1 -95
  508. package/lib/esm/resources/skus.js +1 -71
  509. package/lib/esm/resources/stock_items.d.ts +1 -59
  510. package/lib/esm/resources/stock_items.js +1 -55
  511. package/lib/esm/resources/stock_line_items.d.ts +1 -69
  512. package/lib/esm/resources/stock_line_items.js +1 -51
  513. package/lib/esm/resources/stock_locations.d.ts +1 -63
  514. package/lib/esm/resources/stock_locations.js +1 -59
  515. package/lib/esm/resources/stock_reservations.d.ts +1 -49
  516. package/lib/esm/resources/stock_reservations.js +1 -51
  517. package/lib/esm/resources/stock_transfers.d.ts +1 -79
  518. package/lib/esm/resources/stock_transfers.js +1 -59
  519. package/lib/esm/resources/stripe_gateways.d.ts +1 -44
  520. package/lib/esm/resources/stripe_gateways.js +1 -43
  521. package/lib/esm/resources/stripe_payments.d.ts +1 -56
  522. package/lib/esm/resources/stripe_payments.js +1 -43
  523. package/lib/esm/resources/subscription_models.d.ts +1 -48
  524. package/lib/esm/resources/subscription_models.js +1 -43
  525. package/lib/esm/resources/tags.d.ts +1 -27
  526. package/lib/esm/resources/tags.js +1 -31
  527. package/lib/esm/resources/tax_calculators.d.ts +1 -27
  528. package/lib/esm/resources/tax_calculators.js +1 -34
  529. package/lib/esm/resources/tax_categories.d.ts +1 -62
  530. package/lib/esm/resources/tax_categories.js +1 -43
  531. package/lib/esm/resources/tax_rules.d.ts +1 -72
  532. package/lib/esm/resources/tax_rules.js +1 -39
  533. package/lib/esm/resources/taxjar_accounts.d.ts +1 -46
  534. package/lib/esm/resources/taxjar_accounts.js +1 -47
  535. package/lib/esm/resources/transactions.d.ts +1 -40
  536. package/lib/esm/resources/transactions.js +1 -38
  537. package/lib/esm/resources/versions.d.ts +1 -22
  538. package/lib/esm/resources/versions.js +1 -22
  539. package/lib/esm/resources/voids.d.ts +1 -43
  540. package/lib/esm/resources/voids.js +1 -42
  541. package/lib/esm/resources/webhooks.d.ts +1 -51
  542. package/lib/esm/resources/webhooks.js +1 -39
  543. package/lib/esm/resources/wire_transfers.d.ts +1 -36
  544. package/lib/esm/resources/wire_transfers.js +1 -39
  545. package/lib/esm/static.d.ts +1 -9
  546. package/lib/esm/static.js +1 -19
  547. package/lib/esm/util.d.ts +1 -6
  548. package/lib/esm/util.js +1 -11
  549. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  550. package/lib/tsconfig.tsbuildinfo +1 -1
  551. package/package.json +4 -4
@@ -1,59 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import type { StockLocation } from './stock_locations';
4
- import type { Parcel } from './parcels';
5
- import type { Attachment } from './attachments';
6
- import type { Version } from './versions';
7
- type PackageRel = ResourceRel & {
8
- type: typeof Packages.TYPE;
9
- };
10
- type StockLocationRel = ResourceRel & {
11
- type: 'stock_locations';
12
- };
13
- interface Package extends Resource {
14
- name?: string;
15
- code?: string;
16
- length?: number;
17
- width?: number;
18
- height?: number;
19
- unit_of_length?: string;
20
- stock_location?: StockLocation;
21
- parcels?: Parcel[];
22
- attachments?: Attachment[];
23
- versions?: Version[];
24
- }
25
- interface PackageCreate extends ResourceCreate {
26
- name: string;
27
- code?: string;
28
- length: number;
29
- width: number;
30
- height: number;
31
- unit_of_length: string;
32
- stock_location: StockLocationRel;
33
- }
34
- interface PackageUpdate extends ResourceUpdate {
35
- name?: string;
36
- code?: string;
37
- length?: number;
38
- width?: number;
39
- height?: number;
40
- unit_of_length?: string;
41
- stock_location?: StockLocationRel;
42
- }
43
- declare class Packages extends ApiResource {
44
- static readonly TYPE: 'packages';
45
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Package>>;
46
- create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
47
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
48
- update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
49
- delete(id: string, options?: ResourcesConfig): Promise<void>;
50
- stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
51
- parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
52
- attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
53
- versions(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
54
- isPackage(resource: any): resource is Package;
55
- relationship(id: string | ResourceId | null): PackageRel;
56
- type(): string;
57
- }
58
- export default Packages;
59
- export { Package, PackageCreate, PackageUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockLocation}from'./stock_locations';import type{Parcel}from'./parcels';import type{Attachment}from'./attachments';import type{Version}from'./versions';type PackageRel=ResourceRel&{type:typeof Packages.TYPE;};type StockLocationRel=ResourceRel&{type:'stock_locations';};interface Package extends Resource{name?:string;code?:string;length?:number;width?:number;height?:number;unit_of_length?:string;stock_location?:StockLocation;parcels?:Parcel[];attachments?:Attachment[];versions?:Version[];}interface PackageCreate extends ResourceCreate{name:string;code?:string;length:number;width:number;height:number;unit_of_length:string;stock_location:StockLocationRel;}interface PackageUpdate extends ResourceUpdate{name?:string;code?:string;length?:number;width?:number;height?:number;unit_of_length?:string;stock_location?:StockLocationRel;}declare class Packages extends ApiResource{static readonly TYPE:'packages';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Package>>;create(resource:PackageCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Package>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Package>;update(resource:PackageUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Package>;delete(id:string,options?:ResourcesConfig):Promise<void>;stock_location(packageId:string|Package,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;parcels(packageId:string|Package,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Parcel>>;attachments(packageId:string|Package,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;versions(packageId:string|Package,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isPackage(resource:any):resource is Package;relationship(id:string|ResourceId|null):PackageRel;type():string;}export default Packages;export{Package,PackageCreate,PackageUpdate};
@@ -1,47 +1 @@
1
- import { ApiResource } from '../resource';
2
- class Packages extends ApiResource {
3
- // static readonly PATH = 'packages'
4
- async list(params, options) {
5
- return this.resources.list({ type: Packages.TYPE }, params, options);
6
- }
7
- async create(resource, params, options) {
8
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
9
- }
10
- async retrieve(id, params, options) {
11
- return this.resources.retrieve({ type: Packages.TYPE, id }, params, options);
12
- }
13
- async update(resource, params, options) {
14
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
15
- }
16
- async delete(id, options) {
17
- await this.resources.delete({ type: Packages.TYPE, id }, options);
18
- }
19
- async stock_location(packageId, params, options) {
20
- const _packageId = packageId.id || packageId;
21
- return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
22
- }
23
- async parcels(packageId, params, options) {
24
- const _packageId = packageId.id || packageId;
25
- return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
26
- }
27
- async attachments(packageId, params, options) {
28
- const _packageId = packageId.id || packageId;
29
- return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
30
- }
31
- async versions(packageId, params, options) {
32
- const _packageId = packageId.id || packageId;
33
- return this.resources.fetch({ type: 'versions' }, `packages/${_packageId}/versions`, params, options);
34
- }
35
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
36
- isPackage(resource) {
37
- return resource.type && (resource.type === Packages.TYPE);
38
- }
39
- relationship(id) {
40
- return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
41
- }
42
- type() {
43
- return Packages.TYPE;
44
- }
45
- }
46
- Packages.TYPE = 'packages';
47
- export default Packages;
1
+ import{ApiResource as n}from"../resource";class r extends n{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async stock_location(e,t,s){const c=e.id||e;return this.resources.fetch({type:"stock_locations"},`packages/${c}/stock_location`,t,s)}async parcels(e,t,s){const c=e.id||e;return this.resources.fetch({type:"parcels"},`packages/${c}/parcels`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`packages/${c}/attachments`,t,s)}async versions(e,t,s){const c=e.id||e;return this.resources.fetch({type:"versions"},`packages/${c}/versions`,t,s)}isPackage(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="packages";export default r;
@@ -1,46 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import type { Parcel } from './parcels';
4
- import type { StockLineItem } from './stock_line_items';
5
- import type { Version } from './versions';
6
- type ParcelLineItemRel = ResourceRel & {
7
- type: typeof ParcelLineItems.TYPE;
8
- };
9
- type ParcelRel = ResourceRel & {
10
- type: 'parcels';
11
- };
12
- type StockLineItemRel = ResourceRel & {
13
- type: 'stock_line_items';
14
- };
15
- interface ParcelLineItem extends Resource {
16
- sku_code?: string;
17
- bundle_code?: string;
18
- quantity?: number;
19
- name?: string;
20
- image_url?: string;
21
- parcel?: Parcel;
22
- stock_line_item?: StockLineItem;
23
- versions?: Version[];
24
- }
25
- interface ParcelLineItemCreate extends ResourceCreate {
26
- quantity: number;
27
- parcel: ParcelRel;
28
- stock_line_item: StockLineItemRel;
29
- }
30
- type ParcelLineItemUpdate = ResourceUpdate;
31
- declare class ParcelLineItems extends ApiResource {
32
- static readonly TYPE: 'parcel_line_items';
33
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
34
- create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
35
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
36
- update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
37
- delete(id: string, options?: ResourcesConfig): Promise<void>;
38
- parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
39
- stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
40
- versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
41
- isParcelLineItem(resource: any): resource is ParcelLineItem;
42
- relationship(id: string | ResourceId | null): ParcelLineItemRel;
43
- type(): string;
44
- }
45
- export default ParcelLineItems;
46
- export { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Parcel}from'./parcels';import type{StockLineItem}from'./stock_line_items';import type{Version}from'./versions';type ParcelLineItemRel=ResourceRel&{type:typeof ParcelLineItems.TYPE;};type ParcelRel=ResourceRel&{type:'parcels';};type StockLineItemRel=ResourceRel&{type:'stock_line_items';};interface ParcelLineItem extends Resource{sku_code?:string;bundle_code?:string;quantity?:number;name?:string;image_url?:string;parcel?:Parcel;stock_line_item?:StockLineItem;versions?:Version[];}interface ParcelLineItemCreate extends ResourceCreate{quantity:number;parcel:ParcelRel;stock_line_item:StockLineItemRel;}type ParcelLineItemUpdate=ResourceUpdate;declare class ParcelLineItems extends ApiResource{static readonly TYPE:'parcel_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ParcelLineItem>>;create(resource:ParcelLineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;update(resource:ParcelLineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;parcel(parcelLineItemId:string|ParcelLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;stock_line_item(parcelLineItemId:string|ParcelLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLineItem>;versions(parcelLineItemId:string|ParcelLineItem,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isParcelLineItem(resource:any):resource is ParcelLineItem;relationship(id:string|ResourceId|null):ParcelLineItemRel;type():string;}export default ParcelLineItems;export{ParcelLineItem,ParcelLineItemCreate,ParcelLineItemUpdate};
@@ -1,43 +1 @@
1
- import { ApiResource } from '../resource';
2
- class ParcelLineItems extends ApiResource {
3
- // static readonly PATH = 'parcel_line_items'
4
- async list(params, options) {
5
- return this.resources.list({ type: ParcelLineItems.TYPE }, params, options);
6
- }
7
- async create(resource, params, options) {
8
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
9
- }
10
- async retrieve(id, params, options) {
11
- return this.resources.retrieve({ type: ParcelLineItems.TYPE, id }, params, options);
12
- }
13
- async update(resource, params, options) {
14
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
15
- }
16
- async delete(id, options) {
17
- await this.resources.delete({ type: ParcelLineItems.TYPE, id }, options);
18
- }
19
- async parcel(parcelLineItemId, params, options) {
20
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
21
- return this.resources.fetch({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
22
- }
23
- async stock_line_item(parcelLineItemId, params, options) {
24
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
25
- return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
26
- }
27
- async versions(parcelLineItemId, params, options) {
28
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
29
- return this.resources.fetch({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
30
- }
31
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
32
- isParcelLineItem(resource) {
33
- return resource.type && (resource.type === ParcelLineItems.TYPE);
34
- }
35
- relationship(id) {
36
- return ((id === null) || (typeof id === 'string')) ? { id, type: ParcelLineItems.TYPE } : { id: id.id, type: ParcelLineItems.TYPE };
37
- }
38
- type() {
39
- return ParcelLineItems.TYPE;
40
- }
41
- }
42
- ParcelLineItems.TYPE = 'parcel_line_items';
43
- export default ParcelLineItems;
1
+ import{ApiResource as c}from"../resource";class s extends c{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async parcel(e,t,r){const i=e.id||e;return this.resources.fetch({type:"parcels"},`parcel_line_items/${i}/parcel`,t,r)}async stock_line_item(e,t,r){const i=e.id||e;return this.resources.fetch({type:"stock_line_items"},`parcel_line_items/${i}/stock_line_item`,t,r)}async versions(e,t,r){const i=e.id||e;return this.resources.fetch({type:"versions"},`parcel_line_items/${i}/versions`,t,r)}isParcelLineItem(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="parcel_line_items";export default s;
@@ -1,125 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import type { Shipment } from './shipments';
4
- import type { Package } from './packages';
5
- import type { ParcelLineItem } from './parcel_line_items';
6
- import type { Attachment } from './attachments';
7
- import type { Event } from './events';
8
- import type { Version } from './versions';
9
- type ParcelRel = ResourceRel & {
10
- type: typeof Parcels.TYPE;
11
- };
12
- type ShipmentRel = ResourceRel & {
13
- type: 'shipments';
14
- };
15
- type PackageRel = ResourceRel & {
16
- type: 'packages';
17
- };
18
- interface Parcel extends Resource {
19
- number?: string;
20
- weight?: number;
21
- unit_of_weight?: string;
22
- eel_pfc?: string;
23
- contents_type?: string;
24
- contents_explanation?: string;
25
- customs_certify?: boolean;
26
- customs_signer?: string;
27
- non_delivery_option?: string;
28
- restriction_type?: string;
29
- restriction_comments?: string;
30
- customs_info_required?: boolean;
31
- shipping_label_url?: string;
32
- shipping_label_file_type?: string;
33
- shipping_label_size?: string;
34
- shipping_label_resolution?: string;
35
- tracking_number?: string;
36
- tracking_status?: string;
37
- tracking_status_detail?: string;
38
- tracking_status_updated_at?: string;
39
- tracking_details?: object;
40
- carrier_weight_oz?: string;
41
- signed_by?: string;
42
- incoterm?: string;
43
- delivery_confirmation?: string;
44
- shipment?: Shipment;
45
- package?: Package;
46
- parcel_line_items?: ParcelLineItem[];
47
- attachments?: Attachment[];
48
- events?: Event[];
49
- versions?: Version[];
50
- }
51
- interface ParcelCreate extends ResourceCreate {
52
- weight: number;
53
- unit_of_weight: string;
54
- eel_pfc?: string;
55
- contents_type?: string;
56
- contents_explanation?: string;
57
- customs_certify?: boolean;
58
- customs_signer?: string;
59
- non_delivery_option?: string;
60
- restriction_type?: string;
61
- restriction_comments?: string;
62
- customs_info_required?: boolean;
63
- shipping_label_url?: string;
64
- shipping_label_file_type?: string;
65
- shipping_label_size?: string;
66
- shipping_label_resolution?: string;
67
- tracking_number?: string;
68
- tracking_status?: string;
69
- tracking_status_detail?: string;
70
- tracking_status_updated_at?: string;
71
- tracking_details?: object;
72
- carrier_weight_oz?: string;
73
- signed_by?: string;
74
- incoterm?: string;
75
- delivery_confirmation?: string;
76
- shipment: ShipmentRel;
77
- package: PackageRel;
78
- }
79
- interface ParcelUpdate extends ResourceUpdate {
80
- weight?: number;
81
- unit_of_weight?: string;
82
- eel_pfc?: string;
83
- contents_type?: string;
84
- contents_explanation?: string;
85
- customs_certify?: boolean;
86
- customs_signer?: string;
87
- non_delivery_option?: string;
88
- restriction_type?: string;
89
- restriction_comments?: string;
90
- customs_info_required?: boolean;
91
- shipping_label_url?: string;
92
- shipping_label_file_type?: string;
93
- shipping_label_size?: string;
94
- shipping_label_resolution?: string;
95
- tracking_number?: string;
96
- tracking_status?: string;
97
- tracking_status_detail?: string;
98
- tracking_status_updated_at?: string;
99
- tracking_details?: object;
100
- carrier_weight_oz?: string;
101
- signed_by?: string;
102
- incoterm?: string;
103
- delivery_confirmation?: string;
104
- shipment?: ShipmentRel;
105
- package?: PackageRel;
106
- }
107
- declare class Parcels extends ApiResource {
108
- static readonly TYPE: 'parcels';
109
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
110
- create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
111
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
112
- update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
113
- delete(id: string, options?: ResourcesConfig): Promise<void>;
114
- shipment(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
115
- package(parcelId: string | Parcel, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
116
- parcel_line_items(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
117
- attachments(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
118
- events(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
119
- versions(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
120
- isParcel(resource: any): resource is Parcel;
121
- relationship(id: string | ResourceId | null): ParcelRel;
122
- type(): string;
123
- }
124
- export default Parcels;
125
- export { Parcel, ParcelCreate, ParcelUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Shipment}from'./shipments';import type{Package}from'./packages';import type{ParcelLineItem}from'./parcel_line_items';import type{Attachment}from'./attachments';import type{Event}from'./events';import type{Version}from'./versions';type ParcelRel=ResourceRel&{type:typeof Parcels.TYPE;};type ShipmentRel=ResourceRel&{type:'shipments';};type PackageRel=ResourceRel&{type:'packages';};interface Parcel extends Resource{number?:string;weight?:number;unit_of_weight?:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;shipping_label_url?:string;shipping_label_file_type?:string;shipping_label_size?:string;shipping_label_resolution?:string;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:object;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;delivery_confirmation?:string;shipment?:Shipment;package?:Package;parcel_line_items?:ParcelLineItem[];attachments?:Attachment[];events?:Event[];versions?:Version[];}interface ParcelCreate extends ResourceCreate{weight:number;unit_of_weight:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;shipping_label_url?:string;shipping_label_file_type?:string;shipping_label_size?:string;shipping_label_resolution?:string;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:object;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;delivery_confirmation?:string;shipment:ShipmentRel;package:PackageRel;}interface ParcelUpdate extends ResourceUpdate{weight?:number;unit_of_weight?:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;shipping_label_url?:string;shipping_label_file_type?:string;shipping_label_size?:string;shipping_label_resolution?:string;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:object;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;delivery_confirmation?:string;shipment?:ShipmentRel;package?:PackageRel;}declare class Parcels extends ApiResource{static readonly TYPE:'parcels';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Parcel>>;create(resource:ParcelCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;update(resource:ParcelUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;delete(id:string,options?:ResourcesConfig):Promise<void>;shipment(parcelId:string|Parcel,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;package(parcelId:string|Parcel,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Package>;parcel_line_items(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ParcelLineItem>>;attachments(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;versions(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isParcel(resource:any):resource is Parcel;relationship(id:string|ResourceId|null):ParcelRel;type():string;}export default Parcels;export{Parcel,ParcelCreate,ParcelUpdate};
@@ -1,55 +1 @@
1
- import { ApiResource } from '../resource';
2
- class Parcels extends ApiResource {
3
- // static readonly PATH = 'parcels'
4
- async list(params, options) {
5
- return this.resources.list({ type: Parcels.TYPE }, params, options);
6
- }
7
- async create(resource, params, options) {
8
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
9
- }
10
- async retrieve(id, params, options) {
11
- return this.resources.retrieve({ type: Parcels.TYPE, id }, params, options);
12
- }
13
- async update(resource, params, options) {
14
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
15
- }
16
- async delete(id, options) {
17
- await this.resources.delete({ type: Parcels.TYPE, id }, options);
18
- }
19
- async shipment(parcelId, params, options) {
20
- const _parcelId = parcelId.id || parcelId;
21
- return this.resources.fetch({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options);
22
- }
23
- async package(parcelId, params, options) {
24
- const _parcelId = parcelId.id || parcelId;
25
- return this.resources.fetch({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options);
26
- }
27
- async parcel_line_items(parcelId, params, options) {
28
- const _parcelId = parcelId.id || parcelId;
29
- return this.resources.fetch({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options);
30
- }
31
- async attachments(parcelId, params, options) {
32
- const _parcelId = parcelId.id || parcelId;
33
- return this.resources.fetch({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options);
34
- }
35
- async events(parcelId, params, options) {
36
- const _parcelId = parcelId.id || parcelId;
37
- return this.resources.fetch({ type: 'events' }, `parcels/${_parcelId}/events`, params, options);
38
- }
39
- async versions(parcelId, params, options) {
40
- const _parcelId = parcelId.id || parcelId;
41
- return this.resources.fetch({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options);
42
- }
43
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
44
- isParcel(resource) {
45
- return resource.type && (resource.type === Parcels.TYPE);
46
- }
47
- relationship(id) {
48
- return ((id === null) || (typeof id === 'string')) ? { id, type: Parcels.TYPE } : { id: id.id, type: Parcels.TYPE };
49
- }
50
- type() {
51
- return Parcels.TYPE;
52
- }
53
- }
54
- Parcels.TYPE = 'parcels';
55
- export default Parcels;
1
+ import{ApiResource as c}from"../resource";class r extends c{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async shipment(e,t,s){const n=e.id||e;return this.resources.fetch({type:"shipments"},`parcels/${n}/shipment`,t,s)}async package(e,t,s){const n=e.id||e;return this.resources.fetch({type:"packages"},`parcels/${n}/package`,t,s)}async parcel_line_items(e,t,s){const n=e.id||e;return this.resources.fetch({type:"parcel_line_items"},`parcels/${n}/parcel_line_items`,t,s)}async attachments(e,t,s){const n=e.id||e;return this.resources.fetch({type:"attachments"},`parcels/${n}/attachments`,t,s)}async events(e,t,s){const n=e.id||e;return this.resources.fetch({type:"events"},`parcels/${n}/events`,t,s)}async versions(e,t,s){const n=e.id||e;return this.resources.fetch({type:"versions"},`parcels/${n}/versions`,t,s)}isParcel(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="parcels";export default r;
@@ -1,24 +1 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import type { PaymentMethod } from './payment_methods';
4
- import type { Version } from './versions';
5
- type PaymentGatewayRel = ResourceRel & {
6
- type: typeof PaymentGateways.TYPE;
7
- };
8
- interface PaymentGateway extends Resource {
9
- name?: string;
10
- payment_methods?: PaymentMethod[];
11
- versions?: Version[];
12
- }
13
- declare class PaymentGateways extends ApiResource {
14
- static readonly TYPE: 'payment_gateways';
15
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentGateway>>;
16
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
17
- payment_methods(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
18
- versions(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
19
- isPaymentGateway(resource: any): resource is PaymentGateway;
20
- relationship(id: string | ResourceId | null): PaymentGatewayRel;
21
- type(): string;
22
- }
23
- export default PaymentGateways;
24
- export { PaymentGateway };
1
+ import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PaymentMethod}from'./payment_methods';import type{Version}from'./versions';type PaymentGatewayRel=ResourceRel&{type:typeof PaymentGateways.TYPE;};interface PaymentGateway extends Resource{name?:string;payment_methods?:PaymentMethod[];versions?:Version[];}declare class PaymentGateways extends ApiResource{static readonly TYPE:'payment_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentGateway>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;payment_methods(paymentGatewayId:string|PaymentGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;versions(paymentGatewayId:string|PaymentGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isPaymentGateway(resource:any):resource is PaymentGateway;relationship(id:string|ResourceId|null):PaymentGatewayRel;type():string;}export default PaymentGateways;export{PaymentGateway};
@@ -1,30 +1 @@
1
- import { ApiResource } from '../resource';
2
- class PaymentGateways extends ApiResource {
3
- // static readonly PATH = 'payment_gateways'
4
- async list(params, options) {
5
- return this.resources.list({ type: PaymentGateways.TYPE }, params, options);
6
- }
7
- async retrieve(id, params, options) {
8
- return this.resources.retrieve({ type: PaymentGateways.TYPE, id }, params, options);
9
- }
10
- async payment_methods(paymentGatewayId, params, options) {
11
- const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
12
- return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
13
- }
14
- async versions(paymentGatewayId, params, options) {
15
- const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
16
- return this.resources.fetch({ type: 'versions' }, `payment_gateways/${_paymentGatewayId}/versions`, params, options);
17
- }
18
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
19
- isPaymentGateway(resource) {
20
- return resource.type && (resource.type === PaymentGateways.TYPE);
21
- }
22
- relationship(id) {
23
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentGateways.TYPE } : { id: id.id, type: PaymentGateways.TYPE };
24
- }
25
- type() {
26
- return PaymentGateways.TYPE;
27
- }
28
- }
29
- PaymentGateways.TYPE = 'payment_gateways';
30
- export default PaymentGateways;
1
+ import{ApiResource as p}from"../resource";class t extends p{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async payment_methods(e,r,s){const n=e.id||e;return this.resources.fetch({type:"payment_methods"},`payment_gateways/${n}/payment_methods`,r,s)}async versions(e,r,s){const n=e.id||e;return this.resources.fetch({type:"versions"},`payment_gateways/${n}/versions`,r,s)}isPaymentGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="payment_gateways";export default t;
@@ -1,80 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import type { Market } from './markets';
4
- import type { PaymentGateway } from './payment_gateways';
5
- import type { Attachment } from './attachments';
6
- import type { Version } from './versions';
7
- type PaymentMethodRel = ResourceRel & {
8
- type: typeof PaymentMethods.TYPE;
9
- };
10
- type MarketRel = ResourceRel & {
11
- type: 'markets';
12
- };
13
- type PaymentGatewayRel = ResourceRel & {
14
- type: 'payment_gateways';
15
- };
16
- interface PaymentMethod extends Resource {
17
- name?: string;
18
- payment_source_type?: string;
19
- currency_code?: string;
20
- moto?: boolean;
21
- require_capture?: boolean;
22
- auto_place?: boolean;
23
- auto_capture?: boolean;
24
- price_amount_cents?: number;
25
- price_amount_float?: number;
26
- formatted_price_amount?: string;
27
- auto_capture_max_amount_cents?: number;
28
- auto_capture_max_amount_float?: number;
29
- formatted_auto_capture_max_amount?: string;
30
- disabled_at?: string;
31
- market?: Market;
32
- payment_gateway?: PaymentGateway;
33
- attachments?: Attachment[];
34
- versions?: Version[];
35
- }
36
- interface PaymentMethodCreate extends ResourceCreate {
37
- payment_source_type: string;
38
- currency_code?: string;
39
- moto?: boolean;
40
- require_capture?: boolean;
41
- auto_place?: boolean;
42
- auto_capture?: boolean;
43
- price_amount_cents: number;
44
- auto_capture_max_amount_cents?: number;
45
- _disable?: boolean;
46
- _enable?: boolean;
47
- market?: MarketRel;
48
- payment_gateway: PaymentGatewayRel;
49
- }
50
- interface PaymentMethodUpdate extends ResourceUpdate {
51
- payment_source_type?: string;
52
- currency_code?: string;
53
- moto?: boolean;
54
- require_capture?: boolean;
55
- auto_place?: boolean;
56
- auto_capture?: boolean;
57
- price_amount_cents?: number;
58
- auto_capture_max_amount_cents?: number;
59
- _disable?: boolean;
60
- _enable?: boolean;
61
- market?: MarketRel;
62
- payment_gateway?: PaymentGatewayRel;
63
- }
64
- declare class PaymentMethods extends ApiResource {
65
- static readonly TYPE: 'payment_methods';
66
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
67
- create(resource: PaymentMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
68
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
69
- update(resource: PaymentMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
70
- delete(id: string, options?: ResourcesConfig): Promise<void>;
71
- market(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
72
- payment_gateway(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
73
- attachments(paymentMethodId: string | PaymentMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
74
- versions(paymentMethodId: string | PaymentMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
75
- isPaymentMethod(resource: any): resource is PaymentMethod;
76
- relationship(id: string | ResourceId | null): PaymentMethodRel;
77
- type(): string;
78
- }
79
- export default PaymentMethods;
80
- export { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{PaymentGateway}from'./payment_gateways';import type{Attachment}from'./attachments';import type{Version}from'./versions';type PaymentMethodRel=ResourceRel&{type:typeof PaymentMethods.TYPE;};type MarketRel=ResourceRel&{type:'markets';};type PaymentGatewayRel=ResourceRel&{type:'payment_gateways';};interface PaymentMethod extends Resource{name?:string;payment_source_type?:string;currency_code?:string;moto?:boolean;require_capture?:boolean;auto_place?:boolean;auto_capture?:boolean;price_amount_cents?:number;price_amount_float?:number;formatted_price_amount?:string;auto_capture_max_amount_cents?:number;auto_capture_max_amount_float?:number;formatted_auto_capture_max_amount?:string;disabled_at?:string;market?:Market;payment_gateway?:PaymentGateway;attachments?:Attachment[];versions?:Version[];}interface PaymentMethodCreate extends ResourceCreate{payment_source_type:string;currency_code?:string;moto?:boolean;require_capture?:boolean;auto_place?:boolean;auto_capture?:boolean;price_amount_cents:number;auto_capture_max_amount_cents?:number;_disable?:boolean;_enable?:boolean;market?:MarketRel;payment_gateway:PaymentGatewayRel;}interface PaymentMethodUpdate extends ResourceUpdate{payment_source_type?:string;currency_code?:string;moto?:boolean;require_capture?:boolean;auto_place?:boolean;auto_capture?:boolean;price_amount_cents?:number;auto_capture_max_amount_cents?:number;_disable?:boolean;_enable?:boolean;market?:MarketRel;payment_gateway?:PaymentGatewayRel;}declare class PaymentMethods extends ApiResource{static readonly TYPE:'payment_methods';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;create(resource:PaymentMethodCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;update(resource:PaymentMethodUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(paymentMethodId:string|PaymentMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;payment_gateway(paymentMethodId:string|PaymentMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;attachments(paymentMethodId:string|PaymentMethod,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;versions(paymentMethodId:string|PaymentMethod,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Version>>;isPaymentMethod(resource:any):resource is PaymentMethod;relationship(id:string|ResourceId|null):PaymentMethodRel;type():string;}export default PaymentMethods;export{PaymentMethod,PaymentMethodCreate,PaymentMethodUpdate};
@@ -1,47 +1 @@
1
- import { ApiResource } from '../resource';
2
- class PaymentMethods extends ApiResource {
3
- // static readonly PATH = 'payment_methods'
4
- async list(params, options) {
5
- return this.resources.list({ type: PaymentMethods.TYPE }, params, options);
6
- }
7
- async create(resource, params, options) {
8
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
9
- }
10
- async retrieve(id, params, options) {
11
- return this.resources.retrieve({ type: PaymentMethods.TYPE, id }, params, options);
12
- }
13
- async update(resource, params, options) {
14
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
15
- }
16
- async delete(id, options) {
17
- await this.resources.delete({ type: PaymentMethods.TYPE, id }, options);
18
- }
19
- async market(paymentMethodId, params, options) {
20
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
21
- return this.resources.fetch({ type: 'markets' }, `payment_methods/${_paymentMethodId}/market`, params, options);
22
- }
23
- async payment_gateway(paymentMethodId, params, options) {
24
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
25
- return this.resources.fetch({ type: 'payment_gateways' }, `payment_methods/${_paymentMethodId}/payment_gateway`, params, options);
26
- }
27
- async attachments(paymentMethodId, params, options) {
28
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
29
- return this.resources.fetch({ type: 'attachments' }, `payment_methods/${_paymentMethodId}/attachments`, params, options);
30
- }
31
- async versions(paymentMethodId, params, options) {
32
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
33
- return this.resources.fetch({ type: 'versions' }, `payment_methods/${_paymentMethodId}/versions`, params, options);
34
- }
35
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
36
- isPaymentMethod(resource) {
37
- return resource.type && (resource.type === PaymentMethods.TYPE);
38
- }
39
- relationship(id) {
40
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentMethods.TYPE } : { id: id.id, type: PaymentMethods.TYPE };
41
- }
42
- type() {
43
- return PaymentMethods.TYPE;
44
- }
45
- }
46
- PaymentMethods.TYPE = 'payment_methods';
47
- export default PaymentMethods;
1
+ import{ApiResource as a}from"../resource";class r extends a{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async market(e,t,s){const n=e.id||e;return this.resources.fetch({type:"markets"},`payment_methods/${n}/market`,t,s)}async payment_gateway(e,t,s){const n=e.id||e;return this.resources.fetch({type:"payment_gateways"},`payment_methods/${n}/payment_gateway`,t,s)}async attachments(e,t,s){const n=e.id||e;return this.resources.fetch({type:"attachments"},`payment_methods/${n}/attachments`,t,s)}async versions(e,t,s){const n=e.id||e;return this.resources.fetch({type:"versions"},`payment_methods/${n}/versions`,t,s)}isPaymentMethod(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="payment_methods";export default r;