@commercelayer/sdk 5.35.0 → 6.0.0-alfa.10

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 (535) hide show
  1. package/lib/cjs/api.d.ts +0 -3
  2. package/lib/cjs/api.js +0 -10
  3. package/lib/cjs/client.d.ts +6 -14
  4. package/lib/cjs/client.js +41 -75
  5. package/lib/cjs/commercelayer.d.ts +126 -125
  6. package/lib/cjs/commercelayer.js +267 -155
  7. package/lib/cjs/common.js +1 -12
  8. package/lib/cjs/config.js +0 -2
  9. package/lib/cjs/debug.js +0 -21
  10. package/lib/cjs/error.d.ts +6 -7
  11. package/lib/cjs/error.js +36 -35
  12. package/lib/cjs/fetch.d.ts +13 -0
  13. package/lib/cjs/fetch.js +67 -0
  14. package/lib/cjs/index.js +0 -2
  15. package/lib/cjs/interceptor.d.ts +22 -10
  16. package/lib/cjs/jsonapi.js +0 -2
  17. package/lib/cjs/model.d.ts +0 -3
  18. package/lib/cjs/model.js +0 -1
  19. package/lib/cjs/query.d.ts +2 -1
  20. package/lib/cjs/query.js +8 -7
  21. package/lib/cjs/resource.d.ts +2 -5
  22. package/lib/cjs/resource.js +32 -58
  23. package/lib/cjs/resources/addresses.d.ts +1 -0
  24. package/lib/cjs/resources/addresses.js +4 -1
  25. package/lib/cjs/resources/adjustments.d.ts +1 -0
  26. package/lib/cjs/resources/adjustments.js +4 -1
  27. package/lib/cjs/resources/adyen_gateways.d.ts +1 -0
  28. package/lib/cjs/resources/adyen_gateways.js +4 -1
  29. package/lib/cjs/resources/adyen_payments.d.ts +1 -0
  30. package/lib/cjs/resources/adyen_payments.js +4 -1
  31. package/lib/cjs/resources/application.d.ts +1 -0
  32. package/lib/cjs/resources/application.js +4 -1
  33. package/lib/cjs/resources/attachments.d.ts +1 -0
  34. package/lib/cjs/resources/attachments.js +4 -1
  35. package/lib/cjs/resources/authorizations.d.ts +1 -0
  36. package/lib/cjs/resources/authorizations.js +4 -1
  37. package/lib/cjs/resources/avalara_accounts.d.ts +1 -0
  38. package/lib/cjs/resources/avalara_accounts.js +4 -1
  39. package/lib/cjs/resources/axerve_gateways.d.ts +1 -0
  40. package/lib/cjs/resources/axerve_gateways.js +4 -1
  41. package/lib/cjs/resources/axerve_payments.d.ts +1 -0
  42. package/lib/cjs/resources/axerve_payments.js +4 -1
  43. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -0
  44. package/lib/cjs/resources/billing_info_validation_rules.js +4 -1
  45. package/lib/cjs/resources/bing_geocoders.d.ts +1 -0
  46. package/lib/cjs/resources/bing_geocoders.js +4 -1
  47. package/lib/cjs/resources/braintree_gateways.d.ts +1 -0
  48. package/lib/cjs/resources/braintree_gateways.js +4 -1
  49. package/lib/cjs/resources/braintree_payments.d.ts +1 -0
  50. package/lib/cjs/resources/braintree_payments.js +4 -1
  51. package/lib/cjs/resources/bundles.d.ts +1 -0
  52. package/lib/cjs/resources/bundles.js +4 -1
  53. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -0
  54. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -1
  55. package/lib/cjs/resources/captures.d.ts +1 -0
  56. package/lib/cjs/resources/captures.js +4 -1
  57. package/lib/cjs/resources/carrier_accounts.d.ts +1 -0
  58. package/lib/cjs/resources/carrier_accounts.js +4 -1
  59. package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -0
  60. package/lib/cjs/resources/checkout_com_gateways.js +4 -1
  61. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -0
  62. package/lib/cjs/resources/checkout_com_payments.js +4 -1
  63. package/lib/cjs/resources/cleanups.d.ts +1 -0
  64. package/lib/cjs/resources/cleanups.js +4 -1
  65. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -0
  66. package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -1
  67. package/lib/cjs/resources/coupon_recipients.d.ts +1 -0
  68. package/lib/cjs/resources/coupon_recipients.js +4 -1
  69. package/lib/cjs/resources/coupons.d.ts +1 -0
  70. package/lib/cjs/resources/coupons.js +4 -1
  71. package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -0
  72. package/lib/cjs/resources/custom_promotion_rules.js +4 -1
  73. package/lib/cjs/resources/customer_addresses.d.ts +1 -0
  74. package/lib/cjs/resources/customer_addresses.js +4 -1
  75. package/lib/cjs/resources/customer_groups.d.ts +1 -0
  76. package/lib/cjs/resources/customer_groups.js +4 -1
  77. package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
  78. package/lib/cjs/resources/customer_password_resets.js +4 -1
  79. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -0
  80. package/lib/cjs/resources/customer_payment_sources.js +4 -1
  81. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -0
  82. package/lib/cjs/resources/customer_subscriptions.js +4 -1
  83. package/lib/cjs/resources/customers.d.ts +1 -0
  84. package/lib/cjs/resources/customers.js +4 -1
  85. package/lib/cjs/resources/delivery_lead_times.d.ts +1 -0
  86. package/lib/cjs/resources/delivery_lead_times.js +4 -1
  87. package/lib/cjs/resources/event_callbacks.d.ts +1 -0
  88. package/lib/cjs/resources/event_callbacks.js +4 -1
  89. package/lib/cjs/resources/events.d.ts +1 -0
  90. package/lib/cjs/resources/events.js +4 -1
  91. package/lib/cjs/resources/exports.d.ts +1 -0
  92. package/lib/cjs/resources/exports.js +4 -1
  93. package/lib/cjs/resources/external_gateways.d.ts +1 -0
  94. package/lib/cjs/resources/external_gateways.js +4 -1
  95. package/lib/cjs/resources/external_payments.d.ts +1 -0
  96. package/lib/cjs/resources/external_payments.js +4 -1
  97. package/lib/cjs/resources/external_promotions.d.ts +1 -0
  98. package/lib/cjs/resources/external_promotions.js +4 -1
  99. package/lib/cjs/resources/external_tax_calculators.d.ts +1 -0
  100. package/lib/cjs/resources/external_tax_calculators.js +4 -1
  101. package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -0
  102. package/lib/cjs/resources/fixed_amount_promotions.js +4 -1
  103. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -0
  104. package/lib/cjs/resources/fixed_price_promotions.js +4 -1
  105. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -0
  106. package/lib/cjs/resources/free_gift_promotions.js +4 -1
  107. package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -0
  108. package/lib/cjs/resources/free_shipping_promotions.js +4 -1
  109. package/lib/cjs/resources/geocoders.d.ts +1 -0
  110. package/lib/cjs/resources/geocoders.js +4 -1
  111. package/lib/cjs/resources/gift_card_recipients.d.ts +1 -0
  112. package/lib/cjs/resources/gift_card_recipients.js +4 -1
  113. package/lib/cjs/resources/gift_cards.d.ts +1 -0
  114. package/lib/cjs/resources/gift_cards.js +4 -1
  115. package/lib/cjs/resources/google_geocoders.d.ts +1 -0
  116. package/lib/cjs/resources/google_geocoders.js +4 -1
  117. package/lib/cjs/resources/imports.d.ts +1 -0
  118. package/lib/cjs/resources/imports.js +4 -1
  119. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -0
  120. package/lib/cjs/resources/in_stock_subscriptions.js +4 -1
  121. package/lib/cjs/resources/inventory_models.d.ts +1 -0
  122. package/lib/cjs/resources/inventory_models.js +4 -1
  123. package/lib/cjs/resources/inventory_return_locations.d.ts +1 -0
  124. package/lib/cjs/resources/inventory_return_locations.js +4 -1
  125. package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -0
  126. package/lib/cjs/resources/inventory_stock_locations.js +4 -1
  127. package/lib/cjs/resources/klarna_gateways.d.ts +1 -0
  128. package/lib/cjs/resources/klarna_gateways.js +4 -1
  129. package/lib/cjs/resources/klarna_payments.d.ts +1 -0
  130. package/lib/cjs/resources/klarna_payments.js +4 -1
  131. package/lib/cjs/resources/line_item_options.d.ts +1 -0
  132. package/lib/cjs/resources/line_item_options.js +4 -1
  133. package/lib/cjs/resources/line_items.d.ts +1 -0
  134. package/lib/cjs/resources/line_items.js +4 -1
  135. package/lib/cjs/resources/manual_gateways.d.ts +1 -0
  136. package/lib/cjs/resources/manual_gateways.js +4 -1
  137. package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -0
  138. package/lib/cjs/resources/manual_tax_calculators.js +4 -1
  139. package/lib/cjs/resources/markets.d.ts +1 -0
  140. package/lib/cjs/resources/markets.js +4 -1
  141. package/lib/cjs/resources/merchants.d.ts +1 -0
  142. package/lib/cjs/resources/merchants.js +4 -1
  143. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -0
  144. package/lib/cjs/resources/order_amount_promotion_rules.js +4 -1
  145. package/lib/cjs/resources/order_copies.d.ts +1 -0
  146. package/lib/cjs/resources/order_copies.js +4 -1
  147. package/lib/cjs/resources/order_factories.d.ts +1 -0
  148. package/lib/cjs/resources/order_factories.js +4 -1
  149. package/lib/cjs/resources/order_subscription_items.d.ts +1 -0
  150. package/lib/cjs/resources/order_subscription_items.js +4 -1
  151. package/lib/cjs/resources/order_subscriptions.d.ts +1 -0
  152. package/lib/cjs/resources/order_subscriptions.js +4 -1
  153. package/lib/cjs/resources/order_validation_rules.d.ts +1 -0
  154. package/lib/cjs/resources/order_validation_rules.js +4 -1
  155. package/lib/cjs/resources/orders.d.ts +1 -0
  156. package/lib/cjs/resources/orders.js +4 -1
  157. package/lib/cjs/resources/organization.d.ts +1 -0
  158. package/lib/cjs/resources/organization.js +4 -1
  159. package/lib/cjs/resources/packages.d.ts +1 -0
  160. package/lib/cjs/resources/packages.js +4 -1
  161. package/lib/cjs/resources/parcel_line_items.d.ts +1 -0
  162. package/lib/cjs/resources/parcel_line_items.js +4 -1
  163. package/lib/cjs/resources/parcels.d.ts +1 -0
  164. package/lib/cjs/resources/parcels.js +4 -1
  165. package/lib/cjs/resources/payment_gateways.d.ts +1 -0
  166. package/lib/cjs/resources/payment_gateways.js +4 -1
  167. package/lib/cjs/resources/payment_methods.d.ts +1 -0
  168. package/lib/cjs/resources/payment_methods.js +4 -1
  169. package/lib/cjs/resources/payment_options.d.ts +1 -0
  170. package/lib/cjs/resources/payment_options.js +4 -1
  171. package/lib/cjs/resources/paypal_gateways.d.ts +1 -0
  172. package/lib/cjs/resources/paypal_gateways.js +4 -1
  173. package/lib/cjs/resources/paypal_payments.d.ts +1 -0
  174. package/lib/cjs/resources/paypal_payments.js +4 -1
  175. package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -0
  176. package/lib/cjs/resources/percentage_discount_promotions.js +4 -1
  177. package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -0
  178. package/lib/cjs/resources/price_frequency_tiers.js +4 -1
  179. package/lib/cjs/resources/price_lists.d.ts +1 -0
  180. package/lib/cjs/resources/price_lists.js +4 -1
  181. package/lib/cjs/resources/price_tiers.d.ts +1 -0
  182. package/lib/cjs/resources/price_tiers.js +4 -1
  183. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -0
  184. package/lib/cjs/resources/price_volume_tiers.js +4 -1
  185. package/lib/cjs/resources/prices.d.ts +1 -0
  186. package/lib/cjs/resources/prices.js +4 -1
  187. package/lib/cjs/resources/promotion_rules.d.ts +1 -0
  188. package/lib/cjs/resources/promotion_rules.js +4 -1
  189. package/lib/cjs/resources/promotions.d.ts +1 -0
  190. package/lib/cjs/resources/promotions.js +4 -1
  191. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -0
  192. package/lib/cjs/resources/recurring_order_copies.js +4 -1
  193. package/lib/cjs/resources/refunds.d.ts +1 -0
  194. package/lib/cjs/resources/refunds.js +4 -1
  195. package/lib/cjs/resources/reserved_stocks.d.ts +1 -0
  196. package/lib/cjs/resources/reserved_stocks.js +4 -1
  197. package/lib/cjs/resources/resource_errors.d.ts +1 -0
  198. package/lib/cjs/resources/resource_errors.js +4 -1
  199. package/lib/cjs/resources/return_line_items.d.ts +1 -0
  200. package/lib/cjs/resources/return_line_items.js +4 -1
  201. package/lib/cjs/resources/returns.d.ts +1 -0
  202. package/lib/cjs/resources/returns.js +4 -1
  203. package/lib/cjs/resources/satispay_gateways.d.ts +1 -0
  204. package/lib/cjs/resources/satispay_gateways.js +4 -1
  205. package/lib/cjs/resources/satispay_payments.d.ts +1 -0
  206. package/lib/cjs/resources/satispay_payments.js +4 -1
  207. package/lib/cjs/resources/shipments.d.ts +1 -0
  208. package/lib/cjs/resources/shipments.js +4 -1
  209. package/lib/cjs/resources/shipping_categories.d.ts +1 -0
  210. package/lib/cjs/resources/shipping_categories.js +4 -1
  211. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -0
  212. package/lib/cjs/resources/shipping_method_tiers.js +4 -1
  213. package/lib/cjs/resources/shipping_methods.d.ts +1 -0
  214. package/lib/cjs/resources/shipping_methods.js +4 -1
  215. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -0
  216. package/lib/cjs/resources/shipping_weight_tiers.js +4 -1
  217. package/lib/cjs/resources/shipping_zones.d.ts +1 -0
  218. package/lib/cjs/resources/shipping_zones.js +4 -1
  219. package/lib/cjs/resources/sku_list_items.d.ts +1 -0
  220. package/lib/cjs/resources/sku_list_items.js +4 -1
  221. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -0
  222. package/lib/cjs/resources/sku_list_promotion_rules.js +4 -1
  223. package/lib/cjs/resources/sku_lists.d.ts +1 -0
  224. package/lib/cjs/resources/sku_lists.js +4 -1
  225. package/lib/cjs/resources/sku_options.d.ts +1 -0
  226. package/lib/cjs/resources/sku_options.js +4 -1
  227. package/lib/cjs/resources/skus.d.ts +1 -0
  228. package/lib/cjs/resources/skus.js +4 -1
  229. package/lib/cjs/resources/stock_items.d.ts +1 -0
  230. package/lib/cjs/resources/stock_items.js +4 -1
  231. package/lib/cjs/resources/stock_line_items.d.ts +1 -0
  232. package/lib/cjs/resources/stock_line_items.js +4 -1
  233. package/lib/cjs/resources/stock_locations.d.ts +1 -0
  234. package/lib/cjs/resources/stock_locations.js +4 -1
  235. package/lib/cjs/resources/stock_reservations.d.ts +1 -0
  236. package/lib/cjs/resources/stock_reservations.js +4 -1
  237. package/lib/cjs/resources/stock_transfers.d.ts +1 -0
  238. package/lib/cjs/resources/stock_transfers.js +4 -1
  239. package/lib/cjs/resources/stripe_gateways.d.ts +1 -0
  240. package/lib/cjs/resources/stripe_gateways.js +4 -1
  241. package/lib/cjs/resources/stripe_payments.d.ts +1 -0
  242. package/lib/cjs/resources/stripe_payments.js +4 -1
  243. package/lib/cjs/resources/subscription_models.d.ts +1 -0
  244. package/lib/cjs/resources/subscription_models.js +4 -1
  245. package/lib/cjs/resources/tags.d.ts +1 -0
  246. package/lib/cjs/resources/tags.js +4 -1
  247. package/lib/cjs/resources/tax_calculators.d.ts +1 -0
  248. package/lib/cjs/resources/tax_calculators.js +4 -1
  249. package/lib/cjs/resources/tax_categories.d.ts +1 -0
  250. package/lib/cjs/resources/tax_categories.js +4 -1
  251. package/lib/cjs/resources/tax_rules.d.ts +1 -0
  252. package/lib/cjs/resources/tax_rules.js +4 -1
  253. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -0
  254. package/lib/cjs/resources/taxjar_accounts.js +4 -1
  255. package/lib/cjs/resources/transactions.d.ts +1 -0
  256. package/lib/cjs/resources/transactions.js +4 -1
  257. package/lib/cjs/resources/versions.d.ts +1 -0
  258. package/lib/cjs/resources/versions.js +4 -1
  259. package/lib/cjs/resources/voids.d.ts +1 -0
  260. package/lib/cjs/resources/voids.js +4 -1
  261. package/lib/cjs/resources/webhooks.d.ts +1 -0
  262. package/lib/cjs/resources/webhooks.js +4 -1
  263. package/lib/cjs/resources/wire_transfers.d.ts +1 -0
  264. package/lib/cjs/resources/wire_transfers.js +4 -1
  265. package/lib/cjs/static.js +0 -1
  266. package/lib/cjs/util.js +0 -1
  267. package/lib/esm/api.d.ts +0 -3
  268. package/lib/esm/api.js +0 -10
  269. package/lib/esm/client.d.ts +6 -14
  270. package/lib/esm/client.js +43 -90
  271. package/lib/esm/commercelayer.d.ts +126 -125
  272. package/lib/esm/commercelayer.js +270 -171
  273. package/lib/esm/common.js +1 -12
  274. package/lib/esm/config.js +0 -2
  275. package/lib/esm/debug.js +0 -21
  276. package/lib/esm/error.d.ts +6 -7
  277. package/lib/esm/error.js +44 -35
  278. package/lib/esm/fetch.d.ts +13 -0
  279. package/lib/esm/fetch.js +46 -0
  280. package/lib/esm/index.js +0 -2
  281. package/lib/esm/interceptor.d.ts +22 -10
  282. package/lib/esm/jsonapi.js +0 -2
  283. package/lib/esm/model.d.ts +0 -3
  284. package/lib/esm/model.js +0 -1
  285. package/lib/esm/query.d.ts +2 -1
  286. package/lib/esm/query.js +7 -7
  287. package/lib/esm/resource.d.ts +2 -5
  288. package/lib/esm/resource.js +40 -76
  289. package/lib/esm/resources/addresses.d.ts +1 -0
  290. package/lib/esm/resources/addresses.js +5 -2
  291. package/lib/esm/resources/adjustments.d.ts +1 -0
  292. package/lib/esm/resources/adjustments.js +5 -2
  293. package/lib/esm/resources/adyen_gateways.d.ts +1 -0
  294. package/lib/esm/resources/adyen_gateways.js +5 -2
  295. package/lib/esm/resources/adyen_payments.d.ts +1 -0
  296. package/lib/esm/resources/adyen_payments.js +5 -2
  297. package/lib/esm/resources/application.d.ts +1 -0
  298. package/lib/esm/resources/application.js +5 -2
  299. package/lib/esm/resources/attachments.d.ts +1 -0
  300. package/lib/esm/resources/attachments.js +5 -2
  301. package/lib/esm/resources/authorizations.d.ts +1 -0
  302. package/lib/esm/resources/authorizations.js +5 -2
  303. package/lib/esm/resources/avalara_accounts.d.ts +1 -0
  304. package/lib/esm/resources/avalara_accounts.js +5 -2
  305. package/lib/esm/resources/axerve_gateways.d.ts +1 -0
  306. package/lib/esm/resources/axerve_gateways.js +5 -2
  307. package/lib/esm/resources/axerve_payments.d.ts +1 -0
  308. package/lib/esm/resources/axerve_payments.js +5 -2
  309. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
  310. package/lib/esm/resources/billing_info_validation_rules.js +5 -2
  311. package/lib/esm/resources/bing_geocoders.d.ts +1 -0
  312. package/lib/esm/resources/bing_geocoders.js +5 -2
  313. package/lib/esm/resources/braintree_gateways.d.ts +1 -0
  314. package/lib/esm/resources/braintree_gateways.js +5 -2
  315. package/lib/esm/resources/braintree_payments.d.ts +1 -0
  316. package/lib/esm/resources/braintree_payments.js +5 -2
  317. package/lib/esm/resources/bundles.d.ts +1 -0
  318. package/lib/esm/resources/bundles.js +5 -2
  319. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -0
  320. package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -2
  321. package/lib/esm/resources/captures.d.ts +1 -0
  322. package/lib/esm/resources/captures.js +5 -2
  323. package/lib/esm/resources/carrier_accounts.d.ts +1 -0
  324. package/lib/esm/resources/carrier_accounts.js +5 -2
  325. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -0
  326. package/lib/esm/resources/checkout_com_gateways.js +5 -2
  327. package/lib/esm/resources/checkout_com_payments.d.ts +1 -0
  328. package/lib/esm/resources/checkout_com_payments.js +5 -2
  329. package/lib/esm/resources/cleanups.d.ts +1 -0
  330. package/lib/esm/resources/cleanups.js +5 -2
  331. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
  332. package/lib/esm/resources/coupon_codes_promotion_rules.js +5 -2
  333. package/lib/esm/resources/coupon_recipients.d.ts +1 -0
  334. package/lib/esm/resources/coupon_recipients.js +5 -2
  335. package/lib/esm/resources/coupons.d.ts +1 -0
  336. package/lib/esm/resources/coupons.js +5 -2
  337. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -0
  338. package/lib/esm/resources/custom_promotion_rules.js +5 -2
  339. package/lib/esm/resources/customer_addresses.d.ts +1 -0
  340. package/lib/esm/resources/customer_addresses.js +5 -2
  341. package/lib/esm/resources/customer_groups.d.ts +1 -0
  342. package/lib/esm/resources/customer_groups.js +5 -2
  343. package/lib/esm/resources/customer_password_resets.d.ts +1 -0
  344. package/lib/esm/resources/customer_password_resets.js +5 -2
  345. package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
  346. package/lib/esm/resources/customer_payment_sources.js +5 -2
  347. package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
  348. package/lib/esm/resources/customer_subscriptions.js +5 -2
  349. package/lib/esm/resources/customers.d.ts +1 -0
  350. package/lib/esm/resources/customers.js +5 -2
  351. package/lib/esm/resources/delivery_lead_times.d.ts +1 -0
  352. package/lib/esm/resources/delivery_lead_times.js +5 -2
  353. package/lib/esm/resources/event_callbacks.d.ts +1 -0
  354. package/lib/esm/resources/event_callbacks.js +5 -2
  355. package/lib/esm/resources/events.d.ts +1 -0
  356. package/lib/esm/resources/events.js +5 -2
  357. package/lib/esm/resources/exports.d.ts +1 -0
  358. package/lib/esm/resources/exports.js +5 -2
  359. package/lib/esm/resources/external_gateways.d.ts +1 -0
  360. package/lib/esm/resources/external_gateways.js +5 -2
  361. package/lib/esm/resources/external_payments.d.ts +1 -0
  362. package/lib/esm/resources/external_payments.js +5 -2
  363. package/lib/esm/resources/external_promotions.d.ts +1 -0
  364. package/lib/esm/resources/external_promotions.js +5 -2
  365. package/lib/esm/resources/external_tax_calculators.d.ts +1 -0
  366. package/lib/esm/resources/external_tax_calculators.js +5 -2
  367. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -0
  368. package/lib/esm/resources/fixed_amount_promotions.js +5 -2
  369. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -0
  370. package/lib/esm/resources/fixed_price_promotions.js +5 -2
  371. package/lib/esm/resources/free_gift_promotions.d.ts +1 -0
  372. package/lib/esm/resources/free_gift_promotions.js +5 -2
  373. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -0
  374. package/lib/esm/resources/free_shipping_promotions.js +5 -2
  375. package/lib/esm/resources/geocoders.d.ts +1 -0
  376. package/lib/esm/resources/geocoders.js +5 -2
  377. package/lib/esm/resources/gift_card_recipients.d.ts +1 -0
  378. package/lib/esm/resources/gift_card_recipients.js +5 -2
  379. package/lib/esm/resources/gift_cards.d.ts +1 -0
  380. package/lib/esm/resources/gift_cards.js +5 -2
  381. package/lib/esm/resources/google_geocoders.d.ts +1 -0
  382. package/lib/esm/resources/google_geocoders.js +5 -2
  383. package/lib/esm/resources/imports.d.ts +1 -0
  384. package/lib/esm/resources/imports.js +5 -2
  385. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -0
  386. package/lib/esm/resources/in_stock_subscriptions.js +5 -2
  387. package/lib/esm/resources/inventory_models.d.ts +1 -0
  388. package/lib/esm/resources/inventory_models.js +5 -2
  389. package/lib/esm/resources/inventory_return_locations.d.ts +1 -0
  390. package/lib/esm/resources/inventory_return_locations.js +5 -2
  391. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -0
  392. package/lib/esm/resources/inventory_stock_locations.js +5 -2
  393. package/lib/esm/resources/klarna_gateways.d.ts +1 -0
  394. package/lib/esm/resources/klarna_gateways.js +5 -2
  395. package/lib/esm/resources/klarna_payments.d.ts +1 -0
  396. package/lib/esm/resources/klarna_payments.js +5 -2
  397. package/lib/esm/resources/line_item_options.d.ts +1 -0
  398. package/lib/esm/resources/line_item_options.js +5 -2
  399. package/lib/esm/resources/line_items.d.ts +1 -0
  400. package/lib/esm/resources/line_items.js +5 -2
  401. package/lib/esm/resources/manual_gateways.d.ts +1 -0
  402. package/lib/esm/resources/manual_gateways.js +5 -2
  403. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -0
  404. package/lib/esm/resources/manual_tax_calculators.js +5 -2
  405. package/lib/esm/resources/markets.d.ts +1 -0
  406. package/lib/esm/resources/markets.js +5 -2
  407. package/lib/esm/resources/merchants.d.ts +1 -0
  408. package/lib/esm/resources/merchants.js +5 -2
  409. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -0
  410. package/lib/esm/resources/order_amount_promotion_rules.js +5 -2
  411. package/lib/esm/resources/order_copies.d.ts +1 -0
  412. package/lib/esm/resources/order_copies.js +5 -2
  413. package/lib/esm/resources/order_factories.d.ts +1 -0
  414. package/lib/esm/resources/order_factories.js +5 -2
  415. package/lib/esm/resources/order_subscription_items.d.ts +1 -0
  416. package/lib/esm/resources/order_subscription_items.js +5 -2
  417. package/lib/esm/resources/order_subscriptions.d.ts +1 -0
  418. package/lib/esm/resources/order_subscriptions.js +5 -2
  419. package/lib/esm/resources/order_validation_rules.d.ts +1 -0
  420. package/lib/esm/resources/order_validation_rules.js +5 -2
  421. package/lib/esm/resources/orders.d.ts +1 -0
  422. package/lib/esm/resources/orders.js +5 -2
  423. package/lib/esm/resources/organization.d.ts +1 -0
  424. package/lib/esm/resources/organization.js +5 -2
  425. package/lib/esm/resources/packages.d.ts +1 -0
  426. package/lib/esm/resources/packages.js +5 -2
  427. package/lib/esm/resources/parcel_line_items.d.ts +1 -0
  428. package/lib/esm/resources/parcel_line_items.js +5 -2
  429. package/lib/esm/resources/parcels.d.ts +1 -0
  430. package/lib/esm/resources/parcels.js +5 -2
  431. package/lib/esm/resources/payment_gateways.d.ts +1 -0
  432. package/lib/esm/resources/payment_gateways.js +5 -2
  433. package/lib/esm/resources/payment_methods.d.ts +1 -0
  434. package/lib/esm/resources/payment_methods.js +5 -2
  435. package/lib/esm/resources/payment_options.d.ts +1 -0
  436. package/lib/esm/resources/payment_options.js +5 -2
  437. package/lib/esm/resources/paypal_gateways.d.ts +1 -0
  438. package/lib/esm/resources/paypal_gateways.js +5 -2
  439. package/lib/esm/resources/paypal_payments.d.ts +1 -0
  440. package/lib/esm/resources/paypal_payments.js +5 -2
  441. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -0
  442. package/lib/esm/resources/percentage_discount_promotions.js +5 -2
  443. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -0
  444. package/lib/esm/resources/price_frequency_tiers.js +5 -2
  445. package/lib/esm/resources/price_lists.d.ts +1 -0
  446. package/lib/esm/resources/price_lists.js +5 -2
  447. package/lib/esm/resources/price_tiers.d.ts +1 -0
  448. package/lib/esm/resources/price_tiers.js +5 -2
  449. package/lib/esm/resources/price_volume_tiers.d.ts +1 -0
  450. package/lib/esm/resources/price_volume_tiers.js +5 -2
  451. package/lib/esm/resources/prices.d.ts +1 -0
  452. package/lib/esm/resources/prices.js +5 -2
  453. package/lib/esm/resources/promotion_rules.d.ts +1 -0
  454. package/lib/esm/resources/promotion_rules.js +5 -2
  455. package/lib/esm/resources/promotions.d.ts +1 -0
  456. package/lib/esm/resources/promotions.js +5 -2
  457. package/lib/esm/resources/recurring_order_copies.d.ts +1 -0
  458. package/lib/esm/resources/recurring_order_copies.js +5 -2
  459. package/lib/esm/resources/refunds.d.ts +1 -0
  460. package/lib/esm/resources/refunds.js +5 -2
  461. package/lib/esm/resources/reserved_stocks.d.ts +1 -0
  462. package/lib/esm/resources/reserved_stocks.js +5 -2
  463. package/lib/esm/resources/resource_errors.d.ts +1 -0
  464. package/lib/esm/resources/resource_errors.js +5 -2
  465. package/lib/esm/resources/return_line_items.d.ts +1 -0
  466. package/lib/esm/resources/return_line_items.js +5 -2
  467. package/lib/esm/resources/returns.d.ts +1 -0
  468. package/lib/esm/resources/returns.js +5 -2
  469. package/lib/esm/resources/satispay_gateways.d.ts +1 -0
  470. package/lib/esm/resources/satispay_gateways.js +5 -2
  471. package/lib/esm/resources/satispay_payments.d.ts +1 -0
  472. package/lib/esm/resources/satispay_payments.js +5 -2
  473. package/lib/esm/resources/shipments.d.ts +1 -0
  474. package/lib/esm/resources/shipments.js +5 -2
  475. package/lib/esm/resources/shipping_categories.d.ts +1 -0
  476. package/lib/esm/resources/shipping_categories.js +5 -2
  477. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -0
  478. package/lib/esm/resources/shipping_method_tiers.js +5 -2
  479. package/lib/esm/resources/shipping_methods.d.ts +1 -0
  480. package/lib/esm/resources/shipping_methods.js +5 -2
  481. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -0
  482. package/lib/esm/resources/shipping_weight_tiers.js +5 -2
  483. package/lib/esm/resources/shipping_zones.d.ts +1 -0
  484. package/lib/esm/resources/shipping_zones.js +5 -2
  485. package/lib/esm/resources/sku_list_items.d.ts +1 -0
  486. package/lib/esm/resources/sku_list_items.js +5 -2
  487. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -0
  488. package/lib/esm/resources/sku_list_promotion_rules.js +5 -2
  489. package/lib/esm/resources/sku_lists.d.ts +1 -0
  490. package/lib/esm/resources/sku_lists.js +5 -2
  491. package/lib/esm/resources/sku_options.d.ts +1 -0
  492. package/lib/esm/resources/sku_options.js +5 -2
  493. package/lib/esm/resources/skus.d.ts +1 -0
  494. package/lib/esm/resources/skus.js +5 -2
  495. package/lib/esm/resources/stock_items.d.ts +1 -0
  496. package/lib/esm/resources/stock_items.js +5 -2
  497. package/lib/esm/resources/stock_line_items.d.ts +1 -0
  498. package/lib/esm/resources/stock_line_items.js +5 -2
  499. package/lib/esm/resources/stock_locations.d.ts +1 -0
  500. package/lib/esm/resources/stock_locations.js +5 -2
  501. package/lib/esm/resources/stock_reservations.d.ts +1 -0
  502. package/lib/esm/resources/stock_reservations.js +5 -2
  503. package/lib/esm/resources/stock_transfers.d.ts +1 -0
  504. package/lib/esm/resources/stock_transfers.js +5 -2
  505. package/lib/esm/resources/stripe_gateways.d.ts +1 -0
  506. package/lib/esm/resources/stripe_gateways.js +5 -2
  507. package/lib/esm/resources/stripe_payments.d.ts +1 -0
  508. package/lib/esm/resources/stripe_payments.js +5 -2
  509. package/lib/esm/resources/subscription_models.d.ts +1 -0
  510. package/lib/esm/resources/subscription_models.js +5 -2
  511. package/lib/esm/resources/tags.d.ts +1 -0
  512. package/lib/esm/resources/tags.js +5 -2
  513. package/lib/esm/resources/tax_calculators.d.ts +1 -0
  514. package/lib/esm/resources/tax_calculators.js +5 -2
  515. package/lib/esm/resources/tax_categories.d.ts +1 -0
  516. package/lib/esm/resources/tax_categories.js +5 -2
  517. package/lib/esm/resources/tax_rules.d.ts +1 -0
  518. package/lib/esm/resources/tax_rules.js +5 -2
  519. package/lib/esm/resources/taxjar_accounts.d.ts +1 -0
  520. package/lib/esm/resources/taxjar_accounts.js +5 -2
  521. package/lib/esm/resources/transactions.d.ts +1 -0
  522. package/lib/esm/resources/transactions.js +5 -2
  523. package/lib/esm/resources/versions.d.ts +1 -0
  524. package/lib/esm/resources/versions.js +5 -2
  525. package/lib/esm/resources/voids.d.ts +1 -0
  526. package/lib/esm/resources/voids.js +5 -2
  527. package/lib/esm/resources/webhooks.d.ts +1 -0
  528. package/lib/esm/resources/webhooks.js +5 -2
  529. package/lib/esm/resources/wire_transfers.d.ts +1 -0
  530. package/lib/esm/resources/wire_transfers.js +5 -2
  531. package/lib/esm/static.js +0 -1
  532. package/lib/esm/util.js +1 -27
  533. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  534. package/lib/tsconfig.tsbuildinfo +1 -1
  535. package/package.json +20 -17
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class OrderCopies extends ApiResource {
3
+ static TYPE = 'order_copies';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: OrderCopies.TYPE }, params, options);
5
6
  }
