@commercelayer/sdk 4.22.0 → 4.23.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 (479) hide show
  1. package/lib/cjs/api.d.ts +109 -1
  2. package/lib/cjs/api.js +343 -1
  3. package/lib/cjs/client.d.ts +31 -1
  4. package/lib/cjs/client.js +123 -1
  5. package/lib/cjs/commercelayer.d.ts +133 -1
  6. package/lib/cjs/commercelayer.js +224 -1
  7. package/lib/cjs/common.d.ts +4 -1
  8. package/lib/cjs/common.js +14 -1
  9. package/lib/cjs/config.d.ts +11 -1
  10. package/lib/cjs/config.js +13 -1
  11. package/lib/cjs/debug.d.ts +3 -1
  12. package/lib/cjs/debug.js +42 -1
  13. package/lib/cjs/error.d.ts +28 -1
  14. package/lib/cjs/error.js +43 -1
  15. package/lib/cjs/index.d.ts +7 -1
  16. package/lib/cjs/index.js +29 -1
  17. package/lib/cjs/interceptor.d.ts +21 -1
  18. package/lib/cjs/interceptor.js +2 -1
  19. package/lib/cjs/jsonapi.d.ts +5 -1
  20. package/lib/cjs/jsonapi.js +82 -1
  21. package/lib/cjs/model.d.ts +107 -1
  22. package/lib/cjs/model.js +3 -1
  23. package/lib/cjs/query.d.ts +23 -1
  24. package/lib/cjs/query.js +51 -1
  25. package/lib/cjs/resource.d.ts +77 -1
  26. package/lib/cjs/resource.js +145 -1
  27. package/lib/cjs/resources/addresses.d.ts +88 -1
  28. package/lib/cjs/resources/addresses.js +37 -1
  29. package/lib/cjs/resources/adjustments.d.ts +35 -1
  30. package/lib/cjs/resources/adjustments.js +33 -1
  31. package/lib/cjs/resources/adyen_gateways.d.ts +56 -1
  32. package/lib/cjs/resources/adyen_gateways.js +41 -1
  33. package/lib/cjs/resources/adyen_payments.d.ts +45 -1
  34. package/lib/cjs/resources/adyen_payments.js +41 -1
  35. package/lib/cjs/resources/application.d.ts +21 -1
  36. package/lib/cjs/resources/application.js +21 -1
  37. package/lib/cjs/resources/attachments.d.ts +156 -1
  38. package/lib/cjs/resources/attachments.js +33 -1
  39. package/lib/cjs/resources/authorizations.d.ts +60 -1
  40. package/lib/cjs/resources/authorizations.js +43 -1
  41. package/lib/cjs/resources/avalara_accounts.d.ts +55 -1
  42. package/lib/cjs/resources/avalara_accounts.js +45 -1
  43. package/lib/cjs/resources/billing_info_validation_rules.d.ts +35 -1
  44. package/lib/cjs/resources/billing_info_validation_rules.js +41 -1
  45. package/lib/cjs/resources/bing_geocoders.d.ts +35 -1
  46. package/lib/cjs/resources/bing_geocoders.js +41 -1
  47. package/lib/cjs/resources/braintree_gateways.d.ts +56 -1
  48. package/lib/cjs/resources/braintree_gateways.js +41 -1
  49. package/lib/cjs/resources/braintree_payments.d.ts +47 -1
  50. package/lib/cjs/resources/braintree_payments.js +41 -1
  51. package/lib/cjs/resources/bundles.d.ts +76 -1
  52. package/lib/cjs/resources/bundles.js +49 -1
  53. package/lib/cjs/resources/captures.d.ts +51 -1
  54. package/lib/cjs/resources/captures.js +43 -1
  55. package/lib/cjs/resources/carrier_accounts.d.ts +26 -1
  56. package/lib/cjs/resources/carrier_accounts.js +32 -1
  57. package/lib/cjs/resources/checkout_com_gateways.d.ts +45 -1
  58. package/lib/cjs/resources/checkout_com_gateways.js +41 -1
  59. package/lib/cjs/resources/checkout_com_payments.d.ts +58 -1
  60. package/lib/cjs/resources/checkout_com_payments.js +41 -1
  61. package/lib/cjs/resources/cleanups.d.ts +36 -1
  62. package/lib/cjs/resources/cleanups.js +34 -1
  63. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +59 -1
  64. package/lib/cjs/resources/coupon_codes_promotion_rules.js +37 -1
  65. package/lib/cjs/resources/coupon_recipients.d.ts +44 -1
  66. package/lib/cjs/resources/coupon_recipients.js +41 -1
  67. package/lib/cjs/resources/coupons.d.ts +45 -1
  68. package/lib/cjs/resources/coupons.js +37 -1
  69. package/lib/cjs/resources/customer_addresses.d.ts +44 -1
  70. package/lib/cjs/resources/customer_addresses.js +45 -1
  71. package/lib/cjs/resources/customer_groups.d.ts +36 -1
  72. package/lib/cjs/resources/customer_groups.js +45 -1
  73. package/lib/cjs/resources/customer_password_resets.d.ts +36 -1
  74. package/lib/cjs/resources/customer_password_resets.js +41 -1
  75. package/lib/cjs/resources/customer_payment_sources.d.ts +70 -1
  76. package/lib/cjs/resources/customer_payment_sources.js +37 -1
  77. package/lib/cjs/resources/customer_subscriptions.d.ts +31 -1
  78. package/lib/cjs/resources/customer_subscriptions.js +41 -1
  79. package/lib/cjs/resources/customers.d.ts +66 -1
  80. package/lib/cjs/resources/customers.js +73 -1
  81. package/lib/cjs/resources/delivery_lead_times.d.ts +51 -1
  82. package/lib/cjs/resources/delivery_lead_times.js +45 -1
  83. package/lib/cjs/resources/event_callbacks.d.ts +24 -1
  84. package/lib/cjs/resources/event_callbacks.js +28 -1
  85. package/lib/cjs/resources/events.d.ts +24 -1
  86. package/lib/cjs/resources/events.js +32 -1
  87. package/lib/cjs/resources/exports.d.ts +40 -1
  88. package/lib/cjs/resources/exports.js +34 -1
  89. package/lib/cjs/resources/external_gateways.d.ts +49 -1
  90. package/lib/cjs/resources/external_gateways.js +41 -1
  91. package/lib/cjs/resources/external_payments.d.ts +43 -1
  92. package/lib/cjs/resources/external_payments.js +45 -1
  93. package/lib/cjs/resources/external_promotions.d.ts +90 -1
  94. package/lib/cjs/resources/external_promotions.js +57 -1
  95. package/lib/cjs/resources/external_tax_calculators.d.ts +37 -1
  96. package/lib/cjs/resources/external_tax_calculators.js +41 -1
  97. package/lib/cjs/resources/fixed_amount_promotions.d.ts +91 -1
  98. package/lib/cjs/resources/fixed_amount_promotions.js +57 -1
  99. package/lib/cjs/resources/fixed_price_promotions.d.ts +102 -1
  100. package/lib/cjs/resources/fixed_price_promotions.js +65 -1
  101. package/lib/cjs/resources/free_gift_promotions.d.ts +100 -1
  102. package/lib/cjs/resources/free_gift_promotions.js +65 -1
  103. package/lib/cjs/resources/free_shipping_promotions.d.ts +83 -1
  104. package/lib/cjs/resources/free_shipping_promotions.js +53 -1
  105. package/lib/cjs/resources/geocoders.d.ts +24 -1
  106. package/lib/cjs/resources/geocoders.js +32 -1
  107. package/lib/cjs/resources/gift_card_recipients.d.ts +44 -1
  108. package/lib/cjs/resources/gift_card_recipients.js +41 -1
  109. package/lib/cjs/resources/gift_cards.d.ts +85 -1
  110. package/lib/cjs/resources/gift_cards.js +49 -1
  111. package/lib/cjs/resources/google_geocoders.d.ts +35 -1
  112. package/lib/cjs/resources/google_geocoders.js +41 -1
  113. package/lib/cjs/resources/imports.d.ts +45 -1
  114. package/lib/cjs/resources/imports.js +34 -1
  115. package/lib/cjs/resources/in_stock_subscriptions.d.ts +62 -1
  116. package/lib/cjs/resources/in_stock_subscriptions.js +49 -1
  117. package/lib/cjs/resources/inventory_models.d.ts +42 -1
  118. package/lib/cjs/resources/inventory_models.js +45 -1
  119. package/lib/cjs/resources/inventory_return_locations.d.ts +43 -1
  120. package/lib/cjs/resources/inventory_return_locations.js +41 -1
  121. package/lib/cjs/resources/inventory_stock_locations.d.ts +46 -1
  122. package/lib/cjs/resources/inventory_stock_locations.js +41 -1
  123. package/lib/cjs/resources/klarna_gateways.d.ts +44 -1
  124. package/lib/cjs/resources/klarna_gateways.js +41 -1
  125. package/lib/cjs/resources/klarna_payments.d.ts +45 -1
  126. package/lib/cjs/resources/klarna_payments.js +41 -1
  127. package/lib/cjs/resources/line_item_options.d.ts +57 -1
  128. package/lib/cjs/resources/line_item_options.js +41 -1
  129. package/lib/cjs/resources/line_items.d.ts +126 -1
  130. package/lib/cjs/resources/line_items.js +49 -1
  131. package/lib/cjs/resources/manual_gateways.d.ts +33 -1
  132. package/lib/cjs/resources/manual_gateways.js +37 -1
  133. package/lib/cjs/resources/manual_tax_calculators.d.ts +41 -1
  134. package/lib/cjs/resources/manual_tax_calculators.js +45 -1
  135. package/lib/cjs/resources/markets.d.ts +88 -1
  136. package/lib/cjs/resources/markets.js +57 -1
  137. package/lib/cjs/resources/merchants.d.ts +38 -1
  138. package/lib/cjs/resources/merchants.js +41 -1
  139. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +56 -1
  140. package/lib/cjs/resources/order_amount_promotion_rules.js +33 -1
  141. package/lib/cjs/resources/order_copies.d.ts +48 -1
  142. package/lib/cjs/resources/order_copies.js +46 -1
  143. package/lib/cjs/resources/order_subscriptions.d.ts +70 -1
  144. package/lib/cjs/resources/order_subscriptions.js +57 -1
  145. package/lib/cjs/resources/order_validation_rules.d.ts +23 -1
  146. package/lib/cjs/resources/order_validation_rules.js +32 -1
  147. package/lib/cjs/resources/orders.d.ts +288 -1
  148. package/lib/cjs/resources/orders.js +113 -1
  149. package/lib/cjs/resources/organization.d.ts +32 -1
  150. package/lib/cjs/resources/organization.js +21 -1
  151. package/lib/cjs/resources/packages.d.ts +56 -1
  152. package/lib/cjs/resources/packages.js +45 -1
  153. package/lib/cjs/resources/parcel_line_items.d.ts +51 -1
  154. package/lib/cjs/resources/parcel_line_items.js +41 -1
  155. package/lib/cjs/resources/parcels.d.ts +119 -1
  156. package/lib/cjs/resources/parcels.js +53 -1
  157. package/lib/cjs/resources/payment_gateways.d.ts +21 -1
  158. package/lib/cjs/resources/payment_gateways.js +28 -1
  159. package/lib/cjs/resources/payment_methods.d.ts +61 -1
  160. package/lib/cjs/resources/payment_methods.js +45 -1
  161. package/lib/cjs/resources/paypal_gateways.d.ts +37 -1
  162. package/lib/cjs/resources/paypal_gateways.js +41 -1
  163. package/lib/cjs/resources/paypal_payments.d.ts +51 -1
  164. package/lib/cjs/resources/paypal_payments.js +41 -1
  165. package/lib/cjs/resources/percentage_discount_promotions.d.ts +100 -1
  166. package/lib/cjs/resources/percentage_discount_promotions.js +65 -1
  167. package/lib/cjs/resources/price_lists.d.ts +39 -1
  168. package/lib/cjs/resources/price_lists.js +41 -1
  169. package/lib/cjs/resources/price_tiers.d.ts +28 -1
  170. package/lib/cjs/resources/price_tiers.js +32 -1
  171. package/lib/cjs/resources/price_volume_tiers.d.ts +46 -1
  172. package/lib/cjs/resources/price_volume_tiers.js +41 -1
  173. package/lib/cjs/resources/prices.d.ts +68 -1
  174. package/lib/cjs/resources/prices.js +53 -1
  175. package/lib/cjs/resources/promotion_rules.d.ts +24 -1
  176. package/lib/cjs/resources/promotion_rules.js +24 -1
  177. package/lib/cjs/resources/promotions.d.ts +41 -1
  178. package/lib/cjs/resources/promotions.js +44 -1
  179. package/lib/cjs/resources/refunds.d.ts +37 -1
  180. package/lib/cjs/resources/refunds.js +36 -1
  181. package/lib/cjs/resources/return_line_items.d.ts +49 -1
  182. package/lib/cjs/resources/return_line_items.js +41 -1
  183. package/lib/cjs/resources/returns.d.ts +75 -1
  184. package/lib/cjs/resources/returns.js +65 -1
  185. package/lib/cjs/resources/shipments.d.ts +93 -1
  186. package/lib/cjs/resources/shipments.js +83 -1
  187. package/lib/cjs/resources/shipping_categories.d.ts +33 -1
  188. package/lib/cjs/resources/shipping_categories.js +41 -1
  189. package/lib/cjs/resources/shipping_method_tiers.d.ts +28 -1
  190. package/lib/cjs/resources/shipping_method_tiers.js +32 -1
  191. package/lib/cjs/resources/shipping_methods.d.ts +107 -1
  192. package/lib/cjs/resources/shipping_methods.js +65 -1
  193. package/lib/cjs/resources/shipping_weight_tiers.d.ts +46 -1
  194. package/lib/cjs/resources/shipping_weight_tiers.js +41 -1
  195. package/lib/cjs/resources/shipping_zones.d.ts +48 -1
  196. package/lib/cjs/resources/shipping_zones.js +37 -1
  197. package/lib/cjs/resources/sku_list_items.d.ts +47 -1
  198. package/lib/cjs/resources/sku_list_items.js +41 -1
  199. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +68 -1
  200. package/lib/cjs/resources/sku_list_promotion_rules.js +41 -1
  201. package/lib/cjs/resources/sku_lists.d.ts +60 -1
  202. package/lib/cjs/resources/sku_lists.js +53 -1
  203. package/lib/cjs/resources/sku_options.d.ts +56 -1
  204. package/lib/cjs/resources/sku_options.js +41 -1
  205. package/lib/cjs/resources/skus.d.ts +78 -1
  206. package/lib/cjs/resources/skus.js +57 -1
  207. package/lib/cjs/resources/stock_items.d.ts +49 -1
  208. package/lib/cjs/resources/stock_items.js +45 -1
  209. package/lib/cjs/resources/stock_line_items.d.ts +29 -1
  210. package/lib/cjs/resources/stock_line_items.js +36 -1
  211. package/lib/cjs/resources/stock_locations.d.ts +57 -1
  212. package/lib/cjs/resources/stock_locations.js +57 -1
  213. package/lib/cjs/resources/stock_transfers.d.ts +74 -1
  214. package/lib/cjs/resources/stock_transfers.js +57 -1
  215. package/lib/cjs/resources/stripe_gateways.d.ts +41 -1
  216. package/lib/cjs/resources/stripe_gateways.js +41 -1
  217. package/lib/cjs/resources/stripe_payments.d.ts +46 -1
  218. package/lib/cjs/resources/stripe_payments.js +41 -1
  219. package/lib/cjs/resources/tax_calculators.d.ts +24 -1
  220. package/lib/cjs/resources/tax_calculators.js +32 -1
  221. package/lib/cjs/resources/tax_categories.d.ts +59 -1
  222. package/lib/cjs/resources/tax_categories.js +41 -1
  223. package/lib/cjs/resources/tax_rules.d.ts +69 -1
  224. package/lib/cjs/resources/tax_rules.js +37 -1
  225. package/lib/cjs/resources/taxjar_accounts.d.ts +43 -1
  226. package/lib/cjs/resources/taxjar_accounts.js +45 -1
  227. package/lib/cjs/resources/transactions.d.ts +31 -1
  228. package/lib/cjs/resources/transactions.js +28 -1
  229. package/lib/cjs/resources/voids.d.ts +37 -1
  230. package/lib/cjs/resources/voids.js +36 -1
  231. package/lib/cjs/resources/webhooks.d.ts +43 -1
  232. package/lib/cjs/resources/webhooks.js +37 -1
  233. package/lib/cjs/resources/wire_transfers.d.ts +32 -1
  234. package/lib/cjs/resources/wire_transfers.js +37 -1
  235. package/lib/cjs/static.d.ts +8 -1
  236. package/lib/cjs/static.js +47 -1
  237. package/lib/cjs/util.d.ts +6 -1
  238. package/lib/cjs/util.js +15 -1
  239. package/lib/esm/api.d.ts +109 -1
  240. package/lib/esm/api.js +231 -1
  241. package/lib/esm/client.d.ts +31 -1
  242. package/lib/esm/client.js +118 -1
  243. package/lib/esm/commercelayer.d.ts +133 -1
  244. package/lib/esm/commercelayer.js +195 -1
  245. package/lib/esm/common.d.ts +4 -1
  246. package/lib/esm/common.js +10 -1
  247. package/lib/esm/config.d.ts +11 -1
  248. package/lib/esm/config.js +11 -1
  249. package/lib/esm/debug.d.ts +3 -1
  250. package/lib/esm/debug.js +40 -1
  251. package/lib/esm/error.d.ts +28 -1
  252. package/lib/esm/error.js +38 -1
  253. package/lib/esm/index.d.ts +7 -1
  254. package/lib/esm/index.js +6 -1
  255. package/lib/esm/interceptor.d.ts +21 -1
  256. package/lib/esm/interceptor.js +1 -1
  257. package/lib/esm/jsonapi.d.ts +5 -1
  258. package/lib/esm/jsonapi.js +75 -1
  259. package/lib/esm/model.d.ts +107 -1
  260. package/lib/esm/model.js +2 -1
  261. package/lib/esm/query.d.ts +23 -1
  262. package/lib/esm/query.js +45 -1
  263. package/lib/esm/resource.d.ts +77 -1
  264. package/lib/esm/resource.js +139 -1
  265. package/lib/esm/resources/addresses.d.ts +88 -1
  266. package/lib/esm/resources/addresses.js +35 -1
  267. package/lib/esm/resources/adjustments.d.ts +35 -1
  268. package/lib/esm/resources/adjustments.js +31 -1
  269. package/lib/esm/resources/adyen_gateways.d.ts +56 -1
  270. package/lib/esm/resources/adyen_gateways.js +39 -1
  271. package/lib/esm/resources/adyen_payments.d.ts +45 -1
  272. package/lib/esm/resources/adyen_payments.js +39 -1
  273. package/lib/esm/resources/application.d.ts +21 -1
  274. package/lib/esm/resources/application.js +19 -1
  275. package/lib/esm/resources/attachments.d.ts +156 -1
  276. package/lib/esm/resources/attachments.js +31 -1
  277. package/lib/esm/resources/authorizations.d.ts +60 -1
  278. package/lib/esm/resources/authorizations.js +41 -1
  279. package/lib/esm/resources/avalara_accounts.d.ts +55 -1
  280. package/lib/esm/resources/avalara_accounts.js +43 -1
  281. package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -1
  282. package/lib/esm/resources/billing_info_validation_rules.js +39 -1
  283. package/lib/esm/resources/bing_geocoders.d.ts +35 -1
  284. package/lib/esm/resources/bing_geocoders.js +39 -1
  285. package/lib/esm/resources/braintree_gateways.d.ts +56 -1
  286. package/lib/esm/resources/braintree_gateways.js +39 -1
  287. package/lib/esm/resources/braintree_payments.d.ts +47 -1
  288. package/lib/esm/resources/braintree_payments.js +39 -1
  289. package/lib/esm/resources/bundles.d.ts +76 -1
  290. package/lib/esm/resources/bundles.js +47 -1
  291. package/lib/esm/resources/captures.d.ts +51 -1
  292. package/lib/esm/resources/captures.js +41 -1
  293. package/lib/esm/resources/carrier_accounts.d.ts +26 -1
  294. package/lib/esm/resources/carrier_accounts.js +30 -1
  295. package/lib/esm/resources/checkout_com_gateways.d.ts +45 -1
  296. package/lib/esm/resources/checkout_com_gateways.js +39 -1
  297. package/lib/esm/resources/checkout_com_payments.d.ts +58 -1
  298. package/lib/esm/resources/checkout_com_payments.js +39 -1
  299. package/lib/esm/resources/cleanups.d.ts +36 -1
  300. package/lib/esm/resources/cleanups.js +32 -1
  301. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +59 -1
  302. package/lib/esm/resources/coupon_codes_promotion_rules.js +35 -1
  303. package/lib/esm/resources/coupon_recipients.d.ts +44 -1
  304. package/lib/esm/resources/coupon_recipients.js +39 -1
  305. package/lib/esm/resources/coupons.d.ts +45 -1
  306. package/lib/esm/resources/coupons.js +35 -1
  307. package/lib/esm/resources/customer_addresses.d.ts +44 -1
  308. package/lib/esm/resources/customer_addresses.js +43 -1
  309. package/lib/esm/resources/customer_groups.d.ts +36 -1
  310. package/lib/esm/resources/customer_groups.js +43 -1
  311. package/lib/esm/resources/customer_password_resets.d.ts +36 -1
  312. package/lib/esm/resources/customer_password_resets.js +39 -1
  313. package/lib/esm/resources/customer_payment_sources.d.ts +70 -1
  314. package/lib/esm/resources/customer_payment_sources.js +35 -1
  315. package/lib/esm/resources/customer_subscriptions.d.ts +31 -1
  316. package/lib/esm/resources/customer_subscriptions.js +39 -1
  317. package/lib/esm/resources/customers.d.ts +66 -1
  318. package/lib/esm/resources/customers.js +71 -1
  319. package/lib/esm/resources/delivery_lead_times.d.ts +51 -1
  320. package/lib/esm/resources/delivery_lead_times.js +43 -1
  321. package/lib/esm/resources/event_callbacks.d.ts +24 -1
  322. package/lib/esm/resources/event_callbacks.js +26 -1
  323. package/lib/esm/resources/events.d.ts +24 -1
  324. package/lib/esm/resources/events.js +30 -1
  325. package/lib/esm/resources/exports.d.ts +40 -1
  326. package/lib/esm/resources/exports.js +32 -1
  327. package/lib/esm/resources/external_gateways.d.ts +49 -1
  328. package/lib/esm/resources/external_gateways.js +39 -1
  329. package/lib/esm/resources/external_payments.d.ts +43 -1
  330. package/lib/esm/resources/external_payments.js +43 -1
  331. package/lib/esm/resources/external_promotions.d.ts +90 -1
  332. package/lib/esm/resources/external_promotions.js +55 -1
  333. package/lib/esm/resources/external_tax_calculators.d.ts +37 -1
  334. package/lib/esm/resources/external_tax_calculators.js +39 -1
  335. package/lib/esm/resources/fixed_amount_promotions.d.ts +91 -1
  336. package/lib/esm/resources/fixed_amount_promotions.js +55 -1
  337. package/lib/esm/resources/fixed_price_promotions.d.ts +102 -1
  338. package/lib/esm/resources/fixed_price_promotions.js +63 -1
  339. package/lib/esm/resources/free_gift_promotions.d.ts +100 -1
  340. package/lib/esm/resources/free_gift_promotions.js +63 -1
  341. package/lib/esm/resources/free_shipping_promotions.d.ts +83 -1
  342. package/lib/esm/resources/free_shipping_promotions.js +51 -1
  343. package/lib/esm/resources/geocoders.d.ts +24 -1
  344. package/lib/esm/resources/geocoders.js +30 -1
  345. package/lib/esm/resources/gift_card_recipients.d.ts +44 -1
  346. package/lib/esm/resources/gift_card_recipients.js +39 -1
  347. package/lib/esm/resources/gift_cards.d.ts +85 -1
  348. package/lib/esm/resources/gift_cards.js +47 -1
  349. package/lib/esm/resources/google_geocoders.d.ts +35 -1
  350. package/lib/esm/resources/google_geocoders.js +39 -1
  351. package/lib/esm/resources/imports.d.ts +45 -1
  352. package/lib/esm/resources/imports.js +32 -1
  353. package/lib/esm/resources/in_stock_subscriptions.d.ts +62 -1
  354. package/lib/esm/resources/in_stock_subscriptions.js +47 -1
  355. package/lib/esm/resources/inventory_models.d.ts +42 -1
  356. package/lib/esm/resources/inventory_models.js +43 -1
  357. package/lib/esm/resources/inventory_return_locations.d.ts +43 -1
  358. package/lib/esm/resources/inventory_return_locations.js +39 -1
  359. package/lib/esm/resources/inventory_stock_locations.d.ts +46 -1
  360. package/lib/esm/resources/inventory_stock_locations.js +39 -1
  361. package/lib/esm/resources/klarna_gateways.d.ts +44 -1
  362. package/lib/esm/resources/klarna_gateways.js +39 -1
  363. package/lib/esm/resources/klarna_payments.d.ts +45 -1
  364. package/lib/esm/resources/klarna_payments.js +39 -1
  365. package/lib/esm/resources/line_item_options.d.ts +57 -1
  366. package/lib/esm/resources/line_item_options.js +39 -1
  367. package/lib/esm/resources/line_items.d.ts +126 -1
  368. package/lib/esm/resources/line_items.js +47 -1
  369. package/lib/esm/resources/manual_gateways.d.ts +33 -1
  370. package/lib/esm/resources/manual_gateways.js +35 -1
  371. package/lib/esm/resources/manual_tax_calculators.d.ts +41 -1
  372. package/lib/esm/resources/manual_tax_calculators.js +43 -1
  373. package/lib/esm/resources/markets.d.ts +88 -1
  374. package/lib/esm/resources/markets.js +55 -1
  375. package/lib/esm/resources/merchants.d.ts +38 -1
  376. package/lib/esm/resources/merchants.js +39 -1
  377. package/lib/esm/resources/order_amount_promotion_rules.d.ts +56 -1
  378. package/lib/esm/resources/order_amount_promotion_rules.js +31 -1
  379. package/lib/esm/resources/order_copies.d.ts +48 -1
  380. package/lib/esm/resources/order_copies.js +44 -1
  381. package/lib/esm/resources/order_subscriptions.d.ts +70 -1
  382. package/lib/esm/resources/order_subscriptions.js +55 -1
  383. package/lib/esm/resources/order_validation_rules.d.ts +23 -1
  384. package/lib/esm/resources/order_validation_rules.js +30 -1
  385. package/lib/esm/resources/orders.d.ts +288 -1
  386. package/lib/esm/resources/orders.js +111 -1
  387. package/lib/esm/resources/organization.d.ts +32 -1
  388. package/lib/esm/resources/organization.js +19 -1
  389. package/lib/esm/resources/packages.d.ts +56 -1
  390. package/lib/esm/resources/packages.js +43 -1
  391. package/lib/esm/resources/parcel_line_items.d.ts +51 -1
  392. package/lib/esm/resources/parcel_line_items.js +39 -1
  393. package/lib/esm/resources/parcels.d.ts +119 -1
  394. package/lib/esm/resources/parcels.js +51 -1
  395. package/lib/esm/resources/payment_gateways.d.ts +21 -1
  396. package/lib/esm/resources/payment_gateways.js +26 -1
  397. package/lib/esm/resources/payment_methods.d.ts +61 -1
  398. package/lib/esm/resources/payment_methods.js +43 -1
  399. package/lib/esm/resources/paypal_gateways.d.ts +37 -1
  400. package/lib/esm/resources/paypal_gateways.js +39 -1
  401. package/lib/esm/resources/paypal_payments.d.ts +51 -1
  402. package/lib/esm/resources/paypal_payments.js +39 -1
  403. package/lib/esm/resources/percentage_discount_promotions.d.ts +100 -1
  404. package/lib/esm/resources/percentage_discount_promotions.js +63 -1
  405. package/lib/esm/resources/price_lists.d.ts +39 -1
  406. package/lib/esm/resources/price_lists.js +39 -1
  407. package/lib/esm/resources/price_tiers.d.ts +28 -1
  408. package/lib/esm/resources/price_tiers.js +30 -1
  409. package/lib/esm/resources/price_volume_tiers.d.ts +46 -1
  410. package/lib/esm/resources/price_volume_tiers.js +39 -1
  411. package/lib/esm/resources/prices.d.ts +68 -1
  412. package/lib/esm/resources/prices.js +51 -1
  413. package/lib/esm/resources/promotion_rules.d.ts +24 -1
  414. package/lib/esm/resources/promotion_rules.js +22 -1
  415. package/lib/esm/resources/promotions.d.ts +41 -1
  416. package/lib/esm/resources/promotions.js +42 -1
  417. package/lib/esm/resources/refunds.d.ts +37 -1
  418. package/lib/esm/resources/refunds.js +34 -1
  419. package/lib/esm/resources/return_line_items.d.ts +49 -1
  420. package/lib/esm/resources/return_line_items.js +39 -1
  421. package/lib/esm/resources/returns.d.ts +75 -1
  422. package/lib/esm/resources/returns.js +63 -1
  423. package/lib/esm/resources/shipments.d.ts +93 -1
  424. package/lib/esm/resources/shipments.js +81 -1
  425. package/lib/esm/resources/shipping_categories.d.ts +33 -1
  426. package/lib/esm/resources/shipping_categories.js +39 -1
  427. package/lib/esm/resources/shipping_method_tiers.d.ts +28 -1
  428. package/lib/esm/resources/shipping_method_tiers.js +30 -1
  429. package/lib/esm/resources/shipping_methods.d.ts +107 -1
  430. package/lib/esm/resources/shipping_methods.js +63 -1
  431. package/lib/esm/resources/shipping_weight_tiers.d.ts +46 -1
  432. package/lib/esm/resources/shipping_weight_tiers.js +39 -1
  433. package/lib/esm/resources/shipping_zones.d.ts +48 -1
  434. package/lib/esm/resources/shipping_zones.js +35 -1
  435. package/lib/esm/resources/sku_list_items.d.ts +47 -1
  436. package/lib/esm/resources/sku_list_items.js +39 -1
  437. package/lib/esm/resources/sku_list_promotion_rules.d.ts +68 -1
  438. package/lib/esm/resources/sku_list_promotion_rules.js +39 -1
  439. package/lib/esm/resources/sku_lists.d.ts +60 -1
  440. package/lib/esm/resources/sku_lists.js +51 -1
  441. package/lib/esm/resources/sku_options.d.ts +56 -1
  442. package/lib/esm/resources/sku_options.js +39 -1
  443. package/lib/esm/resources/skus.d.ts +78 -1
  444. package/lib/esm/resources/skus.js +55 -1
  445. package/lib/esm/resources/stock_items.d.ts +49 -1
  446. package/lib/esm/resources/stock_items.js +43 -1
  447. package/lib/esm/resources/stock_line_items.d.ts +29 -1
  448. package/lib/esm/resources/stock_line_items.js +34 -1
  449. package/lib/esm/resources/stock_locations.d.ts +57 -1
  450. package/lib/esm/resources/stock_locations.js +55 -1
  451. package/lib/esm/resources/stock_transfers.d.ts +74 -1
  452. package/lib/esm/resources/stock_transfers.js +55 -1
  453. package/lib/esm/resources/stripe_gateways.d.ts +41 -1
  454. package/lib/esm/resources/stripe_gateways.js +39 -1
  455. package/lib/esm/resources/stripe_payments.d.ts +46 -1
  456. package/lib/esm/resources/stripe_payments.js +39 -1
  457. package/lib/esm/resources/tax_calculators.d.ts +24 -1
  458. package/lib/esm/resources/tax_calculators.js +30 -1
  459. package/lib/esm/resources/tax_categories.d.ts +59 -1
  460. package/lib/esm/resources/tax_categories.js +39 -1
  461. package/lib/esm/resources/tax_rules.d.ts +69 -1
  462. package/lib/esm/resources/tax_rules.js +35 -1
  463. package/lib/esm/resources/taxjar_accounts.d.ts +43 -1
  464. package/lib/esm/resources/taxjar_accounts.js +43 -1
  465. package/lib/esm/resources/transactions.d.ts +31 -1
  466. package/lib/esm/resources/transactions.js +26 -1
  467. package/lib/esm/resources/voids.d.ts +37 -1
  468. package/lib/esm/resources/voids.js +34 -1
  469. package/lib/esm/resources/webhooks.d.ts +43 -1
  470. package/lib/esm/resources/webhooks.js +35 -1
  471. package/lib/esm/resources/wire_transfers.d.ts +32 -1
  472. package/lib/esm/resources/wire_transfers.js +35 -1
  473. package/lib/esm/static.d.ts +8 -1
  474. package/lib/esm/static.js +18 -1
  475. package/lib/esm/util.d.ts +6 -1
  476. package/lib/esm/util.js +11 -1
  477. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  478. package/lib/tsconfig.tsbuildinfo +1 -1
  479. package/package.json +13 -15
