@commercelayer/sdk 4.47.0 → 4.49.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 -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 -55
  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 -49
  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 -67
  154. package/lib/cjs/resources/order_subscription_items.js +1 -41
  155. package/lib/cjs/resources/order_subscriptions.d.ts +1 -92
  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 -55
  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_lists.d.ts +1 -45
  184. package/lib/cjs/resources/price_lists.js +1 -45
  185. package/lib/cjs/resources/price_tiers.d.ts +1 -31
  186. package/lib/cjs/resources/price_tiers.js +1 -36
  187. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -52
  188. package/lib/cjs/resources/price_volume_tiers.js +1 -49
  189. package/lib/cjs/resources/prices.d.ts +1 -74
  190. package/lib/cjs/resources/prices.js +1 -61
  191. package/lib/cjs/resources/promotion_rules.d.ts +1 -28
  192. package/lib/cjs/resources/promotion_rules.js +1 -28
  193. package/lib/cjs/resources/promotions.d.ts +1 -62
  194. package/lib/cjs/resources/promotions.js +1 -68
  195. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -52
  196. package/lib/cjs/resources/recurring_order_copies.js +1 -49
  197. package/lib/cjs/resources/refunds.d.ts +1 -43
  198. package/lib/cjs/resources/refunds.js +1 -44
  199. package/lib/cjs/resources/reserved_stocks.d.ts +1 -27
  200. package/lib/cjs/resources/reserved_stocks.js +1 -36
  201. package/lib/cjs/resources/resource_errors.d.ts +1 -22
  202. package/lib/cjs/resources/resource_errors.js +1 -24
  203. package/lib/cjs/resources/return_line_items.d.ts +1 -50
  204. package/lib/cjs/resources/return_line_items.js +1 -41
  205. package/lib/cjs/resources/returns.d.ts +1 -86
  206. package/lib/cjs/resources/returns.js +1 -73
  207. package/lib/cjs/resources/satispay_gateways.d.ts +1 -45
  208. package/lib/cjs/resources/satispay_gateways.js +1 -45
  209. package/lib/cjs/resources/satispay_payments.d.ts +1 -51
  210. package/lib/cjs/resources/satispay_payments.js +1 -45
  211. package/lib/cjs/resources/shipments.d.ts +1 -139
  212. package/lib/cjs/resources/shipments.js +1 -105
  213. package/lib/cjs/resources/shipping_categories.d.ts +1 -39
  214. package/lib/cjs/resources/shipping_categories.js +1 -45
  215. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -31
  216. package/lib/cjs/resources/shipping_method_tiers.js +1 -36
  217. package/lib/cjs/resources/shipping_methods.d.ts +1 -121
  218. package/lib/cjs/resources/shipping_methods.js +1 -69
  219. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -49
  220. package/lib/cjs/resources/shipping_weight_tiers.js +1 -45
  221. package/lib/cjs/resources/shipping_zones.d.ts +1 -51
  222. package/lib/cjs/resources/shipping_zones.js +1 -41
  223. package/lib/cjs/resources/sku_list_items.d.ts +1 -50
  224. package/lib/cjs/resources/sku_list_items.js +1 -45
  225. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -75
  226. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -45
  227. package/lib/cjs/resources/sku_lists.d.ts +1 -63
  228. package/lib/cjs/resources/sku_lists.js +1 -57
  229. package/lib/cjs/resources/sku_options.d.ts +1 -70
  230. package/lib/cjs/resources/sku_options.js +1 -53
  231. package/lib/cjs/resources/skus.d.ts +1 -95
  232. package/lib/cjs/resources/skus.js +1 -73
  233. package/lib/cjs/resources/stock_items.d.ts +1 -58
  234. package/lib/cjs/resources/stock_items.js +1 -57
  235. package/lib/cjs/resources/stock_line_items.d.ts +1 -69
  236. package/lib/cjs/resources/stock_line_items.js +1 -53
  237. package/lib/cjs/resources/stock_locations.d.ts +1 -63
  238. package/lib/cjs/resources/stock_locations.js +1 -61
  239. package/lib/cjs/resources/stock_reservations.d.ts +1 -49
  240. package/lib/cjs/resources/stock_reservations.js +1 -53
  241. package/lib/cjs/resources/stock_transfers.d.ts +1 -79
  242. package/lib/cjs/resources/stock_transfers.js +1 -61
  243. package/lib/cjs/resources/stripe_gateways.d.ts +1 -44
  244. package/lib/cjs/resources/stripe_gateways.js +1 -45
  245. package/lib/cjs/resources/stripe_payments.d.ts +1 -59
  246. package/lib/cjs/resources/stripe_payments.js +1 -45
  247. package/lib/cjs/resources/subscription_models.d.ts +1 -48
  248. package/lib/cjs/resources/subscription_models.js +1 -45
  249. package/lib/cjs/resources/tags.d.ts +1 -27
  250. package/lib/cjs/resources/tags.js +1 -33
  251. package/lib/cjs/resources/tax_calculators.d.ts +1 -27
  252. package/lib/cjs/resources/tax_calculators.js +1 -36
  253. package/lib/cjs/resources/tax_categories.d.ts +1 -62
  254. package/lib/cjs/resources/tax_categories.js +1 -45
  255. package/lib/cjs/resources/tax_rules.d.ts +1 -72
  256. package/lib/cjs/resources/tax_rules.js +1 -41
  257. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -46
  258. package/lib/cjs/resources/taxjar_accounts.js +1 -49
  259. package/lib/cjs/resources/transactions.d.ts +1 -40
  260. package/lib/cjs/resources/transactions.js +1 -40
  261. package/lib/cjs/resources/versions.d.ts +1 -22
  262. package/lib/cjs/resources/versions.js +1 -24
  263. package/lib/cjs/resources/voids.d.ts +1 -43
  264. package/lib/cjs/resources/voids.js +1 -44
  265. package/lib/cjs/resources/webhooks.d.ts +1 -51
  266. package/lib/cjs/resources/webhooks.js +1 -41
  267. package/lib/cjs/resources/wire_transfers.d.ts +1 -36
  268. package/lib/cjs/resources/wire_transfers.js +1 -41
  269. package/lib/cjs/static.d.ts +1 -9
  270. package/lib/cjs/static.js +1 -45
  271. package/lib/cjs/util.d.ts +1 -6
  272. package/lib/cjs/util.js +1 -15
  273. package/lib/esm/api.d.ts +1 -126
  274. package/lib/esm/api.js +1 -265
  275. package/lib/esm/client.d.ts +1 -31
  276. package/lib/esm/client.js +1 -118
  277. package/lib/esm/commercelayer.d.ts +1 -152
  278. package/lib/esm/commercelayer.js +1 -214
  279. package/lib/esm/common.d.ts +1 -4
  280. package/lib/esm/common.js +1 -10
  281. package/lib/esm/config.d.ts +1 -11
  282. package/lib/esm/config.js +1 -11
  283. package/lib/esm/debug.d.ts +1 -3
  284. package/lib/esm/debug.js +1 -40
  285. package/lib/esm/error.d.ts +1 -28
  286. package/lib/esm/error.js +1 -38
  287. package/lib/esm/index.d.ts +1 -7
  288. package/lib/esm/index.js +1 -6
  289. package/lib/esm/interceptor.d.ts +1 -21
  290. package/lib/esm/interceptor.js +1 -1
  291. package/lib/esm/jsonapi.d.ts +1 -5
  292. package/lib/esm/jsonapi.js +1 -75
  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 -23
  296. package/lib/esm/query.js +1 -45
  297. package/lib/esm/resource.d.ts +1 -75
  298. package/lib/esm/resource.js +1 -139
  299. package/lib/esm/resources/addresses.d.ts +1 -102
  300. package/lib/esm/resources/addresses.js +1 -47
  301. package/lib/esm/resources/adjustments.d.ts +1 -41
  302. package/lib/esm/resources/adjustments.js +1 -35
  303. package/lib/esm/resources/adyen_gateways.d.ts +1 -59
  304. package/lib/esm/resources/adyen_gateways.js +1 -43
  305. package/lib/esm/resources/adyen_payments.d.ts +1 -49
  306. package/lib/esm/resources/adyen_payments.js +1 -43
  307. package/lib/esm/resources/application.d.ts +1 -21
  308. package/lib/esm/resources/application.js +1 -19
  309. package/lib/esm/resources/attachments.d.ts +1 -156
  310. package/lib/esm/resources/attachments.js +1 -31
  311. package/lib/esm/resources/authorizations.d.ts +1 -66
  312. package/lib/esm/resources/authorizations.js +1 -49
  313. package/lib/esm/resources/avalara_accounts.d.ts +1 -58
  314. package/lib/esm/resources/avalara_accounts.js +1 -47
  315. package/lib/esm/resources/axerve_gateways.d.ts +1 -47
  316. package/lib/esm/resources/axerve_gateways.js +1 -43
  317. package/lib/esm/resources/axerve_payments.d.ts +1 -55
  318. package/lib/esm/resources/axerve_payments.js +1 -43
  319. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -38
  320. package/lib/esm/resources/billing_info_validation_rules.js +1 -43
  321. package/lib/esm/resources/bing_geocoders.d.ts +1 -35
  322. package/lib/esm/resources/bing_geocoders.js +1 -39
  323. package/lib/esm/resources/braintree_gateways.d.ts +1 -59
  324. package/lib/esm/resources/braintree_gateways.js +1 -43
  325. package/lib/esm/resources/braintree_payments.d.ts +1 -51
  326. package/lib/esm/resources/braintree_payments.js +1 -43
  327. package/lib/esm/resources/bundles.d.ts +1 -90
  328. package/lib/esm/resources/bundles.js +1 -59
  329. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -134
  330. package/lib/esm/resources/buy_x_pay_y_promotions.js +1 -79
  331. package/lib/esm/resources/captures.d.ts +1 -57
  332. package/lib/esm/resources/captures.js +1 -49
  333. package/lib/esm/resources/carrier_accounts.d.ts +1 -29
  334. package/lib/esm/resources/carrier_accounts.js +1 -34
  335. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -48
  336. package/lib/esm/resources/checkout_com_gateways.js +1 -43
  337. package/lib/esm/resources/checkout_com_payments.d.ts +1 -62
  338. package/lib/esm/resources/checkout_com_payments.js +1 -43
  339. package/lib/esm/resources/cleanups.d.ts +1 -39
  340. package/lib/esm/resources/cleanups.js +1 -36
  341. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -66
  342. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -39
  343. package/lib/esm/resources/coupon_recipients.d.ts +1 -47
  344. package/lib/esm/resources/coupon_recipients.js +1 -43
  345. package/lib/esm/resources/coupons.d.ts +1 -70
  346. package/lib/esm/resources/coupons.js +1 -51
  347. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -61
  348. package/lib/esm/resources/custom_promotion_rules.js +1 -35
  349. package/lib/esm/resources/customer_addresses.d.ts +1 -49
  350. package/lib/esm/resources/customer_addresses.js +1 -47
  351. package/lib/esm/resources/customer_groups.d.ts +1 -39
  352. package/lib/esm/resources/customer_groups.js +1 -47
  353. package/lib/esm/resources/customer_password_resets.d.ts +1 -36
  354. package/lib/esm/resources/customer_password_resets.js +1 -39
  355. package/lib/esm/resources/customer_payment_sources.d.ts +1 -85
  356. package/lib/esm/resources/customer_payment_sources.js +1 -43
  357. package/lib/esm/resources/customer_subscriptions.d.ts +1 -34
  358. package/lib/esm/resources/customer_subscriptions.js +1 -43
  359. package/lib/esm/resources/customers.d.ts +1 -75
  360. package/lib/esm/resources/customers.js +1 -75
  361. package/lib/esm/resources/delivery_lead_times.d.ts +1 -54
  362. package/lib/esm/resources/delivery_lead_times.js +1 -47
  363. package/lib/esm/resources/event_callbacks.d.ts +1 -24
  364. package/lib/esm/resources/event_callbacks.js +1 -26
  365. package/lib/esm/resources/events.d.ts +1 -24
  366. package/lib/esm/resources/events.js +1 -30
  367. package/lib/esm/resources/exports.d.ts +1 -40
  368. package/lib/esm/resources/exports.js +1 -32
  369. package/lib/esm/resources/external_gateways.d.ts +1 -55
  370. package/lib/esm/resources/external_gateways.js +1 -43
  371. package/lib/esm/resources/external_payments.d.ts +1 -47
  372. package/lib/esm/resources/external_payments.js +1 -47
  373. package/lib/esm/resources/external_promotions.d.ts +1 -132
  374. package/lib/esm/resources/external_promotions.js +1 -79
  375. package/lib/esm/resources/external_tax_calculators.d.ts +1 -43
  376. package/lib/esm/resources/external_tax_calculators.js +1 -43
  377. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -130
  378. package/lib/esm/resources/fixed_amount_promotions.js +1 -79
  379. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -130
  380. package/lib/esm/resources/fixed_price_promotions.js +1 -79
  381. package/lib/esm/resources/free_gift_promotions.d.ts +1 -128
  382. package/lib/esm/resources/free_gift_promotions.js +1 -79
  383. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -122
  384. package/lib/esm/resources/free_shipping_promotions.js +1 -75
  385. package/lib/esm/resources/geocoders.d.ts +1 -24
  386. package/lib/esm/resources/geocoders.js +1 -30
  387. package/lib/esm/resources/gift_card_recipients.d.ts +1 -47
  388. package/lib/esm/resources/gift_card_recipients.js +1 -43
  389. package/lib/esm/resources/gift_cards.d.ts +1 -99
  390. package/lib/esm/resources/gift_cards.js +1 -55
  391. package/lib/esm/resources/google_geocoders.d.ts +1 -35
  392. package/lib/esm/resources/google_geocoders.js +1 -39
  393. package/lib/esm/resources/imports.d.ts +1 -43
  394. package/lib/esm/resources/imports.js +1 -32
  395. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -65
  396. package/lib/esm/resources/in_stock_subscriptions.js +1 -51
  397. package/lib/esm/resources/inventory_models.d.ts +1 -54
  398. package/lib/esm/resources/inventory_models.js +1 -47
  399. package/lib/esm/resources/inventory_return_locations.d.ts +1 -46
  400. package/lib/esm/resources/inventory_return_locations.js +1 -43
  401. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -49
  402. package/lib/esm/resources/inventory_stock_locations.js +1 -43
  403. package/lib/esm/resources/klarna_gateways.d.ts +1 -47
  404. package/lib/esm/resources/klarna_gateways.js +1 -43
  405. package/lib/esm/resources/klarna_payments.d.ts +1 -49
  406. package/lib/esm/resources/klarna_payments.js +1 -43
  407. package/lib/esm/resources/line_item_options.d.ts +1 -68
  408. package/lib/esm/resources/line_item_options.js +1 -47
  409. package/lib/esm/resources/line_items.d.ts +1 -166
  410. package/lib/esm/resources/line_items.js +1 -63
  411. package/lib/esm/resources/manual_gateways.d.ts +1 -33
  412. package/lib/esm/resources/manual_gateways.js +1 -39
  413. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -44
  414. package/lib/esm/resources/manual_tax_calculators.js +1 -47
  415. package/lib/esm/resources/markets.d.ts +1 -104
  416. package/lib/esm/resources/markets.js +1 -63
  417. package/lib/esm/resources/merchants.d.ts +1 -41
  418. package/lib/esm/resources/merchants.js +1 -43
  419. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -66
  420. package/lib/esm/resources/order_amount_promotion_rules.js +1 -35
  421. package/lib/esm/resources/order_copies.d.ts +1 -50
  422. package/lib/esm/resources/order_copies.js +1 -47
  423. package/lib/esm/resources/order_factories.d.ts +1 -33
  424. package/lib/esm/resources/order_factories.js +1 -34
  425. package/lib/esm/resources/order_subscription_items.d.ts +1 -67
  426. package/lib/esm/resources/order_subscription_items.js +1 -39
  427. package/lib/esm/resources/order_subscriptions.d.ts +1 -92
  428. package/lib/esm/resources/order_subscriptions.js +1 -75
  429. package/lib/esm/resources/order_validation_rules.d.ts +1 -26
  430. package/lib/esm/resources/order_validation_rules.js +1 -34
  431. package/lib/esm/resources/orders.d.ts +1 -359
  432. package/lib/esm/resources/orders.js +1 -155
  433. package/lib/esm/resources/organization.d.ts +1 -33
  434. package/lib/esm/resources/organization.js +1 -19
  435. package/lib/esm/resources/packages.d.ts +1 -59
  436. package/lib/esm/resources/packages.js +1 -47
  437. package/lib/esm/resources/parcel_line_items.d.ts +1 -46
  438. package/lib/esm/resources/parcel_line_items.js +1 -43
  439. package/lib/esm/resources/parcels.d.ts +1 -125
  440. package/lib/esm/resources/parcels.js +1 -55
  441. package/lib/esm/resources/payment_gateways.d.ts +1 -24
  442. package/lib/esm/resources/payment_gateways.js +1 -30
  443. package/lib/esm/resources/payment_methods.d.ts +1 -80
  444. package/lib/esm/resources/payment_methods.js +1 -47
  445. package/lib/esm/resources/payment_options.d.ts +1 -43
  446. package/lib/esm/resources/payment_options.js +1 -39
  447. package/lib/esm/resources/paypal_gateways.d.ts +1 -40
  448. package/lib/esm/resources/paypal_gateways.js +1 -43
  449. package/lib/esm/resources/paypal_payments.d.ts +1 -55
  450. package/lib/esm/resources/paypal_payments.js +1 -43
  451. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -128
  452. package/lib/esm/resources/percentage_discount_promotions.js +1 -79
  453. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -52
  454. package/lib/esm/resources/price_frequency_tiers.js +1 -47
  455. package/lib/esm/resources/price_lists.d.ts +1 -45
  456. package/lib/esm/resources/price_lists.js +1 -43
  457. package/lib/esm/resources/price_tiers.d.ts +1 -31
  458. package/lib/esm/resources/price_tiers.js +1 -34
  459. package/lib/esm/resources/price_volume_tiers.d.ts +1 -52
  460. package/lib/esm/resources/price_volume_tiers.js +1 -47
  461. package/lib/esm/resources/prices.d.ts +1 -74
  462. package/lib/esm/resources/prices.js +1 -59
  463. package/lib/esm/resources/promotion_rules.d.ts +1 -28
  464. package/lib/esm/resources/promotion_rules.js +1 -26
  465. package/lib/esm/resources/promotions.d.ts +1 -62
  466. package/lib/esm/resources/promotions.js +1 -66
  467. package/lib/esm/resources/recurring_order_copies.d.ts +1 -52
  468. package/lib/esm/resources/recurring_order_copies.js +1 -47
  469. package/lib/esm/resources/refunds.d.ts +1 -43
  470. package/lib/esm/resources/refunds.js +1 -42
  471. package/lib/esm/resources/reserved_stocks.d.ts +1 -27
  472. package/lib/esm/resources/reserved_stocks.js +1 -34
  473. package/lib/esm/resources/resource_errors.d.ts +1 -22
  474. package/lib/esm/resources/resource_errors.js +1 -22
  475. package/lib/esm/resources/return_line_items.d.ts +1 -50
  476. package/lib/esm/resources/return_line_items.js +1 -39
  477. package/lib/esm/resources/returns.d.ts +1 -86
  478. package/lib/esm/resources/returns.js +1 -71
  479. package/lib/esm/resources/satispay_gateways.d.ts +1 -45
  480. package/lib/esm/resources/satispay_gateways.js +1 -43
  481. package/lib/esm/resources/satispay_payments.d.ts +1 -51
  482. package/lib/esm/resources/satispay_payments.js +1 -43
  483. package/lib/esm/resources/shipments.d.ts +1 -139
  484. package/lib/esm/resources/shipments.js +1 -103
  485. package/lib/esm/resources/shipping_categories.d.ts +1 -39
  486. package/lib/esm/resources/shipping_categories.js +1 -43
  487. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -31
  488. package/lib/esm/resources/shipping_method_tiers.js +1 -34
  489. package/lib/esm/resources/shipping_methods.d.ts +1 -121
  490. package/lib/esm/resources/shipping_methods.js +1 -67
  491. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -49
  492. package/lib/esm/resources/shipping_weight_tiers.js +1 -43
  493. package/lib/esm/resources/shipping_zones.d.ts +1 -51
  494. package/lib/esm/resources/shipping_zones.js +1 -39
  495. package/lib/esm/resources/sku_list_items.d.ts +1 -50
  496. package/lib/esm/resources/sku_list_items.js +1 -43
  497. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -75
  498. package/lib/esm/resources/sku_list_promotion_rules.js +1 -43
  499. package/lib/esm/resources/sku_lists.d.ts +1 -63
  500. package/lib/esm/resources/sku_lists.js +1 -55
  501. package/lib/esm/resources/sku_options.d.ts +1 -70
  502. package/lib/esm/resources/sku_options.js +1 -51
  503. package/lib/esm/resources/skus.d.ts +1 -95
  504. package/lib/esm/resources/skus.js +1 -71
  505. package/lib/esm/resources/stock_items.d.ts +1 -58
  506. package/lib/esm/resources/stock_items.js +1 -55
  507. package/lib/esm/resources/stock_line_items.d.ts +1 -69
  508. package/lib/esm/resources/stock_line_items.js +1 -51
  509. package/lib/esm/resources/stock_locations.d.ts +1 -63
  510. package/lib/esm/resources/stock_locations.js +1 -59
  511. package/lib/esm/resources/stock_reservations.d.ts +1 -49
  512. package/lib/esm/resources/stock_reservations.js +1 -51
  513. package/lib/esm/resources/stock_transfers.d.ts +1 -79
  514. package/lib/esm/resources/stock_transfers.js +1 -59
  515. package/lib/esm/resources/stripe_gateways.d.ts +1 -44
  516. package/lib/esm/resources/stripe_gateways.js +1 -43
  517. package/lib/esm/resources/stripe_payments.d.ts +1 -59
  518. package/lib/esm/resources/stripe_payments.js +1 -43
  519. package/lib/esm/resources/subscription_models.d.ts +1 -48
  520. package/lib/esm/resources/subscription_models.js +1 -43
  521. package/lib/esm/resources/tags.d.ts +1 -27
  522. package/lib/esm/resources/tags.js +1 -31
  523. package/lib/esm/resources/tax_calculators.d.ts +1 -27
  524. package/lib/esm/resources/tax_calculators.js +1 -34
  525. package/lib/esm/resources/tax_categories.d.ts +1 -62
  526. package/lib/esm/resources/tax_categories.js +1 -43
  527. package/lib/esm/resources/tax_rules.d.ts +1 -72
  528. package/lib/esm/resources/tax_rules.js +1 -39
  529. package/lib/esm/resources/taxjar_accounts.d.ts +1 -46
  530. package/lib/esm/resources/taxjar_accounts.js +1 -47
  531. package/lib/esm/resources/transactions.d.ts +1 -40
  532. package/lib/esm/resources/transactions.js +1 -38
  533. package/lib/esm/resources/versions.d.ts +1 -22
  534. package/lib/esm/resources/versions.js +1 -22
  535. package/lib/esm/resources/voids.d.ts +1 -43
  536. package/lib/esm/resources/voids.js +1 -42
  537. package/lib/esm/resources/webhooks.d.ts +1 -51
  538. package/lib/esm/resources/webhooks.js +1 -39
  539. package/lib/esm/resources/wire_transfers.d.ts +1 -36
  540. package/lib/esm/resources/wire_transfers.js +1 -39
  541. package/lib/esm/static.d.ts +1 -9
  542. package/lib/esm/static.js +1 -19
  543. package/lib/esm/util.d.ts +1 -6
  544. package/lib/esm/util.js +1 -11
  545. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  546. package/lib/tsconfig.tsbuildinfo +1 -1
  547. package/package.json +5 -5