@@ -29,11 +30,13 @@ class OrderCopies extends ApiResource {
29
30
  return resource.type && (resource.type === OrderCopies.TYPE);
30
31
  }
31
32
  relationship(id) {
32
- return ((id === null) || (typeof id === 'string')) ? { id, type: OrderCopies.TYPE } : { id: id.id, type: OrderCopies.TYPE };
33
+ return super.relationshipOneToOne(id);
34
+ }
35
+ relationshipToMany(...ids) {
36
+ return super.relationshipOneToMany(...ids);
33
37
  }
34
38
  type() {
35
39
  return OrderCopies.TYPE;
36
40
  }
37
41
  }
38
- OrderCopies.TYPE = 'order_copies';
39
42
  export default OrderCopies;
@@ -28,6 +28,7 @@ declare class OrderFactories extends ApiResource<OrderFactory> {
28
28
  events(orderFactoryId: string | OrderFactory, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
29
29
  isOrderFactory(resource: any): resource is OrderFactory;
30
30
  relationship(id: string | ResourceId | null): OrderFactoryRel;
31
+ relationshipToMany(...ids: string[]): OrderFactoryRel[];
31
32
  type(): OrderFactoryType;
32
33
  }
33
34
  export default OrderFactories;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class OrderFactories extends ApiResource {
3
+ static TYPE = 'order_factories';
3
4
  async source_order(orderFactoryId, params, options) {
4
5
  const _orderFactoryId = orderFactoryId.id || orderFactoryId;
5
6
  return this.resources.fetch({ type: 'orders' }, `order_factories/${_orderFactoryId}/source_order`, params, options);
@@ -16,11 +17,13 @@ class OrderFactories extends ApiResource {
16
17
  return resource.type && (resource.type === OrderFactories.TYPE);
17
18
  }
18
19
  relationship(id) {
19
- return ((id === null) || (typeof id === 'string')) ? { id, type: OrderFactories.TYPE } : { id: id.id, type: OrderFactories.TYPE };
20
+ return super.relationshipOneToOne(id);
21
+ }
22
+ relationshipToMany(...ids) {
23
+ return super.relationshipOneToMany(...ids);
20
24
  }
21
25
  type() {
22
26
  return OrderFactories.TYPE;
23
27
  }
24
28
  }
25
- OrderFactories.TYPE = 'order_factories';
26
29
  export default OrderFactories;
@@ -62,6 +62,7 @@ declare class OrderSubscriptionItems extends ApiResource<OrderSubscriptionItem>
62
62
  source_line_item(orderSubscriptionItemId: string | OrderSubscriptionItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
63
63
  isOrderSubscriptionItem(resource: any): resource is OrderSubscriptionItem;
64
64
  relationship(id: string | ResourceId | null): OrderSubscriptionItemRel;
65
+ relationshipToMany(...ids: string[]): OrderSubscriptionItemRel[];
65
66
  type(): OrderSubscriptionItemType;
66
67
  }
67
68
  export default OrderSubscriptionItems;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class OrderSubscriptionItems extends ApiResource {
3
+ static TYPE = 'order_subscription_items';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: OrderSubscriptionItems.TYPE }, params, options);
5
6
  }