@@ -1 +1,41 @@
1
- import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{PromotionRule}from'./promotion_rules';import type{OrderAmountPromotionRule}from'./order_amount_promotion_rules';import type{SkuListPromotionRule}from'./sku_list_promotion_rules';import type{CouponCodesPromotionRule}from'./coupon_codes_promotion_rules';import type{Attachment}from'./attachments';type PromotionRel=ResourceRel&{type:typeof Promotions.TYPE;};interface Promotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;market?:Market;promotion_rules?:PromotionRule[];order_amount_promotion_rule?:OrderAmountPromotionRule;sku_list_promotion_rule?:SkuListPromotionRule;coupon_codes_promotion_rule?:CouponCodesPromotionRule;attachments?:Attachment[];}declare class Promotions extends ApiResource{static readonly TYPE:'promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Promotion>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Promotion>;market(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(promotionId:string|Promotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isPromotion(resource:any):resource is Promotion;relationship(id:string|ResourceId|null):PromotionRel;type():string;}export default Promotions;export{Promotion};
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Market } from './markets';
4
+ import type { PromotionRule } from './promotion_rules';
5
+ import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
+ import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
+ import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
+ import type { Attachment } from './attachments';
9
+ type PromotionRel = ResourceRel & {
10
+ type: typeof Promotions.TYPE;
11
+ };
12
+ interface Promotion extends Resource {
13
+ name?: string;
14
+ currency_code?: string;
15
+ starts_at?: string;
16
+ expires_at?: string;
17
+ total_usage_limit?: number;
18
+ total_usage_count?: number;
19
+ active?: boolean;
20
+ market?: Market;
21
+ promotion_rules?: PromotionRule[];
22
+ order_amount_promotion_rule?: OrderAmountPromotionRule;
23
+ sku_list_promotion_rule?: SkuListPromotionRule;
24
+ coupon_codes_promotion_rule?: CouponCodesPromotionRule;
25
+ attachments?: Attachment[];
26
+ }
27
+ declare class Promotions extends ApiResource {
28
+ static readonly TYPE: 'promotions';
29
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Promotion>>;
30
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Promotion>;
31
+ market(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
32
+ order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
33
+ sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
34
+ coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
35
+ attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
36
+ isPromotion(resource: any): resource is Promotion;
37
+ relationship(id: string | ResourceId | null): PromotionRel;
38
+ type(): string;
39
+ }
40
+ export default Promotions;
41
+ export { Promotion };
@@ -1 +1,42 @@
1
- import{ApiResource as n}from"../resource";class s extends n{async list(t,r){return this.resources.list({type:s.TYPE},t,r)}async retrieve(t,r,e){return this.resources.retrieve({type:s.TYPE,id:t},r,e)}async market(t,r,e){const o=t.id||t;return this.resources.fetch({type:"markets"},`promotions/${o}/market`,r,e)}async order_amount_promotion_rule(t,r,e){const o=t.id||t;return this.resources.fetch({type:"order_amount_promotion_rules"},`promotions/${o}/order_amount_promotion_rule`,r,e)}async sku_list_promotion_rule(t,r,e){const o=t.id||t;return this.resources.fetch({type:"sku_list_promotion_rules"},`promotions/${o}/sku_list_promotion_rule`,r,e)}async coupon_codes_promotion_rule(t,r,e){const o=t.id||t;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`promotions/${o}/coupon_codes_promotion_rule`,r,e)}async attachments(t,r,e){const o=t.id||t;return this.resources.fetch({type:"attachments"},`promotions/${o}/attachments`,r,e)}isPromotion(t){return t.type&&t.type===s.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:s.TYPE}:{id:t.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="promotions";export default s;
1
+ import { ApiResource } from '../resource';
2
+ class Promotions extends ApiResource {
3
+ // static readonly PATH = 'promotions'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Promotions.TYPE }, params, options);
6
+ }
7
+ async retrieve(id, params, options) {
8
+ return this.resources.retrieve({ type: Promotions.TYPE, id }, params, options);
9
+ }
10
+ async market(promotionId, params, options) {
11
+ const _promotionId = promotionId.id || promotionId;
12
+ return this.resources.fetch({ type: 'markets' }, `promotions/${_promotionId}/market`, params, options);
13
+ }
14
+ async order_amount_promotion_rule(promotionId, params, options) {
15
+ const _promotionId = promotionId.id || promotionId;
16
+ return this.resources.fetch({ type: 'order_amount_promotion_rules' }, `promotions/${_promotionId}/order_amount_promotion_rule`, params, options);
17
+ }
18
+ async sku_list_promotion_rule(promotionId, params, options) {
19
+ const _promotionId = promotionId.id || promotionId;
20
+ return this.resources.fetch({ type: 'sku_list_promotion_rules' }, `promotions/${_promotionId}/sku_list_promotion_rule`, params, options);
21
+ }
22
+ async coupon_codes_promotion_rule(promotionId, params, options) {
23
+ const _promotionId = promotionId.id || promotionId;
24
+ return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
25
+ }
26
+ async attachments(promotionId, params, options) {
27
+ const _promotionId = promotionId.id || promotionId;
28
+ return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
29
+ }
30
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
31
+ isPromotion(resource) {
32
+ return resource.type && (resource.type === Promotions.TYPE);
33
+ }
34
+ relationship(id) {
35
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Promotions.TYPE } : { id: id.id, type: Promotions.TYPE };
36
+ }
37
+ type() {
38
+ return Promotions.TYPE;
39
+ }
40
+ }
41
+ Promotions.TYPE = 'promotions';
42
+ export default Promotions;
@@ -1 +1,37 @@
1
- import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Capture}from'./captures';import type{Event}from'./events';type RefundRel=ResourceRel&{type:typeof Refunds.TYPE;};interface Refund extends Resource{number?:string;currency_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;succeeded?:boolean;message?:string;error_code?:string;error_detail?:string;token?:string;gateway_transaction_id?:string;order?:Order;reference_capture?:Capture;events?:Event[];}declare class Refunds extends ApiResource{static readonly TYPE:'refunds';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Refund>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Refund>;order(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;reference_capture(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Capture>;events(refundId:string|Refund,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;isRefund(resource:any):resource is Refund;relationship(id:string|ResourceId|null):RefundRel;type():string;}export default Refunds;export{Refund};
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Order } from './orders';
4
+ import type { Capture } from './captures';
5
+ import type { Event } from './events';
6
+ type RefundRel = ResourceRel & {
7
+ type: typeof Refunds.TYPE;
8
+ };
9
+ interface Refund extends Resource {
10
+ number?: string;
11
+ currency_code?: string;
12
+ amount_cents?: number;
13
+ amount_float?: number;
14
+ formatted_amount?: string;
15
+ succeeded?: boolean;
16
+ message?: string;
17
+ error_code?: string;
18
+ error_detail?: string;
19
+ token?: string;
20
+ gateway_transaction_id?: string;
21
+ order?: Order;
22
+ reference_capture?: Capture;
23
+ events?: Event[];
24
+ }
25
+ declare class Refunds extends ApiResource {
26
+ static readonly TYPE: 'refunds';
27
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
28
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
29
+ order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
30
+ reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
31
+ events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
32
+ isRefund(resource: any): resource is Refund;
33
+ relationship(id: string | ResourceId | null): RefundRel;
34
+ type(): string;
35
+ }
36
+ export default Refunds;
37
+ export { Refund };
@@ -1 +1,34 @@
1
- import{ApiResource as c}from"../resource";class t extends c{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 order(e,r,s){const n=e.id||e;return this.resources.fetch({type:"orders"},`refunds/${n}/order`,r,s)}async reference_capture(e,r,s){const n=e.id||e;return this.resources.fetch({type:"captures"},`refunds/${n}/reference_capture`,r,s)}async events(e,r,s){const n=e.id||e;return this.resources.fetch({type:"events"},`refunds/${n}/events`,r,s)}isRefund(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="refunds";export default t;
1
+ import { ApiResource } from '../resource';
2
+ class Refunds extends ApiResource {
3
+ // static readonly PATH = 'refunds'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Refunds.TYPE }, params, options);
6
+ }
7
+ async retrieve(id, params, options) {
8
+ return this.resources.retrieve({ type: Refunds.TYPE, id }, params, options);
9
+ }
10
+ async order(refundId, params, options) {
11
+ const _refundId = refundId.id || refundId;
12
+ return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
13
+ }
14
+ async reference_capture(refundId, params, options) {
15
+ const _refundId = refundId.id || refundId;
16
+ return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
17
+ }
18
+ async events(refundId, params, options) {
19
+ const _refundId = refundId.id || refundId;
20
+ return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
21
+ }
22
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
23
+ isRefund(resource) {
24
+ return resource.type && (resource.type === Refunds.TYPE);
25
+ }
26
+ relationship(id) {
27
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Refunds.TYPE } : { id: id.id, type: Refunds.TYPE };
28
+ }
29
+ type() {
30
+ return Refunds.TYPE;
31
+ }
32
+ }
33
+ Refunds.TYPE = 'refunds';
34
+ export default Refunds;
@@ -1 +1,49 @@
1
- import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Return}from'./returns';import type{LineItem}from'./line_items';type ReturnLineItemRel=ResourceRel&{type:typeof ReturnLineItems.TYPE;};type ReturnRel=ResourceRel&{type:'returns';};type LineItemRel=ResourceRel&{type:'line_items';};interface ReturnLineItem extends Resource{sku_code?:string;bundle_code?:string;name?:string;quantity?:number;return_reason?:object;restocked_at?:string;return?:Return;line_item?:LineItem;}interface ReturnLineItemCreate extends ResourceCreate{quantity:number;return_reason?:object;return:ReturnRel;line_item:LineItemRel;}interface ReturnLineItemUpdate extends ResourceUpdate{quantity?:number;_restock?:boolean;return_reason?:object;}declare class ReturnLineItems extends ApiResource{static readonly TYPE:'return_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;create(resource:ReturnLineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;update(resource:ReturnLineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;return(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;line_item(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;isReturnLineItem(resource:any):resource is ReturnLineItem;relationship(id:string|ResourceId|null):ReturnLineItemRel;type():string;}export default ReturnLineItems;export{ReturnLineItem,ReturnLineItemCreate,ReturnLineItemUpdate};
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Return } from './returns';
4
+ import type { LineItem } from './line_items';
5
+ type ReturnLineItemRel = ResourceRel & {
6
+ type: typeof ReturnLineItems.TYPE;
7
+ };
8
+ type ReturnRel = ResourceRel & {
9
+ type: 'returns';
10
+ };
11
+ type LineItemRel = ResourceRel & {
12
+ type: 'line_items';
13
+ };
14
+ interface ReturnLineItem extends Resource {
15
+ sku_code?: string;
16
+ bundle_code?: string;
17
+ name?: string;
18
+ quantity?: number;
19
+ return_reason?: object;
20
+ restocked_at?: string;
21
+ return?: Return;
22
+ line_item?: LineItem;
23
+ }
24
+ interface ReturnLineItemCreate extends ResourceCreate {
25
+ quantity: number;
26
+ return_reason?: object;
27
+ return: ReturnRel;
28
+ line_item: LineItemRel;
29
+ }
30
+ interface ReturnLineItemUpdate extends ResourceUpdate {
31
+ quantity?: number;
32
+ _restock?: boolean;
33
+ return_reason?: object;
34
+ }
35
+ declare class ReturnLineItems extends ApiResource {
36
+ static readonly TYPE: 'return_line_items';
37
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
38
+ create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
39
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
40
+ update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
41
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
42
+ return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
43
+ line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
44
+ isReturnLineItem(resource: any): resource is ReturnLineItem;
45
+ relationship(id: string | ResourceId | null): ReturnLineItemRel;
46
+ type(): string;
47
+ }
48
+ export default ReturnLineItems;
49
+ export { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate };
@@ -1 +1,39 @@
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 return(e,t,s){const i=e.id||e;return this.resources.fetch({type:"returns"},`return_line_items/${i}/return`,t,s)}async line_item(e,t,s){const i=e.id||e;return this.resources.fetch({type:"line_items"},`return_line_items/${i}/line_item`,t,s)}isReturnLineItem(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="return_line_items";export default r;
1
+ import { ApiResource } from '../resource';
2
+ class ReturnLineItems extends ApiResource {
3
+ // static readonly PATH = 'return_line_items'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
6
+ }
7
+ async create(resource, params, options) {
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: ReturnLineItems.TYPE, id }, params, options);
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: ReturnLineItems.TYPE }), params, options);
15
+ }
16
+ async delete(id, options) {
17
+ await this.resources.delete({ type: ReturnLineItems.TYPE, id }, options);
18
+ }
19
+ async return(returnLineItemId, params, options) {
20
+ const _returnLineItemId = returnLineItemId.id || returnLineItemId;
21
+ return this.resources.fetch({ type: 'returns' }, `return_line_items/${_returnLineItemId}/return`, params, options);
22
+ }
23
+ async line_item(returnLineItemId, params, options) {
24
+ const _returnLineItemId = returnLineItemId.id || returnLineItemId;
25
+ return this.resources.fetch({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
26
+ }
27
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
28
+ isReturnLineItem(resource) {
29
+ return resource.type && (resource.type === ReturnLineItems.TYPE);
30
+ }
31
+ relationship(id) {
32
+ return ((id === null) || (typeof id === 'string')) ? { id, type: ReturnLineItems.TYPE } : { id: id.id, type: ReturnLineItems.TYPE };
33
+ }
34
+ type() {
35
+ return ReturnLineItems.TYPE;
36
+ }
37
+ }
38
+ ReturnLineItems.TYPE = 'return_line_items';
39
+ export default ReturnLineItems;
@@ -1 +1,75 @@
1
- import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Customer}from'./customers';import type{StockLocation}from'./stock_locations';import type{Address}from'./addresses';import type{ReturnLineItem}from'./return_line_items';import type{Attachment}from'./attachments';import type{Event}from'./events';type ReturnRel=ResourceRel&{type:typeof Returns.TYPE;};type OrderRel=ResourceRel&{type:'orders';};type StockLocationRel=ResourceRel&{type:'stock_locations';};interface Return extends Resource{number?:string;status?:string;customer_email?:string;skus_count?:number;approved_at?:string;cancelled_at?:string;shipped_at?:string;rejected_at?:string;received_at?:string;archived_at?:string;order?:Order;customer?:Customer;stock_location?:StockLocation;origin_address?:Address;destination_address?:Address;return_line_items?:ReturnLineItem[];attachments?:Attachment[];events?:Event[];}interface ReturnCreate extends ResourceCreate{order:OrderRel;stock_location?:StockLocationRel;}interface ReturnUpdate extends ResourceUpdate{_request?:boolean;_approve?:boolean;_cancel?:boolean;_ship?:boolean;_reject?:boolean;_receive?:boolean;_restock?:boolean;_archive?:boolean;_unarchive?:boolean;stock_location?:StockLocationRel;}declare class Returns extends ApiResource{static readonly TYPE:'returns';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Return>>;create(resource:ReturnCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;update(resource:ReturnUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;customer(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;stock_location(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;origin_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;destination_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;return_line_items(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;attachments(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;isReturn(resource:any):resource is Return;relationship(id:string|ResourceId|null):ReturnRel;type():string;}export default Returns;export{Return,ReturnCreate,ReturnUpdate};
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Order } from './orders';
4
+ import type { Customer } from './customers';
5
+ import type { StockLocation } from './stock_locations';
6
+ import type { Address } from './addresses';
7
+ import type { ReturnLineItem } from './return_line_items';
8
+ import type { Attachment } from './attachments';
9
+ import type { Event } from './events';
10
+ type ReturnRel = ResourceRel & {
11
+ type: typeof Returns.TYPE;
12
+ };
13
+ type OrderRel = ResourceRel & {
14
+ type: 'orders';
15
+ };
16
+ type StockLocationRel = ResourceRel & {
17
+ type: 'stock_locations';
18
+ };
19
+ interface Return extends Resource {
20
+ number?: string;
21
+ status?: string;
22
+ customer_email?: string;
23
+ skus_count?: number;
24
+ approved_at?: string;
25
+ cancelled_at?: string;
26
+ shipped_at?: string;
27
+ rejected_at?: string;
28
+ received_at?: string;
29
+ archived_at?: string;
30
+ order?: Order;
31
+ customer?: Customer;
32
+ stock_location?: StockLocation;
33
+ origin_address?: Address;
34
+ destination_address?: Address;
35
+ return_line_items?: ReturnLineItem[];
36
+ attachments?: Attachment[];
37
+ events?: Event[];
38
+ }
39
+ interface ReturnCreate extends ResourceCreate {
40
+ order: OrderRel;
41
+ stock_location?: StockLocationRel;
42
+ }
43
+ interface ReturnUpdate extends ResourceUpdate {
44
+ _request?: boolean;
45
+ _approve?: boolean;
46
+ _cancel?: boolean;
47
+ _ship?: boolean;
48
+ _reject?: boolean;
49
+ _receive?: boolean;
50
+ _restock?: boolean;
51
+ _archive?: boolean;
52
+ _unarchive?: boolean;
53
+ stock_location?: StockLocationRel;
54
+ }
55
+ declare class Returns extends ApiResource {
56
+ static readonly TYPE: 'returns';
57
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
58
+ create(resource: ReturnCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
59
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
60
+ update(resource: ReturnUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
61
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
62
+ order(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
63
+ customer(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
64
+ stock_location(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
65
+ origin_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
66
+ destination_address(returnId: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
67
+ return_line_items(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
68
+ attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
69
+ events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
70
+ isReturn(resource: any): resource is Return;
71
+ relationship(id: string | ResourceId | null): ReturnRel;
72
+ type(): string;
73
+ }
74
+ export default Returns;
75
+ export { Return, ReturnCreate, ReturnUpdate };
@@ -1 +1,63 @@
1
- import{ApiResource as c}from"../resource";class n extends c{async list(e,t){return this.resources.list({type:n.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:n.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:n.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:n.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:n.TYPE,id:e},t)}async order(e,t,s){const r=e.id||e;return this.resources.fetch({type:"orders"},`returns/${r}/order`,t,s)}async customer(e,t,s){const r=e.id||e;return this.resources.fetch({type:"customers"},`returns/${r}/customer`,t,s)}async stock_location(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_locations"},`returns/${r}/stock_location`,t,s)}async origin_address(e,t,s){const r=e.id||e;return this.resources.fetch({type:"addresses"},`returns/${r}/origin_address`,t,s)}async destination_address(e,t,s){const r=e.id||e;return this.resources.fetch({type:"addresses"},`returns/${r}/destination_address`,t,s)}async return_line_items(e,t,s){const r=e.id||e;return this.resources.fetch({type:"return_line_items"},`returns/${r}/return_line_items`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`returns/${r}/attachments`,t,s)}async events(e,t,s){const r=e.id||e;return this.resources.fetch({type:"events"},`returns/${r}/events`,t,s)}isReturn(e){return e.type&&e.type===n.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:n.TYPE}:{id:e.id,type:n.TYPE}}type(){return n.TYPE}}n.TYPE="returns";export default n;
1
+ import { ApiResource } from '../resource';
2
+ class Returns extends ApiResource {
3
+ // static readonly PATH = 'returns'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Returns.TYPE }, params, options);
6
+ }
7
+ async create(resource, params, options) {
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: Returns.TYPE, id }, params, options);
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: Returns.TYPE }), params, options);
15
+ }
16
+ async delete(id, options) {
17
+ await this.resources.delete({ type: Returns.TYPE, id }, options);
18
+ }
19
+ async order(returnId, params, options) {
20
+ const _returnId = returnId.id || returnId;
21
+ return this.resources.fetch({ type: 'orders' }, `returns/${_returnId}/order`, params, options);
22
+ }
23
+ async customer(returnId, params, options) {
24
+ const _returnId = returnId.id || returnId;
25
+ return this.resources.fetch({ type: 'customers' }, `returns/${_returnId}/customer`, params, options);
26
+ }
27
+ async stock_location(returnId, params, options) {
28
+ const _returnId = returnId.id || returnId;
29
+ return this.resources.fetch({ type: 'stock_locations' }, `returns/${_returnId}/stock_location`, params, options);
30
+ }
31
+ async origin_address(returnId, params, options) {
32
+ const _returnId = returnId.id || returnId;
33
+ return this.resources.fetch({ type: 'addresses' }, `returns/${_returnId}/origin_address`, params, options);
34
+ }
35
+ async destination_address(returnId, params, options) {
36
+ const _returnId = returnId.id || returnId;
37
+ return this.resources.fetch({ type: 'addresses' }, `returns/${_returnId}/destination_address`, params, options);
38
+ }
39
+ async return_line_items(returnId, params, options) {
40
+ const _returnId = returnId.id || returnId;
41
+ return this.resources.fetch({ type: 'return_line_items' }, `returns/${_returnId}/return_line_items`, params, options);
42
+ }
43
+ async attachments(returnId, params, options) {
44
+ const _returnId = returnId.id || returnId;
45
+ return this.resources.fetch({ type: 'attachments' }, `returns/${_returnId}/attachments`, params, options);
46
+ }
47
+ async events(returnId, params, options) {
48
+ const _returnId = returnId.id || returnId;
49
+ return this.resources.fetch({ type: 'events' }, `returns/${_returnId}/events`, params, options);
50
+ }
51
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
52
+ isReturn(resource) {
53
+ return resource.type && (resource.type === Returns.TYPE);
54
+ }
55
+ relationship(id) {
56
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Returns.TYPE } : { id: id.id, type: Returns.TYPE };
57
+ }
58
+ type() {
59
+ return Returns.TYPE;
60
+ }
61
+ }
62
+ Returns.TYPE = 'returns';
63
+ export default Returns;
@@ -1 +1,93 @@
1
- import{ApiResource,Resource,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{ShippingCategory}from'./shipping_categories';import type{StockLocation}from'./stock_locations';import type{Address}from'./addresses';import type{ShippingMethod}from'./shipping_methods';import type{DeliveryLeadTime}from'./delivery_lead_times';import type{StockLineItem}from'./stock_line_items';import type{StockTransfer}from'./stock_transfers';import type{CarrierAccount}from'./carrier_accounts';import type{Parcel}from'./parcels';import type{Attachment}from'./attachments';import type{Event}from'./events';type ShipmentRel=ResourceRel&{type:typeof Shipments.TYPE;};type ShippingMethodRel=ResourceRel&{type:'shipping_methods';};interface Shipment extends Resource{number?:string;status?:string;currency_code?:string;cost_amount_cents?:number;cost_amount_float?:number;formatted_cost_amount?:string;skus_count?:number;selected_rate_id?:string;rates?:object[];purchase_error_code?:string;purchase_error_message?:string;get_rates_errors?:object[];get_rates_started_at?:string;get_rates_completed_at?:string;purchase_started_at?:string;purchase_completed_at?:string;purchase_failed_at?:string;order?:Order;shipping_category?:ShippingCategory;stock_location?:StockLocation;origin_address?:Address;shipping_address?:Address;shipping_method?:ShippingMethod;delivery_lead_time?:DeliveryLeadTime;shipment_line_items?:object[];stock_line_items?:StockLineItem[];stock_transfers?:StockTransfer[];available_shipping_methods?:ShippingMethod[];carrier_accounts?:CarrierAccount[];parcels?:Parcel[];attachments?:Attachment[];events?:Event[];}interface ShipmentUpdate extends ResourceUpdate{_on_hold?:boolean;_picking?:boolean;_packing?:boolean;_ready_to_ship?:boolean;_ship?:boolean;_get_rates?:boolean;selected_rate_id?:string;_purchase?:boolean;shipping_method?:ShippingMethodRel;}declare class Shipments extends ApiResource{static readonly TYPE:'shipments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Shipment>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;update(resource:ShipmentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;order(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;shipping_category(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;stock_location(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;origin_address(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;shipping_address(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;shipping_method(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;delivery_lead_time(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;stock_line_items(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockLineItem>>;stock_transfers(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockTransfer>>;available_shipping_methods(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ShippingMethod>>;carrier_accounts(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CarrierAccount>>;parcels(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Parcel>>;attachments(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;isShipment(resource:any):resource is Shipment;relationship(id:string|ResourceId|null):ShipmentRel;type():string;}export default Shipments;export{Shipment,ShipmentUpdate};
1
+ import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Order } from './orders';
4
+ import type { ShippingCategory } from './shipping_categories';
5
+ import type { StockLocation } from './stock_locations';
6
+ import type { Address } from './addresses';
7
+ import type { ShippingMethod } from './shipping_methods';
8
+ import type { DeliveryLeadTime } from './delivery_lead_times';
9
+ import type { StockLineItem } from './stock_line_items';
10
+ import type { StockTransfer } from './stock_transfers';
11
+ import type { CarrierAccount } from './carrier_accounts';
12
+ import type { Parcel } from './parcels';
13
+ import type { Attachment } from './attachments';
14
+ import type { Event } from './events';
15
+ type ShipmentRel = ResourceRel & {
16
+ type: typeof Shipments.TYPE;
17
+ };
18
+ type ShippingMethodRel = ResourceRel & {
19
+ type: 'shipping_methods';
20
+ };
21
+ interface Shipment extends Resource {
22
+ number?: string;
23
+ status?: string;
24
+ currency_code?: string;
25
+ cost_amount_cents?: number;
26
+ cost_amount_float?: number;
27
+ formatted_cost_amount?: string;
28
+ skus_count?: number;
29
+ selected_rate_id?: string;
30
+ rates?: object[];
31
+ purchase_error_code?: string;
32
+ purchase_error_message?: string;
33
+ get_rates_errors?: object[];
34
+ get_rates_started_at?: string;
35
+ get_rates_completed_at?: string;
36
+ purchase_started_at?: string;
37
+ purchase_completed_at?: string;
38
+ purchase_failed_at?: string;
39
+ order?: Order;
40
+ shipping_category?: ShippingCategory;
41
+ stock_location?: StockLocation;
42
+ origin_address?: Address;
43
+ shipping_address?: Address;
44
+ shipping_method?: ShippingMethod;
45
+ delivery_lead_time?: DeliveryLeadTime;
46
+ /**
47
+ * @deprecated This field should not be used as it may be removed in the future without notice
48
+ */
49
+ shipment_line_items?: object[];
50
+ stock_line_items?: StockLineItem[];
51
+ stock_transfers?: StockTransfer[];
52
+ available_shipping_methods?: ShippingMethod[];
53
+ carrier_accounts?: CarrierAccount[];
54
+ parcels?: Parcel[];
55
+ attachments?: Attachment[];
56
+ events?: Event[];
57
+ }
58
+ interface ShipmentUpdate extends ResourceUpdate {
59
+ _on_hold?: boolean;
60
+ _picking?: boolean;
61
+ _packing?: boolean;
62
+ _ready_to_ship?: boolean;
63
+ _ship?: boolean;
64
+ _get_rates?: boolean;
65
+ selected_rate_id?: string;
66
+ _purchase?: boolean;
67
+ shipping_method?: ShippingMethodRel;
68
+ }
69
+ declare class Shipments extends ApiResource {
70
+ static readonly TYPE: 'shipments';
71
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
72
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
73
+ update(resource: ShipmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
74
+ order(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
75
+ shipping_category(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
76
+ stock_location(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
77
+ origin_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
78
+ shipping_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
79
+ shipping_method(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
80
+ delivery_lead_time(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
81
+ stock_line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
82
+ stock_transfers(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
83
+ available_shipping_methods(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
84
+ carrier_accounts(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
85
+ parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
86
+ attachments(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
87
+ events(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
88
+ isShipment(resource: any): resource is Shipment;
89
+ relationship(id: string | ResourceId | null): ShipmentRel;
90
+ type(): string;
91
+ }
92
+ export default Shipments;
93
+ export { Shipment, ShipmentUpdate };
@@ -1 +1,81 @@
1
- import{ApiResource as n}from"../resource";class i extends n{async list(s,e){return this.resources.list({type:i.TYPE},s,e)}async retrieve(s,e,t){return this.resources.retrieve({type:i.TYPE,id:s},e,t)}async update(s,e,t){return this.resources.update(Object.assign(Object.assign({},s),{type:i.TYPE}),e,t)}async order(s,e,t){const r=s.id||s;return this.resources.fetch({type:"orders"},`shipments/${r}/order`,e,t)}async shipping_category(s,e,t){const r=s.id||s;return this.resources.fetch({type:"shipping_categories"},`shipments/${r}/shipping_category`,e,t)}async stock_location(s,e,t){const r=s.id||s;return this.resources.fetch({type:"stock_locations"},`shipments/${r}/stock_location`,e,t)}async origin_address(s,e,t){const r=s.id||s;return this.resources.fetch({type:"addresses"},`shipments/${r}/origin_address`,e,t)}async shipping_address(s,e,t){const r=s.id||s;return this.resources.fetch({type:"addresses"},`shipments/${r}/shipping_address`,e,t)}async shipping_method(s,e,t){const r=s.id||s;return this.resources.fetch({type:"shipping_methods"},`shipments/${r}/shipping_method`,e,t)}async delivery_lead_time(s,e,t){const r=s.id||s;return this.resources.fetch({type:"delivery_lead_times"},`shipments/${r}/delivery_lead_time`,e,t)}async stock_line_items(s,e,t){const r=s.id||s;return this.resources.fetch({type:"stock_line_items"},`shipments/${r}/stock_line_items`,e,t)}async stock_transfers(s,e,t){const r=s.id||s;return this.resources.fetch({type:"stock_transfers"},`shipments/${r}/stock_transfers`,e,t)}async available_shipping_methods(s,e,t){const r=s.id||s;return this.resources.fetch({type:"shipping_methods"},`shipments/${r}/available_shipping_methods`,e,t)}async carrier_accounts(s,e,t){const r=s.id||s;return this.resources.fetch({type:"carrier_accounts"},`shipments/${r}/carrier_accounts`,e,t)}async parcels(s,e,t){const r=s.id||s;return this.resources.fetch({type:"parcels"},`shipments/${r}/parcels`,e,t)}async attachments(s,e,t){const r=s.id||s;return this.resources.fetch({type:"attachments"},`shipments/${r}/attachments`,e,t)}async events(s,e,t){const r=s.id||s;return this.resources.fetch({type:"events"},`shipments/${r}/events`,e,t)}isShipment(s){return s.type&&s.type===i.TYPE}relationship(s){return s===null||typeof s=="string"?{id:s,type:i.TYPE}:{id:s.id,type:i.TYPE}}type(){return i.TYPE}}i.TYPE="shipments";export default i;
1
+ import { ApiResource } from '../resource';
2
+ class Shipments extends ApiResource {
3
+ // static readonly PATH = 'shipments'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Shipments.TYPE }, params, options);
6
+ }
7
+ async retrieve(id, params, options) {
8
+ return this.resources.retrieve({ type: Shipments.TYPE, id }, params, options);
9
+ }
10
+ async update(resource, params, options) {
11
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: Shipments.TYPE }), params, options);
12
+ }
13
+ async order(shipmentId, params, options) {
14
+ const _shipmentId = shipmentId.id || shipmentId;
15
+ return this.resources.fetch({ type: 'orders' }, `shipments/${_shipmentId}/order`, params, options);
16
+ }
17
+ async shipping_category(shipmentId, params, options) {
18
+ const _shipmentId = shipmentId.id || shipmentId;
19
+ return this.resources.fetch({ type: 'shipping_categories' }, `shipments/${_shipmentId}/shipping_category`, params, options);
20
+ }
21
+ async stock_location(shipmentId, params, options) {
22
+ const _shipmentId = shipmentId.id || shipmentId;
23
+ return this.resources.fetch({ type: 'stock_locations' }, `shipments/${_shipmentId}/stock_location`, params, options);
24
+ }
25
+ async origin_address(shipmentId, params, options) {
26
+ const _shipmentId = shipmentId.id || shipmentId;
27
+ return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/origin_address`, params, options);
28
+ }
29
+ async shipping_address(shipmentId, params, options) {
30
+ const _shipmentId = shipmentId.id || shipmentId;
31
+ return this.resources.fetch({ type: 'addresses' }, `shipments/${_shipmentId}/shipping_address`, params, options);
32
+ }
33
+ async shipping_method(shipmentId, params, options) {
34
+ const _shipmentId = shipmentId.id || shipmentId;
35
+ return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/shipping_method`, params, options);
36
+ }
37
+ async delivery_lead_time(shipmentId, params, options) {
38
+ const _shipmentId = shipmentId.id || shipmentId;
39
+ return this.resources.fetch({ type: 'delivery_lead_times' }, `shipments/${_shipmentId}/delivery_lead_time`, params, options);
40
+ }
41
+ async stock_line_items(shipmentId, params, options) {
42
+ const _shipmentId = shipmentId.id || shipmentId;
43
+ return this.resources.fetch({ type: 'stock_line_items' }, `shipments/${_shipmentId}/stock_line_items`, params, options);
44
+ }
45
+ async stock_transfers(shipmentId, params, options) {
46
+ const _shipmentId = shipmentId.id || shipmentId;
47
+ return this.resources.fetch({ type: 'stock_transfers' }, `shipments/${_shipmentId}/stock_transfers`, params, options);
48
+ }
49
+ async available_shipping_methods(shipmentId, params, options) {
50
+ const _shipmentId = shipmentId.id || shipmentId;
51
+ return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/available_shipping_methods`, params, options);
52
+ }
53
+ async carrier_accounts(shipmentId, params, options) {
54
+ const _shipmentId = shipmentId.id || shipmentId;
55
+ return this.resources.fetch({ type: 'carrier_accounts' }, `shipments/${_shipmentId}/carrier_accounts`, params, options);
56
+ }
57
+ async parcels(shipmentId, params, options) {
58
+ const _shipmentId = shipmentId.id || shipmentId;
59
+ return this.resources.fetch({ type: 'parcels' }, `shipments/${_shipmentId}/parcels`, params, options);
60
+ }
61
+ async attachments(shipmentId, params, options) {
62
+ const _shipmentId = shipmentId.id || shipmentId;
63
+ return this.resources.fetch({ type: 'attachments' }, `shipments/${_shipmentId}/attachments`, params, options);
64
+ }
65
+ async events(shipmentId, params, options) {
66
+ const _shipmentId = shipmentId.id || shipmentId;
67
+ return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
68
+ }
69
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
70
+ isShipment(resource) {
71
+ return resource.type && (resource.type === Shipments.TYPE);
72
+ }
73
+ relationship(id) {
74
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Shipments.TYPE } : { id: id.id, type: Shipments.TYPE };
75
+ }
76
+ type() {
77
+ return Shipments.TYPE;
78
+ }
79
+ }
80
+ Shipments.TYPE = 'shipments';
81
+ export default Shipments;