@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,23 @@
1
- import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';type OrderValidationRuleRel=ResourceRel&{type:typeof OrderValidationRules.TYPE;};interface OrderValidationRule extends Resource{market?:Market;}declare class OrderValidationRules extends ApiResource{static readonly TYPE:'order_validation_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderValidationRule>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderValidationRule>;market(orderValidationRuleId:string|OrderValidationRule,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;isOrderValidationRule(resource:any):resource is OrderValidationRule;relationship(id:string|ResourceId|null):OrderValidationRuleRel;type():string;}export default OrderValidationRules;export{OrderValidationRule};
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 { Attachment } from './attachments';
5
+ type OrderValidationRuleRel = ResourceRel & {
6
+ type: typeof OrderValidationRules.TYPE;
7
+ };
8
+ interface OrderValidationRule extends Resource {
9
+ market?: Market;
10
+ attachments?: Attachment[];
11
+ }
12
+ declare class OrderValidationRules extends ApiResource {
13
+ static readonly TYPE: 'order_validation_rules';
14
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderValidationRule>>;
15
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderValidationRule>;
16
+ market(orderValidationRuleId: string | OrderValidationRule, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
17
+ attachments(orderValidationRuleId: string | OrderValidationRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
18
+ isOrderValidationRule(resource: any): resource is OrderValidationRule;
19
+ relationship(id: string | ResourceId | null): OrderValidationRuleRel;
20
+ type(): string;
21
+ }
22
+ export default OrderValidationRules;
23
+ export { OrderValidationRule };
@@ -1 +1,30 @@
1
- import{ApiResource as n}from"../resource";class t extends n{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 market(e,r,s){const i=e.id||e;return this.resources.fetch({type:"markets"},`order_validation_rules/${i}/market`,r,s)}isOrderValidationRule(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="order_validation_rules";export default t;
1
+ import { ApiResource } from '../resource';
2
+ class OrderValidationRules extends ApiResource {
3
+ // static readonly PATH = 'order_validation_rules'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: OrderValidationRules.TYPE }, params, options);
6
+ }
7
+ async retrieve(id, params, options) {
8
+ return this.resources.retrieve({ type: OrderValidationRules.TYPE, id }, params, options);
9
+ }
10
+ async market(orderValidationRuleId, params, options) {
11
+ const _orderValidationRuleId = orderValidationRuleId.id || orderValidationRuleId;
12
+ return this.resources.fetch({ type: 'markets' }, `order_validation_rules/${_orderValidationRuleId}/market`, params, options);
13
+ }
14
+ async attachments(orderValidationRuleId, params, options) {
15
+ const _orderValidationRuleId = orderValidationRuleId.id || orderValidationRuleId;
16
+ return this.resources.fetch({ type: 'attachments' }, `order_validation_rules/${_orderValidationRuleId}/attachments`, params, options);
17
+ }
18
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
19
+ isOrderValidationRule(resource) {
20
+ return resource.type && (resource.type === OrderValidationRules.TYPE);
21
+ }
22
+ relationship(id) {
23
+ return ((id === null) || (typeof id === 'string')) ? { id, type: OrderValidationRules.TYPE } : { id: id.id, type: OrderValidationRules.TYPE };
24
+ }
25
+ type() {
26
+ return OrderValidationRules.TYPE;
27
+ }
28
+ }
29
+ OrderValidationRules.TYPE = 'order_validation_rules';
30
+ export default OrderValidationRules;
@@ -1 +1,288 @@
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{Customer}from'./customers';import type{Address}from'./addresses';import type{PaymentMethod}from'./payment_methods';import type{CustomerPaymentSource}from'./customer_payment_sources';import type{Sku}from'./skus';import type{Bundle}from'./bundles';import type{AdyenPayment}from'./adyen_payments';import type{BraintreePayment}from'./braintree_payments';import type{CheckoutComPayment}from'./checkout_com_payments';import type{ExternalPayment}from'./external_payments';import type{KlarnaPayment}from'./klarna_payments';import type{PaypalPayment}from'./paypal_payments';import type{StripePayment}from'./stripe_payments';import type{WireTransfer}from'./wire_transfers';import type{LineItem}from'./line_items';import type{Shipment}from'./shipments';import type{Authorization}from'./authorizations';import type{Void}from'./voids';import type{Capture}from'./captures';import type{Refund}from'./refunds';import type{OrderSubscription}from'./order_subscriptions';import type{OrderCopy}from'./order_copies';import type{Attachment}from'./attachments';import type{Event}from'./events';type OrderRel=ResourceRel&{type:typeof Orders.TYPE;};type MarketRel=ResourceRel&{type:'markets';};type CustomerRel=ResourceRel&{type:'customers';};type AddressRel=ResourceRel&{type:'addresses';};type PaymentMethodRel=ResourceRel&{type:'payment_methods';};type AdyenPaymentRel=ResourceRel&{type:'adyen_payments';};type BraintreePaymentRel=ResourceRel&{type:'braintree_payments';};type CheckoutComPaymentRel=ResourceRel&{type:'checkout_com_payments';};type ExternalPaymentRel=ResourceRel&{type:'external_payments';};type KlarnaPaymentRel=ResourceRel&{type:'klarna_payments';};type PaypalPaymentRel=ResourceRel&{type:'paypal_payments';};type StripePaymentRel=ResourceRel&{type:'stripe_payments';};type WireTransferRel=ResourceRel&{type:'wire_transfers';};interface Order extends Resource{number?:number;autorefresh?:boolean;status?:string;payment_status?:string;fulfillment_status?:string;guest?:boolean;editable?:boolean;customer_email?:string;language_code?:string;currency_code?:string;tax_included?:boolean;tax_rate?:number;freight_taxable?:boolean;requires_billing_info?:boolean;country_code?:string;shipping_country_code_lock?:string;coupon_code?:string;gift_card_code?:string;gift_card_or_coupon_code?:string;subtotal_amount_cents?:number;subtotal_amount_float?:number;formatted_subtotal_amount?:string;shipping_amount_cents?:number;shipping_amount_float?:number;formatted_shipping_amount?:string;payment_method_amount_cents?:number;payment_method_amount_float?:number;formatted_payment_method_amount?:string;discount_amount_cents?:number;discount_amount_float?:number;formatted_discount_amount?:string;adjustment_amount_cents?:number;adjustment_amount_float?:number;formatted_adjustment_amount?:string;gift_card_amount_cents?:number;gift_card_amount_float?:number;formatted_gift_card_amount?:string;total_tax_amount_cents?:number;total_tax_amount_float?:number;formatted_total_tax_amount?:string;subtotal_tax_amount_cents?:number;subtotal_tax_amount_float?:number;formatted_subtotal_tax_amount?:string;shipping_tax_amount_cents?:number;shipping_tax_amount_float?:number;formatted_shipping_tax_amount?:string;payment_method_tax_amount_cents?:number;payment_method_tax_amount_float?:number;formatted_payment_method_tax_amount?:string;adjustment_tax_amount_cents?:number;adjustment_tax_amount_float?:number;formatted_adjustment_tax_amount?:string;total_amount_cents?:number;total_amount_float?:number;formatted_total_amount?:string;total_taxable_amount_cents?:number;total_taxable_amount_float?:number;formatted_total_taxable_amount?:string;subtotal_taxable_amount_cents?:number;subtotal_taxable_amount_float?:number;formatted_subtotal_taxable_amount?:string;shipping_taxable_amount_cents?:number;shipping_taxable_amount_float?:number;formatted_shipping_taxable_amount?:string;payment_method_taxable_amount_cents?:number;payment_method_taxable_amount_float?:number;formatted_payment_method_taxable_amount?:string;adjustment_taxable_amount_cents?:number;adjustment_taxable_amount_float?:number;formatted_adjustment_taxable_amount?:string;total_amount_with_taxes_cents?:number;total_amount_with_taxes_float?:number;formatted_total_amount_with_taxes?:string;fees_amount_cents?:number;fees_amount_float?:number;formatted_fees_amount?:string;duty_amount_cents?:number;duty_amount_float?:number;formatted_duty_amount?:string;skus_count?:number;line_item_options_count?:number;shipments_count?:number;tax_calculations_count?:number;payment_source_details?:object;token?:string;cart_url?:string;return_url?:string;terms_url?:string;privacy_url?:string;checkout_url?:string;placed_at?:string;approved_at?:string;cancelled_at?:string;payment_updated_at?:string;fulfillment_updated_at?:string;refreshed_at?:string;archived_at?:string;expires_at?:string;market?:Market;customer?:Customer;shipping_address?:Address;billing_address?:Address;available_payment_methods?:PaymentMethod[];available_customer_payment_sources?:CustomerPaymentSource[];available_free_skus?:Sku[];available_free_bundles?:Bundle[];payment_method?:PaymentMethod;payment_source?:AdyenPayment|BraintreePayment|CheckoutComPayment|ExternalPayment|KlarnaPayment|PaypalPayment|StripePayment|WireTransfer;line_items?:LineItem[];shipments?:Shipment[];transactions?:Array<Authorization|Void|Capture|Refund>;authorizations?:Authorization[];captures?:Capture[];voids?:Void[];refunds?:Refund[];order_subscriptions?:OrderSubscription[];order_copies?:OrderCopy[];attachments?:Attachment[];events?:Event[];}interface OrderCreate extends ResourceCreate{autorefresh?:boolean;guest?:boolean;customer_email?:string;customer_password?:string;language_code?:string;shipping_country_code_lock?:string;coupon_code?:string;gift_card_code?:string;gift_card_or_coupon_code?:string;cart_url?:string;return_url?:string;terms_url?:string;privacy_url?:string;market?:MarketRel;customer?:CustomerRel;shipping_address?:AddressRel;billing_address?:AddressRel;payment_method?:PaymentMethodRel;payment_source?:AdyenPaymentRel|BraintreePaymentRel|CheckoutComPaymentRel|ExternalPaymentRel|KlarnaPaymentRel|PaypalPaymentRel|StripePaymentRel|WireTransferRel;}interface OrderUpdate extends ResourceUpdate{autorefresh?:boolean;guest?:boolean;customer_email?:string;customer_password?:string;language_code?:string;shipping_country_code_lock?:string;coupon_code?:string;gift_card_code?:string;gift_card_or_coupon_code?:string;cart_url?:string;return_url?:string;terms_url?:string;privacy_url?:string;_archive?:boolean;_unarchive?:boolean;_place?:boolean;_cancel?:boolean;_approve?:boolean;_approve_and_capture?:boolean;_authorize?:boolean;_authorization_amount_cents?:number;_capture?:boolean;_refund?:boolean;_update_taxes?:boolean;_nullify_payment_source?:boolean;_billing_address_clone_id?:string;_shipping_address_clone_id?:string;_customer_payment_source_id?:string;_shipping_address_same_as_billing?:boolean;_billing_address_same_as_shipping?:boolean;_commit_invoice?:boolean;_refund_invoice?:boolean;_save_payment_source_to_customer_wallet?:boolean;_save_shipping_address_to_customer_address_book?:boolean;_save_billing_address_to_customer_address_book?:boolean;_refresh?:boolean;market?:MarketRel;customer?:CustomerRel;shipping_address?:AddressRel;billing_address?:AddressRel;payment_method?:PaymentMethodRel;payment_source?:AdyenPaymentRel|BraintreePaymentRel|CheckoutComPaymentRel|ExternalPaymentRel|KlarnaPaymentRel|PaypalPaymentRel|StripePaymentRel|WireTransferRel;}declare class Orders extends ApiResource{static readonly TYPE:'orders';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Order>>;create(resource:OrderCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;update(resource:OrderUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(orderId:string|Order,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;customer(orderId:string|Order,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;shipping_address(orderId:string|Order,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;billing_address(orderId:string|Order,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;available_payment_methods(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;available_customer_payment_sources(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerPaymentSource>>;available_free_skus(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;available_free_bundles(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Bundle>>;payment_method(orderId:string|Order,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;line_items(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<LineItem>>;shipments(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Shipment>>;authorizations(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Authorization>>;captures(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Capture>>;voids(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Void>>;refunds(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Refund>>;order_subscriptions(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderSubscription>>;order_copies(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderCopy>>;attachments(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;events(orderId:string|Order,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Event>>;isOrder(resource:any):resource is Order;relationship(id:string|ResourceId|null):OrderRel;type():string;}export default Orders;export{Order,OrderCreate,OrderUpdate};
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 { Customer } from './customers';
5
+ import type { Address } from './addresses';
6
+ import type { PaymentMethod } from './payment_methods';
7
+ import type { CustomerPaymentSource } from './customer_payment_sources';
8
+ import type { Sku } from './skus';
9
+ import type { Bundle } from './bundles';
10
+ import type { AdyenPayment } from './adyen_payments';
11
+ import type { BraintreePayment } from './braintree_payments';
12
+ import type { CheckoutComPayment } from './checkout_com_payments';
13
+ import type { ExternalPayment } from './external_payments';
14
+ import type { KlarnaPayment } from './klarna_payments';
15
+ import type { PaypalPayment } from './paypal_payments';
16
+ import type { StripePayment } from './stripe_payments';
17
+ import type { WireTransfer } from './wire_transfers';
18
+ import type { LineItem } from './line_items';
19
+ import type { Shipment } from './shipments';
20
+ import type { Authorization } from './authorizations';
21
+ import type { Void } from './voids';
22
+ import type { Capture } from './captures';
23
+ import type { Refund } from './refunds';
24
+ import type { Return } from './returns';
25
+ import type { OrderSubscription } from './order_subscriptions';
26
+ import type { OrderCopy } from './order_copies';
27
+ import type { Attachment } from './attachments';
28
+ import type { Event } from './events';
29
+ type OrderRel = ResourceRel & {
30
+ type: typeof Orders.TYPE;
31
+ };
32
+ type MarketRel = ResourceRel & {
33
+ type: 'markets';
34
+ };
35
+ type CustomerRel = ResourceRel & {
36
+ type: 'customers';
37
+ };
38
+ type AddressRel = ResourceRel & {
39
+ type: 'addresses';
40
+ };
41
+ type PaymentMethodRel = ResourceRel & {
42
+ type: 'payment_methods';
43
+ };
44
+ type AdyenPaymentRel = ResourceRel & {
45
+ type: 'adyen_payments';
46
+ };
47
+ type BraintreePaymentRel = ResourceRel & {
48
+ type: 'braintree_payments';
49
+ };
50
+ type CheckoutComPaymentRel = ResourceRel & {
51
+ type: 'checkout_com_payments';
52
+ };
53
+ type ExternalPaymentRel = ResourceRel & {
54
+ type: 'external_payments';
55
+ };
56
+ type KlarnaPaymentRel = ResourceRel & {
57
+ type: 'klarna_payments';
58
+ };
59
+ type PaypalPaymentRel = ResourceRel & {
60
+ type: 'paypal_payments';
61
+ };
62
+ type StripePaymentRel = ResourceRel & {
63
+ type: 'stripe_payments';
64
+ };
65
+ type WireTransferRel = ResourceRel & {
66
+ type: 'wire_transfers';
67
+ };
68
+ interface Order extends Resource {
69
+ number?: number;
70
+ autorefresh?: boolean;
71
+ status?: string;
72
+ payment_status?: string;
73
+ fulfillment_status?: string;
74
+ guest?: boolean;
75
+ editable?: boolean;
76
+ customer_email?: string;
77
+ language_code?: string;
78
+ currency_code?: string;
79
+ tax_included?: boolean;
80
+ tax_rate?: number;
81
+ freight_taxable?: boolean;
82
+ requires_billing_info?: boolean;
83
+ country_code?: string;
84
+ shipping_country_code_lock?: string;
85
+ coupon_code?: string;
86
+ gift_card_code?: string;
87
+ gift_card_or_coupon_code?: string;
88
+ subtotal_amount_cents?: number;
89
+ subtotal_amount_float?: number;
90
+ formatted_subtotal_amount?: string;
91
+ shipping_amount_cents?: number;
92
+ shipping_amount_float?: number;
93
+ formatted_shipping_amount?: string;
94
+ payment_method_amount_cents?: number;
95
+ payment_method_amount_float?: number;
96
+ formatted_payment_method_amount?: string;
97
+ discount_amount_cents?: number;
98
+ discount_amount_float?: number;
99
+ formatted_discount_amount?: string;
100
+ adjustment_amount_cents?: number;
101
+ adjustment_amount_float?: number;
102
+ formatted_adjustment_amount?: string;
103
+ gift_card_amount_cents?: number;
104
+ gift_card_amount_float?: number;
105
+ formatted_gift_card_amount?: string;
106
+ total_tax_amount_cents?: number;
107
+ total_tax_amount_float?: number;
108
+ formatted_total_tax_amount?: string;
109
+ subtotal_tax_amount_cents?: number;
110
+ subtotal_tax_amount_float?: number;
111
+ formatted_subtotal_tax_amount?: string;
112
+ shipping_tax_amount_cents?: number;
113
+ shipping_tax_amount_float?: number;
114
+ formatted_shipping_tax_amount?: string;
115
+ payment_method_tax_amount_cents?: number;
116
+ payment_method_tax_amount_float?: number;
117
+ formatted_payment_method_tax_amount?: string;
118
+ adjustment_tax_amount_cents?: number;
119
+ adjustment_tax_amount_float?: number;
120
+ formatted_adjustment_tax_amount?: string;
121
+ total_amount_cents?: number;
122
+ total_amount_float?: number;
123
+ formatted_total_amount?: string;
124
+ total_taxable_amount_cents?: number;
125
+ total_taxable_amount_float?: number;
126
+ formatted_total_taxable_amount?: string;
127
+ subtotal_taxable_amount_cents?: number;
128
+ subtotal_taxable_amount_float?: number;
129
+ formatted_subtotal_taxable_amount?: string;
130
+ shipping_taxable_amount_cents?: number;
131
+ shipping_taxable_amount_float?: number;
132
+ formatted_shipping_taxable_amount?: string;
133
+ payment_method_taxable_amount_cents?: number;
134
+ payment_method_taxable_amount_float?: number;
135
+ formatted_payment_method_taxable_amount?: string;
136
+ adjustment_taxable_amount_cents?: number;
137
+ adjustment_taxable_amount_float?: number;
138
+ formatted_adjustment_taxable_amount?: string;
139
+ total_amount_with_taxes_cents?: number;
140
+ total_amount_with_taxes_float?: number;
141
+ formatted_total_amount_with_taxes?: string;
142
+ fees_amount_cents?: number;
143
+ fees_amount_float?: number;
144
+ formatted_fees_amount?: string;
145
+ duty_amount_cents?: number;
146
+ duty_amount_float?: number;
147
+ formatted_duty_amount?: string;
148
+ skus_count?: number;
149
+ line_item_options_count?: number;
150
+ shipments_count?: number;
151
+ tax_calculations_count?: number;
152
+ payment_source_details?: object;
153
+ token?: string;
154
+ cart_url?: string;
155
+ return_url?: string;
156
+ terms_url?: string;
157
+ privacy_url?: string;
158
+ checkout_url?: string;
159
+ placed_at?: string;
160
+ approved_at?: string;
161
+ cancelled_at?: string;
162
+ payment_updated_at?: string;
163
+ fulfillment_updated_at?: string;
164
+ refreshed_at?: string;
165
+ archived_at?: string;
166
+ expires_at?: string;
167
+ market?: Market;
168
+ customer?: Customer;
169
+ shipping_address?: Address;
170
+ billing_address?: Address;
171
+ available_payment_methods?: PaymentMethod[];
172
+ available_customer_payment_sources?: CustomerPaymentSource[];
173
+ available_free_skus?: Sku[];
174
+ available_free_bundles?: Bundle[];
175
+ payment_method?: PaymentMethod;
176
+ payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
177
+ line_items?: LineItem[];
178
+ shipments?: Shipment[];
179
+ transactions?: Array<Authorization | Void | Capture | Refund>;
180
+ authorizations?: Authorization[];
181
+ captures?: Capture[];
182
+ voids?: Void[];
183
+ refunds?: Refund[];
184
+ returns?: Return[];
185
+ order_subscriptions?: OrderSubscription[];
186
+ order_copies?: OrderCopy[];
187
+ attachments?: Attachment[];
188
+ events?: Event[];
189
+ }
190
+ interface OrderCreate extends ResourceCreate {
191
+ autorefresh?: boolean;
192
+ guest?: boolean;
193
+ customer_email?: string;
194
+ customer_password?: string;
195
+ language_code?: string;
196
+ shipping_country_code_lock?: string;
197
+ coupon_code?: string;
198
+ gift_card_code?: string;
199
+ gift_card_or_coupon_code?: string;
200
+ cart_url?: string;
201
+ return_url?: string;
202
+ terms_url?: string;
203
+ privacy_url?: string;
204
+ market?: MarketRel;
205
+ customer?: CustomerRel;
206
+ shipping_address?: AddressRel;
207
+ billing_address?: AddressRel;
208
+ payment_method?: PaymentMethodRel;
209
+ payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
210
+ }
211
+ interface OrderUpdate extends ResourceUpdate {
212
+ autorefresh?: boolean;
213
+ guest?: boolean;
214
+ customer_email?: string;
215
+ customer_password?: string;
216
+ language_code?: string;
217
+ shipping_country_code_lock?: string;
218
+ coupon_code?: string;
219
+ gift_card_code?: string;
220
+ gift_card_or_coupon_code?: string;
221
+ cart_url?: string;
222
+ return_url?: string;
223
+ terms_url?: string;
224
+ privacy_url?: string;
225
+ _archive?: boolean;
226
+ _unarchive?: boolean;
227
+ _place?: boolean;
228
+ _cancel?: boolean;
229
+ _approve?: boolean;
230
+ _approve_and_capture?: boolean;
231
+ _authorize?: boolean;
232
+ _authorization_amount_cents?: number;
233
+ _capture?: boolean;
234
+ _refund?: boolean;
235
+ _update_taxes?: boolean;
236
+ _nullify_payment_source?: boolean;
237
+ _billing_address_clone_id?: string;
238
+ _shipping_address_clone_id?: string;
239
+ _customer_payment_source_id?: string;
240
+ _shipping_address_same_as_billing?: boolean;
241
+ _billing_address_same_as_shipping?: boolean;
242
+ _commit_invoice?: boolean;
243
+ _refund_invoice?: boolean;
244
+ _save_payment_source_to_customer_wallet?: boolean;
245
+ _save_shipping_address_to_customer_address_book?: boolean;
246
+ _save_billing_address_to_customer_address_book?: boolean;
247
+ _refresh?: boolean;
248
+ _validate?: boolean;
249
+ market?: MarketRel;
250
+ customer?: CustomerRel;
251
+ shipping_address?: AddressRel;
252
+ billing_address?: AddressRel;
253
+ payment_method?: PaymentMethodRel;
254
+ payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
255
+ }
256
+ declare class Orders extends ApiResource {
257
+ static readonly TYPE: 'orders';
258
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Order>>;
259
+ create(resource: OrderCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
260
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
261
+ update(resource: OrderUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
262
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
263
+ market(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
264
+ customer(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
265
+ shipping_address(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
266
+ billing_address(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
267
+ available_payment_methods(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
268
+ available_customer_payment_sources(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerPaymentSource>>;
269
+ available_free_skus(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
270
+ available_free_bundles(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
271
+ payment_method(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
272
+ line_items(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
273
+ shipments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
274
+ authorizations(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Authorization>>;
275
+ captures(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
276
+ voids(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
277
+ refunds(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
278
+ returns(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
279
+ order_subscriptions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
280
+ order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
281
+ attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
282
+ events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
283
+ isOrder(resource: any): resource is Order;
284
+ relationship(id: string | ResourceId | null): OrderRel;
285
+ type(): string;
286
+ }
287
+ export default Orders;
288
+ export { Order, OrderCreate, OrderUpdate };
@@ -1 +1,111 @@
1
- import{ApiResource as i}from"../resource";class c extends i{async list(e,s){return this.resources.list({type:c.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:c.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:c.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:c.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:c.TYPE,id:e},s)}async market(e,s,t){const r=e.id||e;return this.resources.fetch({type:"markets"},`orders/${r}/market`,s,t)}async customer(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customers"},`orders/${r}/customer`,s,t)}async shipping_address(e,s,t){const r=e.id||e;return this.resources.fetch({type:"addresses"},`orders/${r}/shipping_address`,s,t)}async billing_address(e,s,t){const r=e.id||e;return this.resources.fetch({type:"addresses"},`orders/${r}/billing_address`,s,t)}async available_payment_methods(e,s,t){const r=e.id||e;return this.resources.fetch({type:"payment_methods"},`orders/${r}/available_payment_methods`,s,t)}async available_customer_payment_sources(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customer_payment_sources"},`orders/${r}/available_customer_payment_sources`,s,t)}async available_free_skus(e,s,t){const r=e.id||e;return this.resources.fetch({type:"skus"},`orders/${r}/available_free_skus`,s,t)}async available_free_bundles(e,s,t){const r=e.id||e;return this.resources.fetch({type:"bundles"},`orders/${r}/available_free_bundles`,s,t)}async payment_method(e,s,t){const r=e.id||e;return this.resources.fetch({type:"payment_methods"},`orders/${r}/payment_method`,s,t)}async line_items(e,s,t){const r=e.id||e;return this.resources.fetch({type:"line_items"},`orders/${r}/line_items`,s,t)}async shipments(e,s,t){const r=e.id||e;return this.resources.fetch({type:"shipments"},`orders/${r}/shipments`,s,t)}async authorizations(e,s,t){const r=e.id||e;return this.resources.fetch({type:"authorizations"},`orders/${r}/authorizations`,s,t)}async captures(e,s,t){const r=e.id||e;return this.resources.fetch({type:"captures"},`orders/${r}/captures`,s,t)}async voids(e,s,t){const r=e.id||e;return this.resources.fetch({type:"voids"},`orders/${r}/voids`,s,t)}async refunds(e,s,t){const r=e.id||e;return this.resources.fetch({type:"refunds"},`orders/${r}/refunds`,s,t)}async order_subscriptions(e,s,t){const r=e.id||e;return this.resources.fetch({type:"order_subscriptions"},`orders/${r}/order_subscriptions`,s,t)}async order_copies(e,s,t){const r=e.id||e;return this.resources.fetch({type:"order_copies"},`orders/${r}/order_copies`,s,t)}async attachments(e,s,t){const r=e.id||e;return this.resources.fetch({type:"attachments"},`orders/${r}/attachments`,s,t)}async events(e,s,t){const r=e.id||e;return this.resources.fetch({type:"events"},`orders/${r}/events`,s,t)}isOrder(e){return e.type&&e.type===c.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:c.TYPE}:{id:e.id,type:c.TYPE}}type(){return c.TYPE}}c.TYPE="orders";export default c;
1
+ import { ApiResource } from '../resource';
2
+ class Orders extends ApiResource {
3
+ // static readonly PATH = 'orders'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Orders.TYPE }, params, options);
6
+ }
7
+ async create(resource, params, options) {
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: Orders.TYPE, id }, params, options);
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: Orders.TYPE }), params, options);
15
+ }
16
+ async delete(id, options) {
17
+ await this.resources.delete({ type: Orders.TYPE, id }, options);
18
+ }
19
+ async market(orderId, params, options) {
20
+ const _orderId = orderId.id || orderId;
21
+ return this.resources.fetch({ type: 'markets' }, `orders/${_orderId}/market`, params, options);
22
+ }
23
+ async customer(orderId, params, options) {
24
+ const _orderId = orderId.id || orderId;
25
+ return this.resources.fetch({ type: 'customers' }, `orders/${_orderId}/customer`, params, options);
26
+ }
27
+ async shipping_address(orderId, params, options) {
28
+ const _orderId = orderId.id || orderId;
29
+ return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/shipping_address`, params, options);
30
+ }
31
+ async billing_address(orderId, params, options) {
32
+ const _orderId = orderId.id || orderId;
33
+ return this.resources.fetch({ type: 'addresses' }, `orders/${_orderId}/billing_address`, params, options);
34
+ }
35
+ async available_payment_methods(orderId, params, options) {
36
+ const _orderId = orderId.id || orderId;
37
+ return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/available_payment_methods`, params, options);
38
+ }
39
+ async available_customer_payment_sources(orderId, params, options) {
40
+ const _orderId = orderId.id || orderId;
41
+ return this.resources.fetch({ type: 'customer_payment_sources' }, `orders/${_orderId}/available_customer_payment_sources`, params, options);
42
+ }
43
+ async available_free_skus(orderId, params, options) {
44
+ const _orderId = orderId.id || orderId;
45
+ return this.resources.fetch({ type: 'skus' }, `orders/${_orderId}/available_free_skus`, params, options);
46
+ }
47
+ async available_free_bundles(orderId, params, options) {
48
+ const _orderId = orderId.id || orderId;
49
+ return this.resources.fetch({ type: 'bundles' }, `orders/${_orderId}/available_free_bundles`, params, options);
50
+ }
51
+ async payment_method(orderId, params, options) {
52
+ const _orderId = orderId.id || orderId;
53
+ return this.resources.fetch({ type: 'payment_methods' }, `orders/${_orderId}/payment_method`, params, options);
54
+ }
55
+ async line_items(orderId, params, options) {
56
+ const _orderId = orderId.id || orderId;
57
+ return this.resources.fetch({ type: 'line_items' }, `orders/${_orderId}/line_items`, params, options);
58
+ }
59
+ async shipments(orderId, params, options) {
60
+ const _orderId = orderId.id || orderId;
61
+ return this.resources.fetch({ type: 'shipments' }, `orders/${_orderId}/shipments`, params, options);
62
+ }
63
+ async authorizations(orderId, params, options) {
64
+ const _orderId = orderId.id || orderId;
65
+ return this.resources.fetch({ type: 'authorizations' }, `orders/${_orderId}/authorizations`, params, options);
66
+ }
67
+ async captures(orderId, params, options) {
68
+ const _orderId = orderId.id || orderId;
69
+ return this.resources.fetch({ type: 'captures' }, `orders/${_orderId}/captures`, params, options);
70
+ }
71
+ async voids(orderId, params, options) {
72
+ const _orderId = orderId.id || orderId;
73
+ return this.resources.fetch({ type: 'voids' }, `orders/${_orderId}/voids`, params, options);
74
+ }
75
+ async refunds(orderId, params, options) {
76
+ const _orderId = orderId.id || orderId;
77
+ return this.resources.fetch({ type: 'refunds' }, `orders/${_orderId}/refunds`, params, options);
78
+ }
79
+ async returns(orderId, params, options) {
80
+ const _orderId = orderId.id || orderId;
81
+ return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
82
+ }
83
+ async order_subscriptions(orderId, params, options) {
84
+ const _orderId = orderId.id || orderId;
85
+ return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
86
+ }
87
+ async order_copies(orderId, params, options) {
88
+ const _orderId = orderId.id || orderId;
89
+ return this.resources.fetch({ type: 'order_copies' }, `orders/${_orderId}/order_copies`, params, options);
90
+ }
91
+ async attachments(orderId, params, options) {
92
+ const _orderId = orderId.id || orderId;
93
+ return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
94
+ }
95
+ async events(orderId, params, options) {
96
+ const _orderId = orderId.id || orderId;
97
+ return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
98
+ }
99
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
100
+ isOrder(resource) {
101
+ return resource.type && (resource.type === Orders.TYPE);
102
+ }
103
+ relationship(id) {
104
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Orders.TYPE } : { id: id.id, type: Orders.TYPE };
105
+ }
106
+ type() {
107
+ return Orders.TYPE;
108
+ }
109
+ }
110
+ Orders.TYPE = 'orders';
111
+ export default Orders;
@@ -1 +1,32 @@
1
- import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel}from'../resource';import type{QueryParamsRetrieve}from'../query';type OrganizationRel=ResourceRel&{type:typeof Organizations.TYPE;};interface Organization extends Resource{name?:string;slug?:string;domain?:string;support_phone?:string;support_email?:string;logo_url?:string;favicon_url?:string;primary_color?:string;contrast_color?:string;gtm_id?:string;gtm_id_test?:string;discount_disabled?:boolean;account_disabled?:boolean;acceptance_disabled?:boolean;max_concurrent_promotions?:number;max_concurrent_imports?:number;}declare class Organizations extends ApiResource{static readonly TYPE:'organization';retrieve(params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Organization>;isOrganization(resource:any):resource is Organization;relationship(id:string|ResourceId|null):OrganizationRel;type():string;}export default Organizations;export{Organization};
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel } from '../resource';
2
+ import type { QueryParamsRetrieve } from '../query';
3
+ type OrganizationRel = ResourceRel & {
4
+ type: typeof Organizations.TYPE;
5
+ };
6
+ interface Organization extends Resource {
7
+ name?: string;
8
+ slug?: string;
9
+ domain?: string;
10
+ support_phone?: string;
11
+ support_email?: string;
12
+ logo_url?: string;
13
+ favicon_url?: string;
14
+ primary_color?: string;
15
+ contrast_color?: string;
16
+ gtm_id?: string;
17
+ gtm_id_test?: string;
18
+ discount_disabled?: boolean;
19
+ account_disabled?: boolean;
20
+ acceptance_disabled?: boolean;
21
+ max_concurrent_promotions?: number;
22
+ max_concurrent_imports?: number;
23
+ }
24
+ declare class Organizations extends ApiResource {
25
+ static readonly TYPE: 'organization';
26
+ retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
27
+ isOrganization(resource: any): resource is Organization;
28
+ relationship(id: string | ResourceId | null): OrganizationRel;
29
+ type(): string;
30
+ }
31
+ export default Organizations;
32
+ export { Organization };
@@ -1 +1,19 @@
1
- import{ApiResource as r}from"../resource";class e extends r{async retrieve(t,i){return this.resources.singleton({type:e.TYPE},t,i)}isOrganization(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="organization";export default e;
1
+ import { ApiResource } from '../resource';
2
+ class Organizations extends ApiResource {
3
+ // static readonly PATH = 'organization'
4
+ async retrieve(params, options) {
5
+ return this.resources.singleton({ type: Organizations.TYPE }, params, options);
6
+ }
7
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
8
+ isOrganization(resource) {
9
+ return resource.type && (resource.type === Organizations.TYPE);
10
+ }
11
+ relationship(id) {
12
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Organizations.TYPE } : { id: id.id, type: Organizations.TYPE };
13
+ }
14
+ type() {
15
+ return Organizations.TYPE;
16
+ }
17
+ }
18
+ Organizations.TYPE = 'organization';
19
+ export default Organizations;
@@ -1 +1,56 @@
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';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[];}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>>;isPackage(resource:any):resource is Package;relationship(id:string|ResourceId|null):PackageRel;type():string;}export default Packages;export{Package,PackageCreate,PackageUpdate};
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
+ type PackageRel = ResourceRel & {
7
+ type: typeof Packages.TYPE;
8
+ };
9
+ type StockLocationRel = ResourceRel & {
10
+ type: 'stock_locations';
11
+ };
12
+ interface Package extends Resource {
13
+ name?: string;
14
+ code?: string;
15
+ length?: number;
16
+ width?: number;
17
+ height?: number;
18
+ unit_of_length?: string;
19
+ stock_location?: StockLocation;
20
+ parcels?: Parcel[];
21
+ attachments?: Attachment[];
22
+ }
23
+ interface PackageCreate extends ResourceCreate {
24
+ name: string;
25
+ code?: string;
26
+ length: number;
27
+ width: number;
28
+ height: number;
29
+ unit_of_length: string;
30
+ stock_location: StockLocationRel;
31
+ }
32
+ interface PackageUpdate extends ResourceUpdate {
33
+ name?: string;
34
+ code?: string;
35
+ length?: number;
36
+ width?: number;
37
+ height?: number;
38
+ unit_of_length?: string;
39
+ stock_location?: StockLocationRel;
40
+ }
41
+ declare class Packages extends ApiResource {
42
+ static readonly TYPE: 'packages';
43
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Package>>;
44
+ create(resource: PackageCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
45
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
46
+ update(resource: PackageUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
47
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
48
+ stock_location(packageId: string | Package, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
49
+ parcels(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
50
+ attachments(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
51
+ isPackage(resource: any): resource is Package;
52
+ relationship(id: string | ResourceId | null): PackageRel;
53
+ type(): string;
54
+ }
55
+ export default Packages;
56
+ export { Package, PackageCreate, PackageUpdate };
@@ -1 +1,43 @@
1
- import{ApiResource as a}from"../resource";class s extends a{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async stock_location(e,t,r){const c=e.id||e;return this.resources.fetch({type:"stock_locations"},`packages/${c}/stock_location`,t,r)}async parcels(e,t,r){const c=e.id||e;return this.resources.fetch({type:"parcels"},`packages/${c}/parcels`,t,r)}async attachments(e,t,r){const c=e.id||e;return this.resources.fetch({type:"attachments"},`packages/${c}/attachments`,t,r)}isPackage(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="packages";export default s;
1
+ import { ApiResource } from '../resource';
2
+ class Packages extends ApiResource {
3
+ // static readonly PATH = 'packages'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: Packages.TYPE }, params, options);
6
+ }
7
+ async create(resource, params, options) {
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: Packages.TYPE, id }, params, options);
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: Packages.TYPE }), params, options);
15
+ }
16
+ async delete(id, options) {
17
+ await this.resources.delete({ type: Packages.TYPE, id }, options);
18
+ }
19
+ async stock_location(packageId, params, options) {
20
+ const _packageId = packageId.id || packageId;
21
+ return this.resources.fetch({ type: 'stock_locations' }, `packages/${_packageId}/stock_location`, params, options);
22
+ }
23
+ async parcels(packageId, params, options) {
24
+ const _packageId = packageId.id || packageId;
25
+ return this.resources.fetch({ type: 'parcels' }, `packages/${_packageId}/parcels`, params, options);
26
+ }
27
+ async attachments(packageId, params, options) {
28
+ const _packageId = packageId.id || packageId;
29
+ return this.resources.fetch({ type: 'attachments' }, `packages/${_packageId}/attachments`, params, options);
30
+ }
31
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
32
+ isPackage(resource) {
33
+ return resource.type && (resource.type === Packages.TYPE);
34
+ }
35
+ relationship(id) {
36
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
37
+ }
38
+ type() {
39
+ return Packages.TYPE;
40
+ }
41
+ }
42
+ Packages.TYPE = 'packages';
43
+ export default Packages;