@@ -21,11 +22,13 @@ class OrderSubscriptionItems extends ApiResource {
21
22
  return resource.type && (resource.type === OrderSubscriptionItems.TYPE);
22
23
  }
23
24
  relationship(id) {
24
- return ((id === null) || (typeof id === 'string')) ? { id, type: OrderSubscriptionItems.TYPE } : { id: id.id, type: OrderSubscriptionItems.TYPE };
25
+ return super.relationshipOneToOne(id);
26
+ }
27
+ relationshipToMany(...ids) {
28
+ return super.relationshipOneToMany(...ids);
25
29
  }
26
30
  type() {
27
31
  return OrderSubscriptionItems.TYPE;
28
32
  }
29
33
  }
30
- OrderSubscriptionItems.TYPE = 'order_subscription_items';
31
34
  export default OrderSubscriptionItems;
@@ -90,6 +90,7 @@ declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
90
90
  _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
91
91
  isOrderSubscription(resource: any): resource is OrderSubscription;
92
92
  relationship(id: string | ResourceId | null): OrderSubscriptionRel;
93
+ relationshipToMany(...ids: string[]): OrderSubscriptionRel[];
93
94
  type(): OrderSubscriptionType;
94
95
  }
95
96
  export default OrderSubscriptions;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class OrderSubscriptions extends ApiResource {
3
+ static TYPE = 'order_subscriptions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
5
6
  }