@@ -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,49 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class Packages extends resource_1.ApiResource {
5
- // static readonly PATH = 'packages'
6
- async list(params, options) {
7
- return this.resources.list({ type: Packages.TYPE }, params, options);
8
- }
9
- async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
11
- }
12
- async retrieve(id, params, options) {
13
- return this.resources.retrieve({ type: Packages.TYPE, id }, params, options);
14
- }
15
- async update(resource, params, options) {
16
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
17
- }
18
- async delete(id, options) {
19
- await this.resources.delete({ type: Packages.TYPE, id }, options);
20
- }
21
- async stock_location(packageId, params, options) {
22
- const _packageId = packageId.id || packageId;
23
- return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
24
- }
25
- async parcels(packageId, params, options) {
26
- const _packageId = packageId.id || packageId;
27
- return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
28
- }
29
- async attachments(packageId, params, options) {
30
- const _packageId = packageId.id || packageId;
31
- return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
32
- }
33
- async versions(packageId, params, options) {
34
- const _packageId = packageId.id || packageId;
35
- return this.resources.fetch({ type: 'versions' }, `packages/${_packageId}/versions`, params, options);
36
- }
37
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
38
- isPackage(resource) {
39
- return resource.type && (resource.type === Packages.TYPE);
40
- }
41
- relationship(id) {
42
- return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
43
- }
44
- type() {
45
- return Packages.TYPE;
46
- }
47
- }
48
- Packages.TYPE = 'packages';
49
- exports.default = Packages;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Packages extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Packages.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:Packages.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:Packages.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:Packages.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:Packages.TYPE,id:e},t)}async stock_location(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_locations"},`packages/${r}/stock_location`,t,s)}async parcels(e,t,s){const r=e.id||e;return this.resources.fetch({type:"parcels"},`packages/${r}/parcels`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`packages/${r}/attachments`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`packages/${r}/versions`,t,s)}isPackage(e){return e.type&&e.type===Packages.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Packages.TYPE}:{id:e.id,type:Packages.TYPE}}type(){return Packages.TYPE}}Packages.TYPE="packages",exports.default=Packages;
@@ -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,45 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class ParcelLineItems extends resource_1.ApiResource {
5
- // static readonly PATH = 'parcel_line_items'
6
- async list(params, options) {
7
- return this.resources.list({ type: ParcelLineItems.TYPE }, params, options);
8
- }
9
- async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
11
- }
12
- async retrieve(id, params, options) {
13
- return this.resources.retrieve({ type: ParcelLineItems.TYPE, id }, params, options);
14
- }
15
- async update(resource, params, options) {
16
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: ParcelLineItems.TYPE }), params, options);
17
- }
18
- async delete(id, options) {
19
- await this.resources.delete({ type: ParcelLineItems.TYPE, id }, options);
20
- }
21
- async parcel(parcelLineItemId, params, options) {
22
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
23
- return this.resources.fetch({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options);
24
- }
25
- async stock_line_item(parcelLineItemId, params, options) {
26
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
27
- return this.resources.fetch({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options);
28
- }
29
- async versions(parcelLineItemId, params, options) {
30
- const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
31
- return this.resources.fetch({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
32
- }
33
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
34
- isParcelLineItem(resource) {
35
- return resource.type && (resource.type === ParcelLineItems.TYPE);
36
- }
37
- relationship(id) {
38
- return ((id === null) || (typeof id === 'string')) ? { id, type: ParcelLineItems.TYPE } : { id: id.id, type: ParcelLineItems.TYPE };
39
- }
40
- type() {
41
- return ParcelLineItems.TYPE;
42
- }
43
- }
44
- ParcelLineItems.TYPE = 'parcel_line_items';
45
- exports.default = ParcelLineItems;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class ParcelLineItems extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:ParcelLineItems.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:ParcelLineItems.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:ParcelLineItems.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:ParcelLineItems.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:ParcelLineItems.TYPE,id:e},t)}async parcel(e,t,s){const r=e.id||e;return this.resources.fetch({type:"parcels"},`parcel_line_items/${r}/parcel`,t,s)}async stock_line_item(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_line_items"},`parcel_line_items/${r}/stock_line_item`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`parcel_line_items/${r}/versions`,t,s)}isParcelLineItem(e){return e.type&&e.type===ParcelLineItems.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:ParcelLineItems.TYPE}:{id:e.id,type:ParcelLineItems.TYPE}}type(){return ParcelLineItems.TYPE}}ParcelLineItems.TYPE="parcel_line_items",exports.default=ParcelLineItems;
@@ -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,57 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class Parcels extends resource_1.ApiResource {
5
- // static readonly PATH = 'parcels'
6
- async list(params, options) {
7
- return this.resources.list({ type: Parcels.TYPE }, params, options);
8
- }
9
- async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
11
- }
12
- async retrieve(id, params, options) {
13
- return this.resources.retrieve({ type: Parcels.TYPE, id }, params, options);
14
- }
15
- async update(resource, params, options) {
16
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: Parcels.TYPE }), params, options);
17
- }
18
- async delete(id, options) {
19
- await this.resources.delete({ type: Parcels.TYPE, id }, options);
20
- }
21
- async shipment(parcelId, params, options) {
22
- const _parcelId = parcelId.id || parcelId;
23
- return this.resources.fetch({ type: 'shipments' }, `parcels/${_parcelId}/shipment`, params, options);
24
- }
25
- async package(parcelId, params, options) {
26
- const _parcelId = parcelId.id || parcelId;
27
- return this.resources.fetch({ type: 'packages' }, `parcels/${_parcelId}/package`, params, options);
28
- }
29
- async parcel_line_items(parcelId, params, options) {
30
- const _parcelId = parcelId.id || parcelId;
31
- return this.resources.fetch({ type: 'parcel_line_items' }, `parcels/${_parcelId}/parcel_line_items`, params, options);
32
- }
33
- async attachments(parcelId, params, options) {
34
- const _parcelId = parcelId.id || parcelId;
35
- return this.resources.fetch({ type: 'attachments' }, `parcels/${_parcelId}/attachments`, params, options);
36
- }
37
- async events(parcelId, params, options) {
38
- const _parcelId = parcelId.id || parcelId;
39
- return this.resources.fetch({ type: 'events' }, `parcels/${_parcelId}/events`, params, options);
40
- }
41
- async versions(parcelId, params, options) {
42
- const _parcelId = parcelId.id || parcelId;
43
- return this.resources.fetch({ type: 'versions' }, `parcels/${_parcelId}/versions`, params, options);
44
- }
45
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
46
- isParcel(resource) {
47
- return resource.type && (resource.type === Parcels.TYPE);
48
- }
49
- relationship(id) {
50
- return ((id === null) || (typeof id === 'string')) ? { id, type: Parcels.TYPE } : { id: id.id, type: Parcels.TYPE };
51
- }
52
- type() {
53
- return Parcels.TYPE;
54
- }
55
- }
56
- Parcels.TYPE = 'parcels';
57
- exports.default = Parcels;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Parcels extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Parcels.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:Parcels.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:Parcels.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:Parcels.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:Parcels.TYPE,id:e},t)}async shipment(e,t,s){const r=e.id||e;return this.resources.fetch({type:"shipments"},`parcels/${r}/shipment`,t,s)}async package(e,t,s){const r=e.id||e;return this.resources.fetch({type:"packages"},`parcels/${r}/package`,t,s)}async parcel_line_items(e,t,s){const r=e.id||e;return this.resources.fetch({type:"parcel_line_items"},`parcels/${r}/parcel_line_items`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`parcels/${r}/attachments`,t,s)}async events(e,t,s){const r=e.id||e;return this.resources.fetch({type:"events"},`parcels/${r}/events`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`parcels/${r}/versions`,t,s)}isParcel(e){return e.type&&e.type===Parcels.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Parcels.TYPE}:{id:e.id,type:Parcels.TYPE}}type(){return Parcels.TYPE}}Parcels.TYPE="parcels",exports.default=Parcels;
@@ -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,32 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class PaymentGateways extends resource_1.ApiResource {
5
- // static readonly PATH = 'payment_gateways'
6
- async list(params, options) {
7
- return this.resources.list({ type: PaymentGateways.TYPE }, params, options);
8
- }
9
- async retrieve(id, params, options) {
10
- return this.resources.retrieve({ type: PaymentGateways.TYPE, id }, params, options);
11
- }
12
- async payment_methods(paymentGatewayId, params, options) {
13
- const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
14
- return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
15
- }
16
- async versions(paymentGatewayId, params, options) {
17
- const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
18
- return this.resources.fetch({ type: 'versions' }, `payment_gateways/${_paymentGatewayId}/versions`, params, options);
19
- }
20
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
21
- isPaymentGateway(resource) {
22
- return resource.type && (resource.type === PaymentGateways.TYPE);
23
- }
24
- relationship(id) {
25
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentGateways.TYPE } : { id: id.id, type: PaymentGateways.TYPE };
26
- }
27
- type() {
28
- return PaymentGateways.TYPE;
29
- }
30
- }
31
- PaymentGateways.TYPE = 'payment_gateways';
32
- exports.default = PaymentGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class PaymentGateways extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:PaymentGateways.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:PaymentGateways.TYPE,id:e},t,r)}async payment_methods(e,t,r){const s=e.id||e;return this.resources.fetch({type:"payment_methods"},`payment_gateways/${s}/payment_methods`,t,r)}async versions(e,t,r){const s=e.id||e;return this.resources.fetch({type:"versions"},`payment_gateways/${s}/versions`,t,r)}isPaymentGateway(e){return e.type&&e.type===PaymentGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:PaymentGateways.TYPE}:{id:e.id,type:PaymentGateways.TYPE}}type(){return PaymentGateways.TYPE}}PaymentGateways.TYPE="payment_gateways",exports.default=PaymentGateways;
@@ -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,49 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const resource_1 = require("../resource");
4
- class PaymentMethods extends resource_1.ApiResource {
5
- // static readonly PATH = 'payment_methods'
6
- async list(params, options) {
7
- return this.resources.list({ type: PaymentMethods.TYPE }, params, options);
8
- }
9
- async create(resource, params, options) {
10
- return this.resources.create(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
11
- }
12
- async retrieve(id, params, options) {
13
- return this.resources.retrieve({ type: PaymentMethods.TYPE, id }, params, options);
14
- }
15
- async update(resource, params, options) {
16
- return this.resources.update(Object.assign(Object.assign({}, resource), { type: PaymentMethods.TYPE }), params, options);
17
- }
18
- async delete(id, options) {
19
- await this.resources.delete({ type: PaymentMethods.TYPE, id }, options);
20
- }
21
- async market(paymentMethodId, params, options) {
22
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
23
- return this.resources.fetch({ type: 'markets' }, `payment_methods/${_paymentMethodId}/market`, params, options);
24
- }
25
- async payment_gateway(paymentMethodId, params, options) {
26
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
27
- return this.resources.fetch({ type: 'payment_gateways' }, `payment_methods/${_paymentMethodId}/payment_gateway`, params, options);
28
- }
29
- async attachments(paymentMethodId, params, options) {
30
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
31
- return this.resources.fetch({ type: 'attachments' }, `payment_methods/${_paymentMethodId}/attachments`, params, options);
32
- }
33
- async versions(paymentMethodId, params, options) {
34
- const _paymentMethodId = paymentMethodId.id || paymentMethodId;
35
- return this.resources.fetch({ type: 'versions' }, `payment_methods/${_paymentMethodId}/versions`, params, options);
36
- }
37
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
38
- isPaymentMethod(resource) {
39
- return resource.type && (resource.type === PaymentMethods.TYPE);
40
- }
41
- relationship(id) {
42
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentMethods.TYPE } : { id: id.id, type: PaymentMethods.TYPE };
43
- }
44
- type() {
45
- return PaymentMethods.TYPE;
46
- }
47
- }
48
- PaymentMethods.TYPE = 'payment_methods';
49
- exports.default = PaymentMethods;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class PaymentMethods extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:PaymentMethods.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:PaymentMethods.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:PaymentMethods.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:PaymentMethods.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:PaymentMethods.TYPE,id:e},t)}async market(e,t,s){const r=e.id||e;return this.resources.fetch({type:"markets"},`payment_methods/${r}/market`,t,s)}async payment_gateway(e,t,s){const r=e.id||e;return this.resources.fetch({type:"payment_gateways"},`payment_methods/${r}/payment_gateway`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`payment_methods/${r}/attachments`,t,s)}async versions(e,t,s){const r=e.id||e;return this.resources.fetch({type:"versions"},`payment_methods/${r}/versions`,t,s)}isPaymentMethod(e){return e.type&&e.type===PaymentMethods.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:PaymentMethods.TYPE}:{id:e.id,type:PaymentMethods.TYPE}}type(){return PaymentMethods.TYPE}}PaymentMethods.TYPE="payment_methods",exports.default=PaymentMethods;