@@ -66,11 +67,13 @@ class OrderSubscriptions extends ApiResource {
66
67
  return resource.type && (resource.type === OrderSubscriptions.TYPE);
67
68
  }
68
69
  relationship(id) {
69
- return ((id === null) || (typeof id === 'string')) ? { id, type: OrderSubscriptions.TYPE } : { id: id.id, type: OrderSubscriptions.TYPE };
70
+ return super.relationshipOneToOne(id);
71
+ }
72
+ relationshipToMany(...ids) {
73
+ return super.relationshipOneToMany(...ids);
70
74
  }
71
75
  type() {
72
76
  return OrderSubscriptions.TYPE;
73
77
  }
74
78
  }
75
- OrderSubscriptions.TYPE = 'order_subscriptions';
76
79
  export default OrderSubscriptions;
@@ -21,6 +21,7 @@ declare class OrderValidationRules extends ApiResource<OrderValidationRule> {
21
21
  versions(orderValidationRuleId: string | OrderValidationRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
22
22
  isOrderValidationRule(resource: any): resource is OrderValidationRule;
23
23
  relationship(id: string | ResourceId | null): OrderValidationRuleRel;
24
+ relationshipToMany(...ids: string[]): OrderValidationRuleRel[];
24
25
  type(): OrderValidationRuleType;
25
26
  }
26
27
  export default OrderValidationRules;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class OrderValidationRules extends ApiResource {
3
+ static TYPE = 'order_validation_rules';
3
4
  async market(orderValidationRuleId, params, options) {
4
5
  const _orderValidationRuleId = orderValidationRuleId.id || orderValidationRuleId;
5
6
  return this.resources.fetch({ type: 'markets' }, `order_validation_rules/${_orderValidationRuleId}/market`, params, options);
@@ -16,11 +17,13 @@ class OrderValidationRules extends ApiResource {
16
17
  return resource.type && (resource.type === OrderValidationRules.TYPE);
17
18
  }
18
19
  relationship(id) {
19
- return ((id === null) || (typeof id === 'string')) ? { id, type: OrderValidationRules.TYPE } : { id: id.id, type: OrderValidationRules.TYPE };
20
+ return super.relationshipOneToOne(id);
21
+ }
22
+ relationshipToMany(...ids) {
23
+ return super.relationshipOneToMany(...ids);
20
24
  }
21
25
  type() {
22
26
  return OrderValidationRules.TYPE;
23
27
  }
24
28
  }
25
- OrderValidationRules.TYPE = 'order_validation_rules';
26
29
  export default OrderValidationRules;
@@ -383,6 +383,7 @@ declare class Orders extends ApiResource<Order> {
383
383
  _reset_circuit(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
384
384
  isOrder(resource: any): resource is Order;
385
385
  relationship(id: string | ResourceId | null): OrderRel;
386
+ relationshipToMany(...ids: string[]): OrderRel[];
386
387
  type(): OrderType;
387
388
  }
388
389
  export default Orders;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Orders extends ApiResource {
3
+ static TYPE = 'orders';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
5
6
  }
@@ -224,11 +225,13 @@ class Orders extends ApiResource {
224
225
  return resource.type && (resource.type === Orders.TYPE);
225
226
  }
226
227
  relationship(id) {
227
- return ((id === null) || (typeof id === 'string')) ? { id, type: Orders.TYPE } : { id: id.id, type: Orders.TYPE };
228
+ return super.relationshipOneToOne(id);
229
+ }
230
+ relationshipToMany(...ids) {
231
+ return super.relationshipOneToMany(...ids);
228
232
  }
229
233
  type() {
230
234
  return Orders.TYPE;
231
235
  }
232
236
  }
233
- Orders.TYPE = 'orders';
234
237
  export default Orders;
@@ -28,6 +28,7 @@ declare class Organizations extends ApiSingleton<Organization> {
28
28
  static readonly TYPE: OrganizationType;
29
29
  isOrganization(resource: any): resource is Organization;
30
30
  relationship(id: string | ResourceId | null): OrganizationRel;
31
+ relationshipToMany(...ids: string[]): OrganizationRel[];
31
32
  type(): OrganizationType;
32
33
  }
33
34
  export default Organizations;
@@ -1,14 +1,17 @@
1
1
  import { ApiSingleton } from '../resource';
2
2
  class Organizations extends ApiSingleton {
3
+ static TYPE = 'organization';
3
4
  isOrganization(resource) {
4
5
  return resource.type && (resource.type === Organizations.TYPE);
5
6
  }
6
7
  relationship(id) {
7
- return ((id === null) || (typeof id === 'string')) ? { id, type: Organizations.TYPE } : { id: id.id, type: Organizations.TYPE };
8
+ return super.relationshipOneToOne(id);
9
+ }
10
+ relationshipToMany(...ids) {
11
+ return super.relationshipOneToMany(...ids);
8
12
  }
9
13
  type() {
10
14
  return Organizations.TYPE;
11
15
  }
12
16
  }
13
- Organizations.TYPE = 'organization';
14
17
  export default Organizations;
@@ -54,6 +54,7 @@ declare class Packages extends ApiResource<Package> {
54
54
  versions(packageId: string | Package, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
55
55
  isPackage(resource: any): resource is Package;
56
56
  relationship(id: string | ResourceId | null): PackageRel;
57
+ relationshipToMany(...ids: string[]): PackageRel[];
57
58
  type(): PackageType;
58
59
  }
59
60
  export default Packages;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Packages extends ApiResource {
3
+ static TYPE = 'packages';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
5
6
  }
@@ -29,11 +30,13 @@ class Packages extends ApiResource {
29
30
  return resource.type && (resource.type === Packages.TYPE);
30
31
  }
31
32
  relationship(id) {
32
- return ((id === null) || (typeof id === 'string')) ? { id, type: Packages.TYPE } : { id: id.id, type: Packages.TYPE };
33
+ return super.relationshipOneToOne(id);
34
+ }
35
+ relationshipToMany(...ids) {
36
+ return super.relationshipOneToMany(...ids);
33
37
  }
34
38
  type() {
35
39
  return Packages.TYPE;
36
40
  }
37
41
  }
38
- Packages.TYPE = 'packages';
39
42
  export default Packages;
@@ -41,6 +41,7 @@ declare class ParcelLineItems extends ApiResource<ParcelLineItem> {
41
41
  versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
42
42
  isParcelLineItem(resource: any): resource is ParcelLineItem;
43
43
  relationship(id: string | ResourceId | null): ParcelLineItemRel;
44
+ relationshipToMany(...ids: string[]): ParcelLineItemRel[];
44
45
  type(): ParcelLineItemType;
45
46
  }
46
47
  export default ParcelLineItems;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class ParcelLineItems extends ApiResource {
3
+ static TYPE = 'parcel_line_items';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
5
6
  }
@@ -25,11 +26,13 @@ class ParcelLineItems extends ApiResource {
25
26
  return resource.type && (resource.type === ParcelLineItems.TYPE);
26
27
  }
27
28
  relationship(id) {
28
- return ((id === null) || (typeof id === 'string')) ? { id, type: ParcelLineItems.TYPE } : { id: id.id, type: ParcelLineItems.TYPE };
29
+ return super.relationshipOneToOne(id);
30
+ }
31
+ relationshipToMany(...ids) {
32
+ return super.relationshipOneToMany(...ids);
29
33
  }
30
34
  type() {
31
35
  return ParcelLineItems.TYPE;
32
36
  }
33
37
  }
34
- ParcelLineItems.TYPE = 'parcel_line_items';
35
38
  export default ParcelLineItems;
@@ -120,6 +120,7 @@ declare class Parcels extends ApiResource<Parcel> {
120
120
  versions(parcelId: string | Parcel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
121
121
  isParcel(resource: any): resource is Parcel;
122
122
  relationship(id: string | ResourceId | null): ParcelRel;
123
+ relationshipToMany(...ids: string[]): ParcelRel[];
123
124
  type(): ParcelType;
124
125
  }
125
126
  export default Parcels;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Parcels extends ApiResource {
3
+ static TYPE = 'parcels';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
5
6
  }
@@ -37,11 +38,13 @@ class Parcels extends ApiResource {
37
38
  return resource.type && (resource.type === Parcels.TYPE);
38
39
  }
39
40
  relationship(id) {
40
- return ((id === null) || (typeof id === 'string')) ? { id, type: Parcels.TYPE } : { id: id.id, type: Parcels.TYPE };
41
+ return super.relationshipOneToOne(id);
42
+ }
43
+ relationshipToMany(...ids) {
44
+ return super.relationshipOneToMany(...ids);
41
45
  }
42
46
  type() {
43
47
  return Parcels.TYPE;
44
48
  }
45
49
  }
46
- Parcels.TYPE = 'parcels';
47
50
  export default Parcels;
@@ -19,6 +19,7 @@ declare class PaymentGateways extends ApiResource<PaymentGateway> {
19
19
  versions(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
20
20
  isPaymentGateway(resource: any): resource is PaymentGateway;
21
21
  relationship(id: string | ResourceId | null): PaymentGatewayRel;
22
+ relationshipToMany(...ids: string[]): PaymentGatewayRel[];
22
23
  type(): PaymentGatewayType;
23
24
  }
24
25
  export default PaymentGateways;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PaymentGateways extends ApiResource {
3
+ static TYPE = 'payment_gateways';
3
4
  async payment_methods(paymentGatewayId, params, options) {
4
5
  const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
5
6
  return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
@@ -12,11 +13,13 @@ class PaymentGateways extends ApiResource {
12
13
  return resource.type && (resource.type === PaymentGateways.TYPE);
13
14
  }
14
15
  relationship(id) {
15
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentGateways.TYPE } : { id: id.id, type: PaymentGateways.TYPE };
16
+ return super.relationshipOneToOne(id);
17
+ }
18
+ relationshipToMany(...ids) {
19
+ return super.relationshipOneToMany(...ids);
16
20
  }
17
21
  type() {
18
22
  return PaymentGateways.TYPE;
19
23
  }
20
24
  }
21
- PaymentGateways.TYPE = 'payment_gateways';
22
25
  export default PaymentGateways;
@@ -77,6 +77,7 @@ declare class PaymentMethods extends ApiResource<PaymentMethod> {
77
77
  _enable(id: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
78
78
  isPaymentMethod(resource: any): resource is PaymentMethod;
79
79
  relationship(id: string | ResourceId | null): PaymentMethodRel;
80
+ relationshipToMany(...ids: string[]): PaymentMethodRel[];
80
81
  type(): PaymentMethodType;
81
82
  }
82
83
  export default PaymentMethods;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PaymentMethods extends ApiResource {
3
+ static TYPE = 'payment_methods';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
5
6
  }
@@ -35,11 +36,13 @@ class PaymentMethods extends ApiResource {
35
36
  return resource.type && (resource.type === PaymentMethods.TYPE);
36
37
  }
37
38
  relationship(id) {
38
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentMethods.TYPE } : { id: id.id, type: PaymentMethods.TYPE };
39
+ return super.relationshipOneToOne(id);
40
+ }
41
+ relationshipToMany(...ids) {
42
+ return super.relationshipOneToMany(...ids);
39
43
  }
40
44
  type() {
41
45
  return PaymentMethods.TYPE;
42
46
  }
43
47
  }
44
- PaymentMethods.TYPE = 'payment_methods';
45
48
  export default PaymentMethods;
@@ -38,6 +38,7 @@ declare class PaymentOptions extends ApiResource<PaymentOption> {
38
38
  attachments(paymentOptionId: string | PaymentOption, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
39
39
  isPaymentOption(resource: any): resource is PaymentOption;
40
40
  relationship(id: string | ResourceId | null): PaymentOptionRel;
41
+ relationshipToMany(...ids: string[]): PaymentOptionRel[];
41
42
  type(): PaymentOptionType;
42
43
  }
43
44
  export default PaymentOptions;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PaymentOptions extends ApiResource {
3
+ static TYPE = 'payment_options';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PaymentOptions.TYPE }, params, options);
5
6
  }
@@ -21,11 +22,13 @@ class PaymentOptions extends ApiResource {
21
22
  return resource.type && (resource.type === PaymentOptions.TYPE);
22
23
  }
23
24
  relationship(id) {
24
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaymentOptions.TYPE } : { id: id.id, type: PaymentOptions.TYPE };
25
+ return super.relationshipOneToOne(id);
26
+ }
27
+ relationshipToMany(...ids) {
28
+ return super.relationshipOneToMany(...ids);
25
29
  }
26
30
  type() {
27
31
  return PaymentOptions.TYPE;
28
32
  }
29
33
  }
30
- PaymentOptions.TYPE = 'payment_options';
31
34
  export default PaymentOptions;
@@ -35,6 +35,7 @@ declare class PaypalGateways extends ApiResource<PaypalGateway> {
35
35
  paypal_payments(paypalGatewayId: string | PaypalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalPayment>>;
36
36
  isPaypalGateway(resource: any): resource is PaypalGateway;
37
37
  relationship(id: string | ResourceId | null): PaypalGatewayRel;
38
+ relationshipToMany(...ids: string[]): PaypalGatewayRel[];
38
39
  type(): PaypalGatewayType;
39
40
  }
40
41
  export default PaypalGateways;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PaypalGateways extends ApiResource {
3
+ static TYPE = 'paypal_gateways';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PaypalGateways.TYPE }, params, options);
5
6
  }
@@ -25,11 +26,13 @@ class PaypalGateways extends ApiResource {
25
26
  return resource.type && (resource.type === PaypalGateways.TYPE);
26
27
  }
27
28
  relationship(id) {
28
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaypalGateways.TYPE } : { id: id.id, type: PaypalGateways.TYPE };
29
+ return super.relationshipOneToOne(id);
30
+ }
31
+ relationshipToMany(...ids) {
32
+ return super.relationshipOneToMany(...ids);
29
33
  }
30
34
  type() {
31
35
  return PaypalGateways.TYPE;
32
36
  }
33
37
  }
34
- PaypalGateways.TYPE = 'paypal_gateways';
35
38
  export default PaypalGateways;
@@ -50,6 +50,7 @@ declare class PaypalPayments extends ApiResource<PaypalPayment> {
50
50
  versions(paypalPaymentId: string | PaypalPayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
51
51
  isPaypalPayment(resource: any): resource is PaypalPayment;
52
52
  relationship(id: string | ResourceId | null): PaypalPaymentRel;
53
+ relationshipToMany(...ids: string[]): PaypalPaymentRel[];
53
54
  type(): PaypalPaymentType;
54
55
  }
55
56
  export default PaypalPayments;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PaypalPayments extends ApiResource {
3
+ static TYPE = 'paypal_payments';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PaypalPayments.TYPE }, params, options);
5
6
  }
@@ -25,11 +26,13 @@ class PaypalPayments extends ApiResource {
25
26
  return resource.type && (resource.type === PaypalPayments.TYPE);
26
27
  }
27
28
  relationship(id) {
28
- return ((id === null) || (typeof id === 'string')) ? { id, type: PaypalPayments.TYPE } : { id: id.id, type: PaypalPayments.TYPE };
29
+ return super.relationshipOneToOne(id);
30
+ }
31
+ relationshipToMany(...ids) {
32
+ return super.relationshipOneToMany(...ids);
29
33
  }
30
34
  type() {
31
35
  return PaypalPayments.TYPE;
32
36
  }
33
37
  }
34
- PaypalPayments.TYPE = 'paypal_payments';
35
38
  export default PaypalPayments;
@@ -125,6 +125,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
125
125
  _enable(id: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
126
126
  isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
127
127
  relationship(id: string | ResourceId | null): PercentageDiscountPromotionRel;
128
+ relationshipToMany(...ids: string[]): PercentageDiscountPromotionRel[];
128
129
  type(): PercentageDiscountPromotionType;
129
130
  }
130
131
  export default PercentageDiscountPromotions;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PercentageDiscountPromotions extends ApiResource {
3
+ static TYPE = 'percentage_discount_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
5
6
  }
@@ -67,11 +68,13 @@ class PercentageDiscountPromotions extends ApiResource {
67
68
  return resource.type && (resource.type === PercentageDiscountPromotions.TYPE);
68
69
  }
69
70
  relationship(id) {
70
- return ((id === null) || (typeof id === 'string')) ? { id, type: PercentageDiscountPromotions.TYPE } : { id: id.id, type: PercentageDiscountPromotions.TYPE };
71
+ return super.relationshipOneToOne(id);
72
+ }
73
+ relationshipToMany(...ids) {
74
+ return super.relationshipOneToMany(...ids);
71
75
  }
72
76
  type() {
73
77
  return PercentageDiscountPromotions.TYPE;
74
78
  }
75
79
  }
76
- PercentageDiscountPromotions.TYPE = 'percentage_discount_promotions';
77
80
  export default PercentageDiscountPromotions;
@@ -47,6 +47,7 @@ declare class PriceFrequencyTiers extends ApiResource<PriceFrequencyTier> {
47
47
  events(priceFrequencyTierId: string | PriceFrequencyTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
48
48
  isPriceFrequencyTier(resource: any): resource is PriceFrequencyTier;
49
49
  relationship(id: string | ResourceId | null): PriceFrequencyTierRel;
50
+ relationshipToMany(...ids: string[]): PriceFrequencyTierRel[];
50
51
  type(): PriceFrequencyTierType;
51
52
  }
52
53
  export default PriceFrequencyTiers;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PriceFrequencyTiers extends ApiResource {
3
+ static TYPE = 'price_frequency_tiers';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PriceFrequencyTiers.TYPE }, params, options);
5
6
  }
@@ -29,11 +30,13 @@ class PriceFrequencyTiers extends ApiResource {
29
30
  return resource.type && (resource.type === PriceFrequencyTiers.TYPE);
30
31
  }
31
32
  relationship(id) {
32
- return ((id === null) || (typeof id === 'string')) ? { id, type: PriceFrequencyTiers.TYPE } : { id: id.id, type: PriceFrequencyTiers.TYPE };
33
+ return super.relationshipOneToOne(id);
34
+ }
35
+ relationshipToMany(...ids) {
36
+ return super.relationshipOneToMany(...ids);
33
37
  }
34
38
  type() {
35
39
  return PriceFrequencyTiers.TYPE;
36
40
  }
37
41
  }
38
- PriceFrequencyTiers.TYPE = 'price_frequency_tiers';
39
42
  export default PriceFrequencyTiers;
@@ -40,6 +40,7 @@ declare class PriceLists extends ApiResource<PriceList> {
40
40
  versions(priceListId: string | PriceList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
41
41
  isPriceList(resource: any): resource is PriceList;
42
42
  relationship(id: string | ResourceId | null): PriceListRel;
43
+ relationshipToMany(...ids: string[]): PriceListRel[];
43
44
  type(): PriceListType;
44
45
  }
45
46
  export default PriceLists;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PriceLists extends ApiResource {
3
+ static TYPE = 'price_lists';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PriceLists.TYPE }, params, options);
5
6
  }
@@ -25,11 +26,13 @@ class PriceLists extends ApiResource {
25
26
  return resource.type && (resource.type === PriceLists.TYPE);
26
27
  }
27
28
  relationship(id) {
28
- return ((id === null) || (typeof id === 'string')) ? { id, type: PriceLists.TYPE } : { id: id.id, type: PriceLists.TYPE };
29
+ return super.relationshipOneToOne(id);
30
+ }
31
+ relationshipToMany(...ids) {
32
+ return super.relationshipOneToMany(...ids);
29
33
  }
30
34
  type() {
31
35
  return PriceLists.TYPE;
32
36
  }
33
37
  }
34
- PriceLists.TYPE = 'price_lists';
35
38
  export default PriceLists;
@@ -26,6 +26,7 @@ declare class PriceTiers extends ApiResource<PriceTier> {
26
26
  versions(priceTierId: string | PriceTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
27
27
  isPriceTier(resource: any): resource is PriceTier;
28
28
  relationship(id: string | ResourceId | null): PriceTierRel;
29
+ relationshipToMany(...ids: string[]): PriceTierRel[];
29
30
  type(): PriceTierType;
30
31
  }
31
32
  export default PriceTiers;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PriceTiers extends ApiResource {
3
+ static TYPE = 'price_tiers';
3
4
  async price(priceTierId, params, options) {
4
5
  const _priceTierId = priceTierId.id || priceTierId;
5
6
  return this.resources.fetch({ type: 'prices' }, `price_tiers/${_priceTierId}/price`, params, options);
@@ -16,11 +17,13 @@ class PriceTiers extends ApiResource {
16
17
  return resource.type && (resource.type === PriceTiers.TYPE);
17
18
  }
18
19
  relationship(id) {
19
- return ((id === null) || (typeof id === 'string')) ? { id, type: PriceTiers.TYPE } : { id: id.id, type: PriceTiers.TYPE };
20
+ return super.relationshipOneToOne(id);
21
+ }
22
+ relationshipToMany(...ids) {
23
+ return super.relationshipOneToMany(...ids);
20
24
  }
21
25
  type() {
22
26
  return PriceTiers.TYPE;
23
27
  }
24
28
  }
25
- PriceTiers.TYPE = 'price_tiers';
26
29
  export default PriceTiers;
@@ -47,6 +47,7 @@ declare class PriceVolumeTiers extends ApiResource<PriceVolumeTier> {
47
47
  events(priceVolumeTierId: string | PriceVolumeTier, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
48
48
  isPriceVolumeTier(resource: any): resource is PriceVolumeTier;
49
49
  relationship(id: string | ResourceId | null): PriceVolumeTierRel;
50
+ relationshipToMany(...ids: string[]): PriceVolumeTierRel[];
50
51
  type(): PriceVolumeTierType;
51
52
  }
52
53
  export default PriceVolumeTiers;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class PriceVolumeTiers extends ApiResource {
3
+ static TYPE = 'price_volume_tiers';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
5
6
  }
@@ -29,11 +30,13 @@ class PriceVolumeTiers extends ApiResource {
29
30
  return resource.type && (resource.type === PriceVolumeTiers.TYPE);
30
31
  }
31
32
  relationship(id) {
32
- return ((id === null) || (typeof id === 'string')) ? { id, type: PriceVolumeTiers.TYPE } : { id: id.id, type: PriceVolumeTiers.TYPE };
33
+ return super.relationshipOneToOne(id);
34
+ }
35
+ relationshipToMany(...ids) {
36
+ return super.relationshipOneToMany(...ids);
33
37
  }
34
38
  type() {
35
39
  return PriceVolumeTiers.TYPE;
36
40
  }
37
41
  }
38
- PriceVolumeTiers.TYPE = 'price_volume_tiers';
39
42
  export default PriceVolumeTiers;