@commercelayer/sdk 6.0.0-alfa.1 → 6.0.0-alfa.3

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 (505) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/config.d.ts +3 -0
  4. package/lib/cjs/config.js +3 -0
  5. package/lib/cjs/jsonapi.js +10 -5
  6. package/lib/cjs/query.d.ts +1 -1
  7. package/lib/cjs/query.js +18 -1
  8. package/lib/cjs/resource.d.ts +7 -2
  9. package/lib/cjs/resource.js +20 -7
  10. package/lib/cjs/resources/addresses.d.ts +1 -0
  11. package/lib/cjs/resources/addresses.js +4 -1
  12. package/lib/cjs/resources/adjustments.d.ts +1 -0
  13. package/lib/cjs/resources/adjustments.js +4 -1
  14. package/lib/cjs/resources/adyen_gateways.d.ts +1 -0
  15. package/lib/cjs/resources/adyen_gateways.js +4 -1
  16. package/lib/cjs/resources/adyen_payments.d.ts +1 -0
  17. package/lib/cjs/resources/adyen_payments.js +4 -1
  18. package/lib/cjs/resources/application.d.ts +1 -0
  19. package/lib/cjs/resources/application.js +4 -1
  20. package/lib/cjs/resources/attachments.d.ts +1 -0
  21. package/lib/cjs/resources/attachments.js +4 -1
  22. package/lib/cjs/resources/authorizations.d.ts +1 -0
  23. package/lib/cjs/resources/authorizations.js +4 -1
  24. package/lib/cjs/resources/avalara_accounts.d.ts +1 -0
  25. package/lib/cjs/resources/avalara_accounts.js +4 -1
  26. package/lib/cjs/resources/axerve_gateways.d.ts +1 -0
  27. package/lib/cjs/resources/axerve_gateways.js +4 -1
  28. package/lib/cjs/resources/axerve_payments.d.ts +1 -0
  29. package/lib/cjs/resources/axerve_payments.js +4 -1
  30. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -0
  31. package/lib/cjs/resources/billing_info_validation_rules.js +4 -1
  32. package/lib/cjs/resources/bing_geocoders.d.ts +1 -0
  33. package/lib/cjs/resources/bing_geocoders.js +4 -1
  34. package/lib/cjs/resources/braintree_gateways.d.ts +1 -0
  35. package/lib/cjs/resources/braintree_gateways.js +4 -1
  36. package/lib/cjs/resources/braintree_payments.d.ts +1 -0
  37. package/lib/cjs/resources/braintree_payments.js +4 -1
  38. package/lib/cjs/resources/bundles.d.ts +1 -0
  39. package/lib/cjs/resources/bundles.js +4 -1
  40. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -0
  41. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -1
  42. package/lib/cjs/resources/captures.d.ts +1 -0
  43. package/lib/cjs/resources/captures.js +4 -1
  44. package/lib/cjs/resources/carrier_accounts.d.ts +1 -0
  45. package/lib/cjs/resources/carrier_accounts.js +4 -1
  46. package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -0
  47. package/lib/cjs/resources/checkout_com_gateways.js +4 -1
  48. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -0
  49. package/lib/cjs/resources/checkout_com_payments.js +4 -1
  50. package/lib/cjs/resources/cleanups.d.ts +1 -0
  51. package/lib/cjs/resources/cleanups.js +4 -1
  52. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -0
  53. package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -1
  54. package/lib/cjs/resources/coupon_recipients.d.ts +1 -0
  55. package/lib/cjs/resources/coupon_recipients.js +4 -1
  56. package/lib/cjs/resources/coupons.d.ts +1 -0
  57. package/lib/cjs/resources/coupons.js +4 -1
  58. package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -0
  59. package/lib/cjs/resources/custom_promotion_rules.js +4 -1
  60. package/lib/cjs/resources/customer_addresses.d.ts +1 -0
  61. package/lib/cjs/resources/customer_addresses.js +4 -1
  62. package/lib/cjs/resources/customer_groups.d.ts +1 -0
  63. package/lib/cjs/resources/customer_groups.js +4 -1
  64. package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
  65. package/lib/cjs/resources/customer_password_resets.js +4 -1
  66. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -0
  67. package/lib/cjs/resources/customer_payment_sources.js +4 -1
  68. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -0
  69. package/lib/cjs/resources/customer_subscriptions.js +4 -1
  70. package/lib/cjs/resources/customers.d.ts +1 -0
  71. package/lib/cjs/resources/customers.js +4 -1
  72. package/lib/cjs/resources/delivery_lead_times.d.ts +1 -0
  73. package/lib/cjs/resources/delivery_lead_times.js +4 -1
  74. package/lib/cjs/resources/event_callbacks.d.ts +1 -0
  75. package/lib/cjs/resources/event_callbacks.js +4 -1
  76. package/lib/cjs/resources/events.d.ts +4 -3
  77. package/lib/cjs/resources/events.js +8 -5
  78. package/lib/cjs/resources/exports.d.ts +1 -0
  79. package/lib/cjs/resources/exports.js +4 -1
  80. package/lib/cjs/resources/external_gateways.d.ts +1 -0
  81. package/lib/cjs/resources/external_gateways.js +4 -1
  82. package/lib/cjs/resources/external_payments.d.ts +1 -0
  83. package/lib/cjs/resources/external_payments.js +4 -1
  84. package/lib/cjs/resources/external_promotions.d.ts +1 -0
  85. package/lib/cjs/resources/external_promotions.js +4 -1
  86. package/lib/cjs/resources/external_tax_calculators.d.ts +1 -0
  87. package/lib/cjs/resources/external_tax_calculators.js +4 -1
  88. package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -0
  89. package/lib/cjs/resources/fixed_amount_promotions.js +4 -1
  90. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -0
  91. package/lib/cjs/resources/fixed_price_promotions.js +4 -1
  92. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -0
  93. package/lib/cjs/resources/free_gift_promotions.js +4 -1
  94. package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -0
  95. package/lib/cjs/resources/free_shipping_promotions.js +4 -1
  96. package/lib/cjs/resources/geocoders.d.ts +1 -0
  97. package/lib/cjs/resources/geocoders.js +4 -1
  98. package/lib/cjs/resources/gift_card_recipients.d.ts +1 -0
  99. package/lib/cjs/resources/gift_card_recipients.js +4 -1
  100. package/lib/cjs/resources/gift_cards.d.ts +1 -0
  101. package/lib/cjs/resources/gift_cards.js +4 -1
  102. package/lib/cjs/resources/google_geocoders.d.ts +1 -0
  103. package/lib/cjs/resources/google_geocoders.js +4 -1
  104. package/lib/cjs/resources/imports.d.ts +1 -0
  105. package/lib/cjs/resources/imports.js +4 -1
  106. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -0
  107. package/lib/cjs/resources/in_stock_subscriptions.js +4 -1
  108. package/lib/cjs/resources/inventory_models.d.ts +1 -0
  109. package/lib/cjs/resources/inventory_models.js +4 -1
  110. package/lib/cjs/resources/inventory_return_locations.d.ts +1 -0
  111. package/lib/cjs/resources/inventory_return_locations.js +4 -1
  112. package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -0
  113. package/lib/cjs/resources/inventory_stock_locations.js +4 -1
  114. package/lib/cjs/resources/klarna_gateways.d.ts +1 -0
  115. package/lib/cjs/resources/klarna_gateways.js +4 -1
  116. package/lib/cjs/resources/klarna_payments.d.ts +1 -0
  117. package/lib/cjs/resources/klarna_payments.js +4 -1
  118. package/lib/cjs/resources/line_item_options.d.ts +1 -0
  119. package/lib/cjs/resources/line_item_options.js +4 -1
  120. package/lib/cjs/resources/line_items.d.ts +1 -0
  121. package/lib/cjs/resources/line_items.js +4 -1
  122. package/lib/cjs/resources/manual_gateways.d.ts +1 -0
  123. package/lib/cjs/resources/manual_gateways.js +4 -1
  124. package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -0
  125. package/lib/cjs/resources/manual_tax_calculators.js +4 -1
  126. package/lib/cjs/resources/markets.d.ts +1 -0
  127. package/lib/cjs/resources/markets.js +4 -1
  128. package/lib/cjs/resources/merchants.d.ts +1 -0
  129. package/lib/cjs/resources/merchants.js +4 -1
  130. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -0
  131. package/lib/cjs/resources/order_amount_promotion_rules.js +4 -1
  132. package/lib/cjs/resources/order_copies.d.ts +1 -0
  133. package/lib/cjs/resources/order_copies.js +4 -1
  134. package/lib/cjs/resources/order_factories.d.ts +1 -0
  135. package/lib/cjs/resources/order_factories.js +4 -1
  136. package/lib/cjs/resources/order_subscription_items.d.ts +1 -0
  137. package/lib/cjs/resources/order_subscription_items.js +4 -1
  138. package/lib/cjs/resources/order_subscriptions.d.ts +1 -0
  139. package/lib/cjs/resources/order_subscriptions.js +4 -1
  140. package/lib/cjs/resources/order_validation_rules.d.ts +1 -0
  141. package/lib/cjs/resources/order_validation_rules.js +4 -1
  142. package/lib/cjs/resources/orders.d.ts +1 -0
  143. package/lib/cjs/resources/orders.js +4 -1
  144. package/lib/cjs/resources/organization.d.ts +2 -0
  145. package/lib/cjs/resources/organization.js +4 -1
  146. package/lib/cjs/resources/packages.d.ts +1 -0
  147. package/lib/cjs/resources/packages.js +4 -1
  148. package/lib/cjs/resources/parcel_line_items.d.ts +1 -0
  149. package/lib/cjs/resources/parcel_line_items.js +4 -1
  150. package/lib/cjs/resources/parcels.d.ts +1 -0
  151. package/lib/cjs/resources/parcels.js +4 -1
  152. package/lib/cjs/resources/payment_gateways.d.ts +1 -0
  153. package/lib/cjs/resources/payment_gateways.js +4 -1
  154. package/lib/cjs/resources/payment_methods.d.ts +1 -0
  155. package/lib/cjs/resources/payment_methods.js +4 -1
  156. package/lib/cjs/resources/payment_options.d.ts +1 -0
  157. package/lib/cjs/resources/payment_options.js +4 -1
  158. package/lib/cjs/resources/paypal_gateways.d.ts +1 -0
  159. package/lib/cjs/resources/paypal_gateways.js +4 -1
  160. package/lib/cjs/resources/paypal_payments.d.ts +1 -0
  161. package/lib/cjs/resources/paypal_payments.js +4 -1
  162. package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -0
  163. package/lib/cjs/resources/percentage_discount_promotions.js +4 -1
  164. package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -0
  165. package/lib/cjs/resources/price_frequency_tiers.js +4 -1
  166. package/lib/cjs/resources/price_lists.d.ts +1 -0
  167. package/lib/cjs/resources/price_lists.js +4 -1
  168. package/lib/cjs/resources/price_tiers.d.ts +1 -0
  169. package/lib/cjs/resources/price_tiers.js +4 -1
  170. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -0
  171. package/lib/cjs/resources/price_volume_tiers.js +4 -1
  172. package/lib/cjs/resources/prices.d.ts +1 -0
  173. package/lib/cjs/resources/prices.js +4 -1
  174. package/lib/cjs/resources/promotion_rules.d.ts +1 -0
  175. package/lib/cjs/resources/promotion_rules.js +4 -1
  176. package/lib/cjs/resources/promotions.d.ts +1 -0
  177. package/lib/cjs/resources/promotions.js +4 -1
  178. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -0
  179. package/lib/cjs/resources/recurring_order_copies.js +4 -1
  180. package/lib/cjs/resources/refunds.d.ts +1 -0
  181. package/lib/cjs/resources/refunds.js +4 -1
  182. package/lib/cjs/resources/reserved_stocks.d.ts +1 -0
  183. package/lib/cjs/resources/reserved_stocks.js +4 -1
  184. package/lib/cjs/resources/resource_errors.d.ts +1 -0
  185. package/lib/cjs/resources/resource_errors.js +4 -1
  186. package/lib/cjs/resources/return_line_items.d.ts +1 -0
  187. package/lib/cjs/resources/return_line_items.js +4 -1
  188. package/lib/cjs/resources/returns.d.ts +1 -0
  189. package/lib/cjs/resources/returns.js +4 -1
  190. package/lib/cjs/resources/satispay_gateways.d.ts +1 -0
  191. package/lib/cjs/resources/satispay_gateways.js +4 -1
  192. package/lib/cjs/resources/satispay_payments.d.ts +1 -0
  193. package/lib/cjs/resources/satispay_payments.js +4 -1
  194. package/lib/cjs/resources/shipments.d.ts +4 -0
  195. package/lib/cjs/resources/shipments.js +8 -1
  196. package/lib/cjs/resources/shipping_categories.d.ts +1 -0
  197. package/lib/cjs/resources/shipping_categories.js +4 -1
  198. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -0
  199. package/lib/cjs/resources/shipping_method_tiers.js +4 -1
  200. package/lib/cjs/resources/shipping_methods.d.ts +1 -0
  201. package/lib/cjs/resources/shipping_methods.js +4 -1
  202. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -0
  203. package/lib/cjs/resources/shipping_weight_tiers.js +4 -1
  204. package/lib/cjs/resources/shipping_zones.d.ts +1 -0
  205. package/lib/cjs/resources/shipping_zones.js +4 -1
  206. package/lib/cjs/resources/sku_list_items.d.ts +1 -0
  207. package/lib/cjs/resources/sku_list_items.js +4 -1
  208. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -0
  209. package/lib/cjs/resources/sku_list_promotion_rules.js +4 -1
  210. package/lib/cjs/resources/sku_lists.d.ts +1 -0
  211. package/lib/cjs/resources/sku_lists.js +4 -1
  212. package/lib/cjs/resources/sku_options.d.ts +1 -0
  213. package/lib/cjs/resources/sku_options.js +4 -1
  214. package/lib/cjs/resources/skus.d.ts +1 -0
  215. package/lib/cjs/resources/skus.js +4 -1
  216. package/lib/cjs/resources/stock_items.d.ts +1 -0
  217. package/lib/cjs/resources/stock_items.js +4 -1
  218. package/lib/cjs/resources/stock_line_items.d.ts +1 -0
  219. package/lib/cjs/resources/stock_line_items.js +4 -1
  220. package/lib/cjs/resources/stock_locations.d.ts +1 -0
  221. package/lib/cjs/resources/stock_locations.js +4 -1
  222. package/lib/cjs/resources/stock_reservations.d.ts +1 -0
  223. package/lib/cjs/resources/stock_reservations.js +4 -1
  224. package/lib/cjs/resources/stock_transfers.d.ts +1 -0
  225. package/lib/cjs/resources/stock_transfers.js +4 -1
  226. package/lib/cjs/resources/stripe_gateways.d.ts +1 -0
  227. package/lib/cjs/resources/stripe_gateways.js +4 -1
  228. package/lib/cjs/resources/stripe_payments.d.ts +1 -0
  229. package/lib/cjs/resources/stripe_payments.js +4 -1
  230. package/lib/cjs/resources/subscription_models.d.ts +1 -0
  231. package/lib/cjs/resources/subscription_models.js +4 -1
  232. package/lib/cjs/resources/tags.d.ts +1 -0
  233. package/lib/cjs/resources/tags.js +4 -1
  234. package/lib/cjs/resources/tax_calculators.d.ts +1 -0
  235. package/lib/cjs/resources/tax_calculators.js +4 -1
  236. package/lib/cjs/resources/tax_categories.d.ts +1 -0
  237. package/lib/cjs/resources/tax_categories.js +4 -1
  238. package/lib/cjs/resources/tax_rules.d.ts +1 -0
  239. package/lib/cjs/resources/tax_rules.js +4 -1
  240. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -0
  241. package/lib/cjs/resources/taxjar_accounts.js +4 -1
  242. package/lib/cjs/resources/transactions.d.ts +1 -0
  243. package/lib/cjs/resources/transactions.js +4 -1
  244. package/lib/cjs/resources/versions.d.ts +1 -0
  245. package/lib/cjs/resources/versions.js +4 -1
  246. package/lib/cjs/resources/voids.d.ts +1 -0
  247. package/lib/cjs/resources/voids.js +4 -1
  248. package/lib/cjs/resources/webhooks.d.ts +1 -0
  249. package/lib/cjs/resources/webhooks.js +4 -1
  250. package/lib/cjs/resources/wire_transfers.d.ts +1 -0
  251. package/lib/cjs/resources/wire_transfers.js +4 -1
  252. package/lib/esm/commercelayer.d.ts +2 -2
  253. package/lib/esm/commercelayer.js +1 -1
  254. package/lib/esm/config.d.ts +3 -0
  255. package/lib/esm/config.js +3 -0
  256. package/lib/esm/jsonapi.js +10 -5
  257. package/lib/esm/query.d.ts +1 -1
  258. package/lib/esm/query.js +18 -1
  259. package/lib/esm/resource.d.ts +7 -2
  260. package/lib/esm/resource.js +20 -7
  261. package/lib/esm/resources/addresses.d.ts +1 -0
  262. package/lib/esm/resources/addresses.js +4 -1
  263. package/lib/esm/resources/adjustments.d.ts +1 -0
  264. package/lib/esm/resources/adjustments.js +4 -1
  265. package/lib/esm/resources/adyen_gateways.d.ts +1 -0
  266. package/lib/esm/resources/adyen_gateways.js +4 -1
  267. package/lib/esm/resources/adyen_payments.d.ts +1 -0
  268. package/lib/esm/resources/adyen_payments.js +4 -1
  269. package/lib/esm/resources/application.d.ts +1 -0
  270. package/lib/esm/resources/application.js +4 -1
  271. package/lib/esm/resources/attachments.d.ts +1 -0
  272. package/lib/esm/resources/attachments.js +4 -1
  273. package/lib/esm/resources/authorizations.d.ts +1 -0
  274. package/lib/esm/resources/authorizations.js +4 -1
  275. package/lib/esm/resources/avalara_accounts.d.ts +1 -0
  276. package/lib/esm/resources/avalara_accounts.js +4 -1
  277. package/lib/esm/resources/axerve_gateways.d.ts +1 -0
  278. package/lib/esm/resources/axerve_gateways.js +4 -1
  279. package/lib/esm/resources/axerve_payments.d.ts +1 -0
  280. package/lib/esm/resources/axerve_payments.js +4 -1
  281. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
  282. package/lib/esm/resources/billing_info_validation_rules.js +4 -1
  283. package/lib/esm/resources/bing_geocoders.d.ts +1 -0
  284. package/lib/esm/resources/bing_geocoders.js +4 -1
  285. package/lib/esm/resources/braintree_gateways.d.ts +1 -0
  286. package/lib/esm/resources/braintree_gateways.js +4 -1
  287. package/lib/esm/resources/braintree_payments.d.ts +1 -0
  288. package/lib/esm/resources/braintree_payments.js +4 -1
  289. package/lib/esm/resources/bundles.d.ts +1 -0
  290. package/lib/esm/resources/bundles.js +4 -1
  291. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -0
  292. package/lib/esm/resources/buy_x_pay_y_promotions.js +4 -1
  293. package/lib/esm/resources/captures.d.ts +1 -0
  294. package/lib/esm/resources/captures.js +4 -1
  295. package/lib/esm/resources/carrier_accounts.d.ts +1 -0
  296. package/lib/esm/resources/carrier_accounts.js +4 -1
  297. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -0
  298. package/lib/esm/resources/checkout_com_gateways.js +4 -1
  299. package/lib/esm/resources/checkout_com_payments.d.ts +1 -0
  300. package/lib/esm/resources/checkout_com_payments.js +4 -1
  301. package/lib/esm/resources/cleanups.d.ts +1 -0
  302. package/lib/esm/resources/cleanups.js +4 -1
  303. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
  304. package/lib/esm/resources/coupon_codes_promotion_rules.js +4 -1
  305. package/lib/esm/resources/coupon_recipients.d.ts +1 -0
  306. package/lib/esm/resources/coupon_recipients.js +4 -1
  307. package/lib/esm/resources/coupons.d.ts +1 -0
  308. package/lib/esm/resources/coupons.js +4 -1
  309. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -0
  310. package/lib/esm/resources/custom_promotion_rules.js +4 -1
  311. package/lib/esm/resources/customer_addresses.d.ts +1 -0
  312. package/lib/esm/resources/customer_addresses.js +4 -1
  313. package/lib/esm/resources/customer_groups.d.ts +1 -0
  314. package/lib/esm/resources/customer_groups.js +4 -1
  315. package/lib/esm/resources/customer_password_resets.d.ts +1 -0
  316. package/lib/esm/resources/customer_password_resets.js +4 -1
  317. package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
  318. package/lib/esm/resources/customer_payment_sources.js +4 -1
  319. package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
  320. package/lib/esm/resources/customer_subscriptions.js +4 -1
  321. package/lib/esm/resources/customers.d.ts +1 -0
  322. package/lib/esm/resources/customers.js +4 -1
  323. package/lib/esm/resources/delivery_lead_times.d.ts +1 -0
  324. package/lib/esm/resources/delivery_lead_times.js +4 -1
  325. package/lib/esm/resources/event_callbacks.d.ts +1 -0
  326. package/lib/esm/resources/event_callbacks.js +4 -1
  327. package/lib/esm/resources/events.d.ts +4 -3
  328. package/lib/esm/resources/events.js +8 -5
  329. package/lib/esm/resources/exports.d.ts +1 -0
  330. package/lib/esm/resources/exports.js +4 -1
  331. package/lib/esm/resources/external_gateways.d.ts +1 -0
  332. package/lib/esm/resources/external_gateways.js +4 -1
  333. package/lib/esm/resources/external_payments.d.ts +1 -0
  334. package/lib/esm/resources/external_payments.js +4 -1
  335. package/lib/esm/resources/external_promotions.d.ts +1 -0
  336. package/lib/esm/resources/external_promotions.js +4 -1
  337. package/lib/esm/resources/external_tax_calculators.d.ts +1 -0
  338. package/lib/esm/resources/external_tax_calculators.js +4 -1
  339. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -0
  340. package/lib/esm/resources/fixed_amount_promotions.js +4 -1
  341. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -0
  342. package/lib/esm/resources/fixed_price_promotions.js +4 -1
  343. package/lib/esm/resources/free_gift_promotions.d.ts +1 -0
  344. package/lib/esm/resources/free_gift_promotions.js +4 -1
  345. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -0
  346. package/lib/esm/resources/free_shipping_promotions.js +4 -1
  347. package/lib/esm/resources/geocoders.d.ts +1 -0
  348. package/lib/esm/resources/geocoders.js +4 -1
  349. package/lib/esm/resources/gift_card_recipients.d.ts +1 -0
  350. package/lib/esm/resources/gift_card_recipients.js +4 -1
  351. package/lib/esm/resources/gift_cards.d.ts +1 -0
  352. package/lib/esm/resources/gift_cards.js +4 -1
  353. package/lib/esm/resources/google_geocoders.d.ts +1 -0
  354. package/lib/esm/resources/google_geocoders.js +4 -1
  355. package/lib/esm/resources/imports.d.ts +1 -0
  356. package/lib/esm/resources/imports.js +4 -1
  357. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -0
  358. package/lib/esm/resources/in_stock_subscriptions.js +4 -1
  359. package/lib/esm/resources/inventory_models.d.ts +1 -0
  360. package/lib/esm/resources/inventory_models.js +4 -1
  361. package/lib/esm/resources/inventory_return_locations.d.ts +1 -0
  362. package/lib/esm/resources/inventory_return_locations.js +4 -1
  363. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -0
  364. package/lib/esm/resources/inventory_stock_locations.js +4 -1
  365. package/lib/esm/resources/klarna_gateways.d.ts +1 -0
  366. package/lib/esm/resources/klarna_gateways.js +4 -1
  367. package/lib/esm/resources/klarna_payments.d.ts +1 -0
  368. package/lib/esm/resources/klarna_payments.js +4 -1
  369. package/lib/esm/resources/line_item_options.d.ts +1 -0
  370. package/lib/esm/resources/line_item_options.js +4 -1
  371. package/lib/esm/resources/line_items.d.ts +1 -0
  372. package/lib/esm/resources/line_items.js +4 -1
  373. package/lib/esm/resources/manual_gateways.d.ts +1 -0
  374. package/lib/esm/resources/manual_gateways.js +4 -1
  375. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -0
  376. package/lib/esm/resources/manual_tax_calculators.js +4 -1
  377. package/lib/esm/resources/markets.d.ts +1 -0
  378. package/lib/esm/resources/markets.js +4 -1
  379. package/lib/esm/resources/merchants.d.ts +1 -0
  380. package/lib/esm/resources/merchants.js +4 -1
  381. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -0
  382. package/lib/esm/resources/order_amount_promotion_rules.js +4 -1
  383. package/lib/esm/resources/order_copies.d.ts +1 -0
  384. package/lib/esm/resources/order_copies.js +4 -1
  385. package/lib/esm/resources/order_factories.d.ts +1 -0
  386. package/lib/esm/resources/order_factories.js +4 -1
  387. package/lib/esm/resources/order_subscription_items.d.ts +1 -0
  388. package/lib/esm/resources/order_subscription_items.js +4 -1
  389. package/lib/esm/resources/order_subscriptions.d.ts +1 -0
  390. package/lib/esm/resources/order_subscriptions.js +4 -1
  391. package/lib/esm/resources/order_validation_rules.d.ts +1 -0
  392. package/lib/esm/resources/order_validation_rules.js +4 -1
  393. package/lib/esm/resources/orders.d.ts +1 -0
  394. package/lib/esm/resources/orders.js +4 -1
  395. package/lib/esm/resources/organization.d.ts +2 -0
  396. package/lib/esm/resources/organization.js +4 -1
  397. package/lib/esm/resources/packages.d.ts +1 -0
  398. package/lib/esm/resources/packages.js +4 -1
  399. package/lib/esm/resources/parcel_line_items.d.ts +1 -0
  400. package/lib/esm/resources/parcel_line_items.js +4 -1
  401. package/lib/esm/resources/parcels.d.ts +1 -0
  402. package/lib/esm/resources/parcels.js +4 -1
  403. package/lib/esm/resources/payment_gateways.d.ts +1 -0
  404. package/lib/esm/resources/payment_gateways.js +4 -1
  405. package/lib/esm/resources/payment_methods.d.ts +1 -0
  406. package/lib/esm/resources/payment_methods.js +4 -1
  407. package/lib/esm/resources/payment_options.d.ts +1 -0
  408. package/lib/esm/resources/payment_options.js +4 -1
  409. package/lib/esm/resources/paypal_gateways.d.ts +1 -0
  410. package/lib/esm/resources/paypal_gateways.js +4 -1
  411. package/lib/esm/resources/paypal_payments.d.ts +1 -0
  412. package/lib/esm/resources/paypal_payments.js +4 -1
  413. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -0
  414. package/lib/esm/resources/percentage_discount_promotions.js +4 -1
  415. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -0
  416. package/lib/esm/resources/price_frequency_tiers.js +4 -1
  417. package/lib/esm/resources/price_lists.d.ts +1 -0
  418. package/lib/esm/resources/price_lists.js +4 -1
  419. package/lib/esm/resources/price_tiers.d.ts +1 -0
  420. package/lib/esm/resources/price_tiers.js +4 -1
  421. package/lib/esm/resources/price_volume_tiers.d.ts +1 -0
  422. package/lib/esm/resources/price_volume_tiers.js +4 -1
  423. package/lib/esm/resources/prices.d.ts +1 -0
  424. package/lib/esm/resources/prices.js +4 -1
  425. package/lib/esm/resources/promotion_rules.d.ts +1 -0
  426. package/lib/esm/resources/promotion_rules.js +4 -1
  427. package/lib/esm/resources/promotions.d.ts +1 -0
  428. package/lib/esm/resources/promotions.js +4 -1
  429. package/lib/esm/resources/recurring_order_copies.d.ts +1 -0
  430. package/lib/esm/resources/recurring_order_copies.js +4 -1
  431. package/lib/esm/resources/refunds.d.ts +1 -0
  432. package/lib/esm/resources/refunds.js +4 -1
  433. package/lib/esm/resources/reserved_stocks.d.ts +1 -0
  434. package/lib/esm/resources/reserved_stocks.js +4 -1
  435. package/lib/esm/resources/resource_errors.d.ts +1 -0
  436. package/lib/esm/resources/resource_errors.js +4 -1
  437. package/lib/esm/resources/return_line_items.d.ts +1 -0
  438. package/lib/esm/resources/return_line_items.js +4 -1
  439. package/lib/esm/resources/returns.d.ts +1 -0
  440. package/lib/esm/resources/returns.js +4 -1
  441. package/lib/esm/resources/satispay_gateways.d.ts +1 -0
  442. package/lib/esm/resources/satispay_gateways.js +4 -1
  443. package/lib/esm/resources/satispay_payments.d.ts +1 -0
  444. package/lib/esm/resources/satispay_payments.js +4 -1
  445. package/lib/esm/resources/shipments.d.ts +4 -0
  446. package/lib/esm/resources/shipments.js +8 -1
  447. package/lib/esm/resources/shipping_categories.d.ts +1 -0
  448. package/lib/esm/resources/shipping_categories.js +4 -1
  449. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -0
  450. package/lib/esm/resources/shipping_method_tiers.js +4 -1
  451. package/lib/esm/resources/shipping_methods.d.ts +1 -0
  452. package/lib/esm/resources/shipping_methods.js +4 -1
  453. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -0
  454. package/lib/esm/resources/shipping_weight_tiers.js +4 -1
  455. package/lib/esm/resources/shipping_zones.d.ts +1 -0
  456. package/lib/esm/resources/shipping_zones.js +4 -1
  457. package/lib/esm/resources/sku_list_items.d.ts +1 -0
  458. package/lib/esm/resources/sku_list_items.js +4 -1
  459. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -0
  460. package/lib/esm/resources/sku_list_promotion_rules.js +4 -1
  461. package/lib/esm/resources/sku_lists.d.ts +1 -0
  462. package/lib/esm/resources/sku_lists.js +4 -1
  463. package/lib/esm/resources/sku_options.d.ts +1 -0
  464. package/lib/esm/resources/sku_options.js +4 -1
  465. package/lib/esm/resources/skus.d.ts +1 -0
  466. package/lib/esm/resources/skus.js +4 -1
  467. package/lib/esm/resources/stock_items.d.ts +1 -0
  468. package/lib/esm/resources/stock_items.js +4 -1
  469. package/lib/esm/resources/stock_line_items.d.ts +1 -0
  470. package/lib/esm/resources/stock_line_items.js +4 -1
  471. package/lib/esm/resources/stock_locations.d.ts +1 -0
  472. package/lib/esm/resources/stock_locations.js +4 -1
  473. package/lib/esm/resources/stock_reservations.d.ts +1 -0
  474. package/lib/esm/resources/stock_reservations.js +4 -1
  475. package/lib/esm/resources/stock_transfers.d.ts +1 -0
  476. package/lib/esm/resources/stock_transfers.js +4 -1
  477. package/lib/esm/resources/stripe_gateways.d.ts +1 -0
  478. package/lib/esm/resources/stripe_gateways.js +4 -1
  479. package/lib/esm/resources/stripe_payments.d.ts +1 -0
  480. package/lib/esm/resources/stripe_payments.js +4 -1
  481. package/lib/esm/resources/subscription_models.d.ts +1 -0
  482. package/lib/esm/resources/subscription_models.js +4 -1
  483. package/lib/esm/resources/tags.d.ts +1 -0
  484. package/lib/esm/resources/tags.js +4 -1
  485. package/lib/esm/resources/tax_calculators.d.ts +1 -0
  486. package/lib/esm/resources/tax_calculators.js +4 -1
  487. package/lib/esm/resources/tax_categories.d.ts +1 -0
  488. package/lib/esm/resources/tax_categories.js +4 -1
  489. package/lib/esm/resources/tax_rules.d.ts +1 -0
  490. package/lib/esm/resources/tax_rules.js +4 -1
  491. package/lib/esm/resources/taxjar_accounts.d.ts +1 -0
  492. package/lib/esm/resources/taxjar_accounts.js +4 -1
  493. package/lib/esm/resources/transactions.d.ts +1 -0
  494. package/lib/esm/resources/transactions.js +4 -1
  495. package/lib/esm/resources/versions.d.ts +1 -0
  496. package/lib/esm/resources/versions.js +4 -1
  497. package/lib/esm/resources/voids.d.ts +1 -0
  498. package/lib/esm/resources/voids.js +4 -1
  499. package/lib/esm/resources/webhooks.d.ts +1 -0
  500. package/lib/esm/resources/webhooks.js +4 -1
  501. package/lib/esm/resources/wire_transfers.d.ts +1 -0
  502. package/lib/esm/resources/wire_transfers.js +4 -1
  503. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  504. package/lib/tsconfig.tsbuildinfo +1 -1
  505. package/package.json +4 -4
@@ -27,7 +27,10 @@ class SkuListItems extends resource_1.ApiResource {
27
27
  return resource.type && (resource.type === SkuListItems.TYPE);
28
28
  }
29
29
  relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: SkuListItems.TYPE } : { id: id.id, type: SkuListItems.TYPE };
30
+ return super.relationshipOneToOne(id);
31
+ }
32
+ relationshipToMany(...ids) {
33
+ return super.relationshipOneToMany(...ids);
31
34
  }
32
35
  type() {
33
36
  return SkuListItems.TYPE;
@@ -70,6 +70,7 @@ declare class SkuListPromotionRules extends ApiResource<SkuListPromotionRule> {
70
70
  skus(skuListPromotionRuleId: string | SkuListPromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
71
71
  isSkuListPromotionRule(resource: any): resource is SkuListPromotionRule;
72
72
  relationship(id: string | ResourceId | null): SkuListPromotionRuleRel;
73
+ relationshipToMany(...ids: string[]): SkuListPromotionRuleRel[];
73
74
  type(): SkuListPromotionRuleType;
74
75
  }
75
76
  export default SkuListPromotionRules;
@@ -27,7 +27,10 @@ class SkuListPromotionRules extends resource_1.ApiResource {
27
27
  return resource.type && (resource.type === SkuListPromotionRules.TYPE);
28
28
  }
29
29
  relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: SkuListPromotionRules.TYPE } : { id: id.id, type: SkuListPromotionRules.TYPE };
30
+ return super.relationshipOneToOne(id);
31
+ }
32
+ relationshipToMany(...ids) {
33
+ return super.relationshipOneToMany(...ids);
31
34
  }
32
35
  type() {
33
36
  return SkuListPromotionRules.TYPE;
@@ -58,6 +58,7 @@ declare class SkuLists extends ApiResource<SkuList> {
58
58
  versions(skuListId: string | SkuList, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
59
59
  isSkuList(resource: any): resource is SkuList;
60
60
  relationship(id: string | ResourceId | null): SkuListRel;
61
+ relationshipToMany(...ids: string[]): SkuListRel[];
61
62
  type(): SkuListType;
62
63
  }
63
64
  export default SkuLists;
@@ -39,7 +39,10 @@ class SkuLists extends resource_1.ApiResource {
39
39
  return resource.type && (resource.type === SkuLists.TYPE);
40
40
  }
41
41
  relationship(id) {
42
- return ((id === null) || (typeof id === 'string')) ? { id, type: SkuLists.TYPE } : { id: id.id, type: SkuLists.TYPE };
42
+ return super.relationshipOneToOne(id);
43
+ }
44
+ relationshipToMany(...ids) {
45
+ return super.relationshipOneToMany(...ids);
43
46
  }
44
47
  type() {
45
48
  return SkuLists.TYPE;
@@ -65,6 +65,7 @@ declare class SkuOptions extends ApiResource<SkuOption> {
65
65
  versions(skuOptionId: string | SkuOption, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
66
66
  isSkuOption(resource: any): resource is SkuOption;
67
67
  relationship(id: string | ResourceId | null): SkuOptionRel;
68
+ relationshipToMany(...ids: string[]): SkuOptionRel[];
68
69
  type(): SkuOptionType;
69
70
  }
70
71
  export default SkuOptions;
@@ -35,7 +35,10 @@ class SkuOptions extends resource_1.ApiResource {
35
35
  return resource.type && (resource.type === SkuOptions.TYPE);
36
36
  }
37
37
  relationship(id) {
38
- return ((id === null) || (typeof id === 'string')) ? { id, type: SkuOptions.TYPE } : { id: id.id, type: SkuOptions.TYPE };
38
+ return super.relationshipOneToOne(id);
39
+ }
40
+ relationshipToMany(...ids) {
41
+ return super.relationshipOneToMany(...ids);
39
42
  }
40
43
  type() {
41
44
  return SkuOptions.TYPE;
@@ -90,6 +90,7 @@ declare class Skus extends ApiResource<Sku> {
90
90
  versions(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
91
91
  isSku(resource: any): resource is Sku;
92
92
  relationship(id: string | ResourceId | null): SkuRel;
93
+ relationshipToMany(...ids: string[]): SkuRel[];
93
94
  type(): SkuType;
94
95
  }
95
96
  export default Skus;
@@ -55,7 +55,10 @@ class Skus extends resource_1.ApiResource {
55
55
  return resource.type && (resource.type === Skus.TYPE);
56
56
  }
57
57
  relationship(id) {
58
- return ((id === null) || (typeof id === 'string')) ? { id, type: Skus.TYPE } : { id: id.id, type: Skus.TYPE };
58
+ return super.relationshipOneToOne(id);
59
+ }
60
+ relationshipToMany(...ids) {
61
+ return super.relationshipOneToMany(...ids);
59
62
  }
60
63
  type() {
61
64
  return Skus.TYPE;
@@ -53,6 +53,7 @@ declare class StockItems extends ApiResource<StockItem> {
53
53
  versions(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
54
54
  isStockItem(resource: any): resource is StockItem;
55
55
  relationship(id: string | ResourceId | null): StockItemRel;
56
+ relationshipToMany(...ids: string[]): StockItemRel[];
56
57
  type(): StockItemType;
57
58
  }
58
59
  export default StockItems;
@@ -39,7 +39,10 @@ class StockItems extends resource_1.ApiResource {
39
39
  return resource.type && (resource.type === StockItems.TYPE);
40
40
  }
41
41
  relationship(id) {
42
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockItems.TYPE } : { id: id.id, type: StockItems.TYPE };
42
+ return super.relationshipOneToOne(id);
43
+ }
44
+ relationshipToMany(...ids) {
45
+ return super.relationshipOneToMany(...ids);
43
46
  }
44
47
  type() {
45
48
  return StockItems.TYPE;
@@ -67,6 +67,7 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
67
67
  _decrement_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
68
68
  isStockLineItem(resource: any): resource is StockLineItem;
69
69
  relationship(id: string | ResourceId | null): StockLineItemRel;
70
+ relationshipToMany(...ids: string[]): StockLineItemRel[];
70
71
  type(): StockLineItemType;
71
72
  }
72
73
  export default StockLineItems;
@@ -44,7 +44,10 @@ class StockLineItems extends resource_1.ApiResource {
44
44
  return resource.type && (resource.type === StockLineItems.TYPE);
45
45
  }
46
46
  relationship(id) {
47
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockLineItems.TYPE } : { id: id.id, type: StockLineItems.TYPE };
47
+ return super.relationshipOneToOne(id);
48
+ }
49
+ relationshipToMany(...ids) {
50
+ return super.relationshipOneToMany(...ids);
48
51
  }
49
52
  type() {
50
53
  return StockLineItems.TYPE;
@@ -58,6 +58,7 @@ declare class StockLocations extends ApiResource<StockLocation> {
58
58
  versions(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
59
59
  isStockLocation(resource: any): resource is StockLocation;
60
60
  relationship(id: string | ResourceId | null): StockLocationRel;
61
+ relationshipToMany(...ids: string[]): StockLocationRel[];
61
62
  type(): StockLocationType;
62
63
  }
63
64
  export default StockLocations;
@@ -43,7 +43,10 @@ class StockLocations extends resource_1.ApiResource {
43
43
  return resource.type && (resource.type === StockLocations.TYPE);
44
44
  }
45
45
  relationship(id) {
46
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockLocations.TYPE } : { id: id.id, type: StockLocations.TYPE };
46
+ return super.relationshipOneToOne(id);
47
+ }
48
+ relationshipToMany(...ids) {
49
+ return super.relationshipOneToMany(...ids);
47
50
  }
48
51
  type() {
49
52
  return StockLocations.TYPE;
@@ -45,6 +45,7 @@ declare class StockReservations extends ApiResource<StockReservation> {
45
45
  _pending(id: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
46
46
  isStockReservation(resource: any): resource is StockReservation;
47
47
  relationship(id: string | ResourceId | null): StockReservationRel;
48
+ relationshipToMany(...ids: string[]): StockReservationRel[];
48
49
  type(): StockReservationType;
49
50
  }
50
51
  export default StockReservations;
@@ -38,7 +38,10 @@ class StockReservations extends resource_1.ApiResource {
38
38
  return resource.type && (resource.type === StockReservations.TYPE);
39
39
  }
40
40
  relationship(id) {
41
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
41
+ return super.relationshipOneToOne(id);
42
+ }
43
+ relationshipToMany(...ids) {
44
+ return super.relationshipOneToMany(...ids);
42
45
  }
43
46
  type() {
44
47
  return StockReservations.TYPE;
@@ -80,6 +80,7 @@ declare class StockTransfers extends ApiResource<StockTransfer> {
80
80
  _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
81
81
  isStockTransfer(resource: any): resource is StockTransfer;
82
82
  relationship(id: string | ResourceId | null): StockTransferRel;
83
+ relationshipToMany(...ids: string[]): StockTransferRel[];
83
84
  type(): StockTransferType;
84
85
  }
85
86
  export default StockTransfers;
@@ -61,7 +61,10 @@ class StockTransfers extends resource_1.ApiResource {
61
61
  return resource.type && (resource.type === StockTransfers.TYPE);
62
62
  }
63
63
  relationship(id) {
64
- return ((id === null) || (typeof id === 'string')) ? { id, type: StockTransfers.TYPE } : { id: id.id, type: StockTransfers.TYPE };
64
+ return super.relationshipOneToOne(id);
65
+ }
66
+ relationshipToMany(...ids) {
67
+ return super.relationshipOneToMany(...ids);
65
68
  }
66
69
  type() {
67
70
  return StockTransfers.TYPE;
@@ -39,6 +39,7 @@ declare class StripeGateways extends ApiResource<StripeGateway> {
39
39
  stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
40
40
  isStripeGateway(resource: any): resource is StripeGateway;
41
41
  relationship(id: string | ResourceId | null): StripeGatewayRel;
42
+ relationshipToMany(...ids: string[]): StripeGatewayRel[];
42
43
  type(): StripeGatewayType;
43
44
  }
44
45
  export default StripeGateways;
@@ -27,7 +27,10 @@ class StripeGateways extends resource_1.ApiResource {
27
27
  return resource.type && (resource.type === StripeGateways.TYPE);
28
28
  }
29
29
  relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: StripeGateways.TYPE } : { id: id.id, type: StripeGateways.TYPE };
30
+ return super.relationshipOneToOne(id);
31
+ }
32
+ relationshipToMany(...ids) {
33
+ return super.relationshipOneToMany(...ids);
31
34
  }
32
35
  type() {
33
36
  return StripeGateways.TYPE;
@@ -56,6 +56,7 @@ declare class StripePayments extends ApiResource<StripePayment> {
56
56
  _refresh(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
57
57
  isStripePayment(resource: any): resource is StripePayment;
58
58
  relationship(id: string | ResourceId | null): StripePaymentRel;
59
+ relationshipToMany(...ids: string[]): StripePaymentRel[];
59
60
  type(): StripePaymentType;
60
61
  }
61
62
  export default StripePayments;
@@ -33,7 +33,10 @@ class StripePayments extends resource_1.ApiResource {
33
33
  return resource.type && (resource.type === StripePayments.TYPE);
34
34
  }
35
35
  relationship(id) {
36
- return ((id === null) || (typeof id === 'string')) ? { id, type: StripePayments.TYPE } : { id: id.id, type: StripePayments.TYPE };
36
+ return super.relationshipOneToOne(id);
37
+ }
38
+ relationshipToMany(...ids) {
39
+ return super.relationshipOneToMany(...ids);
37
40
  }
38
41
  type() {
39
42
  return StripePayments.TYPE;
@@ -43,6 +43,7 @@ declare class SubscriptionModels extends ApiResource<SubscriptionModel> {
43
43
  attachments(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
44
44
  isSubscriptionModel(resource: any): resource is SubscriptionModel;
45
45
  relationship(id: string | ResourceId | null): SubscriptionModelRel;
46
+ relationshipToMany(...ids: string[]): SubscriptionModelRel[];
46
47
  type(): SubscriptionModelType;
47
48
  }
48
49
  export default SubscriptionModels;
@@ -27,7 +27,10 @@ class SubscriptionModels extends resource_1.ApiResource {
27
27
  return resource.type && (resource.type === SubscriptionModels.TYPE);
28
28
  }
29
29
  relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: SubscriptionModels.TYPE } : { id: id.id, type: SubscriptionModels.TYPE };
30
+ return super.relationshipOneToOne(id);
31
+ }
32
+ relationshipToMany(...ids) {
33
+ return super.relationshipOneToMany(...ids);
31
34
  }
32
35
  type() {
33
36
  return SubscriptionModels.TYPE;
@@ -22,6 +22,7 @@ declare class Tags extends ApiResource<Tag> {
22
22
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
23
23
  isTag(resource: any): resource is Tag;
24
24
  relationship(id: string | ResourceId | null): TagRel;
25
+ relationshipToMany(...ids: string[]): TagRel[];
25
26
  type(): TagType;
26
27
  }
27
28
  export default Tags;
@@ -15,7 +15,10 @@ class Tags extends resource_1.ApiResource {
15
15
  return resource.type && (resource.type === Tags.TYPE);
16
16
  }
17
17
  relationship(id) {
18
- return ((id === null) || (typeof id === 'string')) ? { id, type: Tags.TYPE } : { id: id.id, type: Tags.TYPE };
18
+ return super.relationshipOneToOne(id);
19
+ }
20
+ relationshipToMany(...ids) {
21
+ return super.relationshipOneToMany(...ids);
19
22
  }
20
23
  type() {
21
24
  return Tags.TYPE;
@@ -22,6 +22,7 @@ declare class TaxCalculators extends ApiResource<TaxCalculator> {
22
22
  versions(taxCalculatorId: string | TaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
23
23
  isTaxCalculator(resource: any): resource is TaxCalculator;
24
24
  relationship(id: string | ResourceId | null): TaxCalculatorRel;
25
+ relationshipToMany(...ids: string[]): TaxCalculatorRel[];
25
26
  type(): TaxCalculatorType;
26
27
  }
27
28
  export default TaxCalculators;
@@ -18,7 +18,10 @@ class TaxCalculators extends resource_1.ApiResource {
18
18
  return resource.type && (resource.type === TaxCalculators.TYPE);
19
19
  }
20
20
  relationship(id) {
21
- return ((id === null) || (typeof id === 'string')) ? { id, type: TaxCalculators.TYPE } : { id: id.id, type: TaxCalculators.TYPE };
21
+ return super.relationshipOneToOne(id);
22
+ }
23
+ relationshipToMany(...ids) {
24
+ return super.relationshipOneToMany(...ids);
22
25
  }
23
26
  type() {
24
27
  return TaxCalculators.TYPE;
@@ -57,6 +57,7 @@ declare class TaxCategories extends ApiResource<TaxCategory> {
57
57
  versions(taxCategoryId: string | TaxCategory, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
58
58
  isTaxCategory(resource: any): resource is TaxCategory;
59
59
  relationship(id: string | ResourceId | null): TaxCategoryRel;
60
+ relationshipToMany(...ids: string[]): TaxCategoryRel[];
60
61
  type(): TaxCategoryType;
61
62
  }
62
63
  export default TaxCategories;
@@ -27,7 +27,10 @@ class TaxCategories extends resource_1.ApiResource {
27
27
  return resource.type && (resource.type === TaxCategories.TYPE);
28
28
  }
29
29
  relationship(id) {
30
- return ((id === null) || (typeof id === 'string')) ? { id, type: TaxCategories.TYPE } : { id: id.id, type: TaxCategories.TYPE };
30
+ return super.relationshipOneToOne(id);
31
+ }
32
+ relationshipToMany(...ids) {
33
+ return super.relationshipOneToMany(...ids);
31
34
  }
32
35
  type() {
33
36
  return TaxCategories.TYPE;
@@ -67,6 +67,7 @@ declare class TaxRules extends ApiResource<TaxRule> {
67
67
  versions(taxRuleId: string | TaxRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
68
68
  isTaxRule(resource: any): resource is TaxRule;
69
69
  relationship(id: string | ResourceId | null): TaxRuleRel;
70
+ relationshipToMany(...ids: string[]): TaxRuleRel[];
70
71
  type(): TaxRuleType;
71
72
  }
72
73
  export default TaxRules;
@@ -23,7 +23,10 @@ class TaxRules extends resource_1.ApiResource {
23
23
  return resource.type && (resource.type === TaxRules.TYPE);
24
24
  }
25
25
  relationship(id) {
26
- return ((id === null) || (typeof id === 'string')) ? { id, type: TaxRules.TYPE } : { id: id.id, type: TaxRules.TYPE };
26
+ return super.relationshipOneToOne(id);
27
+ }
28
+ relationshipToMany(...ids) {
29
+ return super.relationshipOneToMany(...ids);
27
30
  }
28
31
  type() {
29
32
  return TaxRules.TYPE;
@@ -41,6 +41,7 @@ declare class TaxjarAccounts extends ApiResource<TaxjarAccount> {
41
41
  tax_categories(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
42
42
  isTaxjarAccount(resource: any): resource is TaxjarAccount;
43
43
  relationship(id: string | ResourceId | null): TaxjarAccountRel;
44
+ relationshipToMany(...ids: string[]): TaxjarAccountRel[];
44
45
  type(): TaxjarAccountType;
45
46
  }
46
47
  export default TaxjarAccounts;
@@ -31,7 +31,10 @@ class TaxjarAccounts extends resource_1.ApiResource {
31
31
  return resource.type && (resource.type === TaxjarAccounts.TYPE);
32
32
  }
33
33
  relationship(id) {
34
- return ((id === null) || (typeof id === 'string')) ? { id, type: TaxjarAccounts.TYPE } : { id: id.id, type: TaxjarAccounts.TYPE };
34
+ return super.relationshipOneToOne(id);
35
+ }
36
+ relationshipToMany(...ids) {
37
+ return super.relationshipOneToMany(...ids);
35
38
  }
36
39
  type() {
37
40
  return TaxjarAccounts.TYPE;
@@ -35,6 +35,7 @@ declare class Transactions extends ApiResource<Transaction> {
35
35
  versions(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
36
36
  isTransaction(resource: any): resource is Transaction;
37
37
  relationship(id: string | ResourceId | null): TransactionRel;
38
+ relationshipToMany(...ids: string[]): TransactionRel[];
38
39
  type(): TransactionType;
39
40
  }
40
41
  export default Transactions;
@@ -22,7 +22,10 @@ class Transactions extends resource_1.ApiResource {
22
22
  return resource.type && (resource.type === Transactions.TYPE);
23
23
  }
24
24
  relationship(id) {
25
- return ((id === null) || (typeof id === 'string')) ? { id, type: Transactions.TYPE } : { id: id.id, type: Transactions.TYPE };
25
+ return super.relationshipOneToOne(id);
26
+ }
27
+ relationshipToMany(...ids) {
28
+ return super.relationshipOneToMany(...ids);
26
29
  }
27
30
  type() {
28
31
  return Transactions.TYPE;
@@ -16,6 +16,7 @@ declare class Versions extends ApiResource<Version> {
16
16
  static readonly TYPE: VersionType;
17
17
  isVersion(resource: any): resource is Version;
18
18
  relationship(id: string | ResourceId | null): VersionRel;
19
+ relationshipToMany(...ids: string[]): VersionRel[];
19
20
  type(): VersionType;
20
21
  }
21
22
  export default Versions;
@@ -6,7 +6,10 @@ class Versions extends resource_1.ApiResource {
6
6
  return resource.type && (resource.type === Versions.TYPE);
7
7
  }
8
8
  relationship(id) {
9
- return ((id === null) || (typeof id === 'string')) ? { id, type: Versions.TYPE } : { id: id.id, type: Versions.TYPE };
9
+ return super.relationshipOneToOne(id);
10
+ }
11
+ relationshipToMany(...ids) {
12
+ return super.relationshipOneToMany(...ids);
10
13
  }
11
14
  type() {
12
15
  return Versions.TYPE;
@@ -38,6 +38,7 @@ declare class Voids extends ApiResource<Void> {
38
38
  reference_authorization(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
39
39
  isVoid(resource: any): resource is Void;
40
40
  relationship(id: string | ResourceId | null): VoidRel;
41
+ relationshipToMany(...ids: string[]): VoidRel[];
41
42
  type(): VoidType;
42
43
  }
43
44
  export default Voids;
@@ -26,7 +26,10 @@ class Voids extends resource_1.ApiResource {
26
26
  return resource.type && (resource.type === Voids.TYPE);
27
27
  }
28
28
  relationship(id) {
29
- return ((id === null) || (typeof id === 'string')) ? { id, type: Voids.TYPE } : { id: id.id, type: Voids.TYPE };
29
+ return super.relationshipOneToOne(id);
30
+ }
31
+ relationshipToMany(...ids) {
32
+ return super.relationshipOneToMany(...ids);
30
33
  }
31
34
  type() {
32
35
  return Voids.TYPE;
@@ -49,6 +49,7 @@ declare class Webhooks extends ApiResource<Webhook> {
49
49
  _reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
50
50
  isWebhook(resource: any): resource is Webhook;
51
51
  relationship(id: string | ResourceId | null): WebhookRel;
52
+ relationshipToMany(...ids: string[]): WebhookRel[];
52
53
  type(): WebhookType;
53
54
  }
54
55
  export default Webhooks;
@@ -32,7 +32,10 @@ class Webhooks extends resource_1.ApiResource {
32
32
  return resource.type && (resource.type === Webhooks.TYPE);
33
33
  }
34
34
  relationship(id) {
35
- return ((id === null) || (typeof id === 'string')) ? { id, type: Webhooks.TYPE } : { id: id.id, type: Webhooks.TYPE };
35
+ return super.relationshipOneToOne(id);
36
+ }
37
+ relationshipToMany(...ids) {
38
+ return super.relationshipOneToMany(...ids);
36
39
  }
37
40
  type() {
38
41
  return Webhooks.TYPE;
@@ -31,6 +31,7 @@ declare class WireTransfers extends ApiResource<WireTransfer> {
31
31
  versions(wireTransferId: string | WireTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
32
32
  isWireTransfer(resource: any): resource is WireTransfer;
33
33
  relationship(id: string | ResourceId | null): WireTransferRel;
34
+ relationshipToMany(...ids: string[]): WireTransferRel[];
34
35
  type(): WireTransferType;
35
36
  }
36
37
  export default WireTransfers;
@@ -23,7 +23,10 @@ class WireTransfers extends resource_1.ApiResource {
23
23
  return resource.type && (resource.type === WireTransfers.TYPE);
24
24
  }
25
25
  relationship(id) {
26
- return ((id === null) || (typeof id === 'string')) ? { id, type: WireTransfers.TYPE } : { id: id.id, type: WireTransfers.TYPE };
26
+ return super.relationshipOneToOne(id);
27
+ }
28
+ relationshipToMany(...ids) {
29
+ return super.relationshipOneToMany(...ids);
27
30
  }
28
31
  type() {
29
32
  return WireTransfers.TYPE;
@@ -2,14 +2,14 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "5.0.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "5.1.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
- readonly openApiSchemaVersion = "5.0.0";
12
+ readonly openApiSchemaVersion = "5.1.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -4,7 +4,7 @@ import ResourceAdapter from './resource';
4
4
  import Debug from './debug';
5
5
  const debug = Debug('commercelayer');
6
6
  // Autogenerated schema version number, do not remove this line
7
- const OPEN_API_SCHEMA_VERSION = '5.0.0';
7
+ const OPEN_API_SCHEMA_VERSION = '5.1.0';
8
8
  export { OPEN_API_SCHEMA_VERSION };
9
9
  class CommerceLayerClient {
10
10
  // static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
@@ -8,5 +8,8 @@ declare const config: {
8
8
  readonly timeout: 15000;
9
9
  readonly requiredAttributes: readonly ["organization", "accessToken"];
10
10
  };
11
+ readonly jsonapi: {
12
+ readonly maxResourceIncluded: 2;
13
+ };
11
14
  };
12
15
  export default config;
package/lib/esm/config.js CHANGED
@@ -9,6 +9,9 @@ const config = {
9
9
  client: {
10
10
  timeout: 15000,
11
11
  requiredAttributes: ['organization', 'accessToken'],
12
+ },
13
+ jsonapi: {
14
+ maxResourceIncluded: 2
12
15
  }
13
16
  };
14
17
  export default config;
@@ -1,4 +1,5 @@
1
1
  import { isResourceId, isResourceType } from './common';
2
+ import config from './config';
2
3
  import Debug from './debug';
3
4
  const debug = Debug('jsonapi');
4
5
  // DENORMALIZATION
@@ -24,7 +25,7 @@ const findIncluded = (rel, included = []) => {
24
25
  });
25
26
  return inc || rel;
26
27
  };
27
- const denormalizeResource = (res, included) => {
28
+ const denormalizeResource = (res, included, chain = []) => {
28
29
  debug('denormalize resource: %O, %o', res, included || {});
29
30
  if (!res)
30
31
  return res;
@@ -37,10 +38,14 @@ const denormalizeResource = (res, included) => {
37
38
  Object.keys(res.relationships).forEach(key => {
38
39
  const rel = res.relationships[key].data;
39
40
  if (rel) {
40
- if (Array.isArray(rel))
41
- resource[key] = rel.map((r) => denormalizeResource(findIncluded(r, included), included));
42
- else
43
- resource[key] = denormalizeResource(findIncluded(rel, included), included);
41
+ if (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded)
42
+ resource[key] = rel;
43
+ else {
44
+ if (Array.isArray(rel))
45
+ resource[key] = rel.map((r) => denormalizeResource(findIncluded(r, included), included, [...chain, r]));
46
+ else
47
+ resource[key] = denormalizeResource(findIncluded(rel, included), included, [...chain, rel]);
48
+ }
44
49
  }
45
50
  else if (rel === null)
46
51
  resource[key] = null;
@@ -1,5 +1,5 @@
1
1
  import type { ResourceType } from "./resource";
2
- type QueryFilter = Record<string, string | number | boolean | object>;
2
+ type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
3
3
  interface QueryParamsRetrieve {
4
4
  include?: string[];
5
5
  fields?: string[] | Record<string, string[]>;
package/lib/esm/query.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import Debug from './debug';
2
+ import { ErrorType, SdkError } from "./error";
2
3
  const debug = Debug('query');
4
+ const arrayFilters = ['_any', '_all', '_in'];
5
+ const objectFilters = ['_jcont'];
3
6
  const isParamsList = (params) => {
4
7
  return params && (params.filters || params.pageNumber || params.pageSize || params.sort);
5
8
  };
@@ -35,7 +38,21 @@ const generateQueryStringParams = (params, res) => {
35
38
  // Filters
36
39
  if (params.filters) {
37
40
  Object.entries(params.filters).forEach(([p, v]) => {
38
- qp[`filter[q][${p}]`] = (typeof v === 'object') ? JSON.stringify(v) : String(v);
41
+ const filter = p.substring(p.lastIndexOf('_'));
42
+ let val;
43
+ if (Array.isArray(v)) {
44
+ if (!arrayFilters.includes(filter))
45
+ throw new SdkError({ message: `Wrong ${filter} filter: Array value is supported only for the following filters: ${arrayFilters.join(', ')}`, type: ErrorType.REQUEST });
46
+ val = v.join(',');
47
+ }
48
+ else if (typeof v === 'object') {
49
+ if (!objectFilters.includes(filter))
50
+ throw new SdkError({ message: `Wrong ${filter} filter: Object value is supported only for the following filters: ${objectFilters.join(', ')}`, type: ErrorType.REQUEST });
51
+ val = JSON.stringify(v);
52
+ }
53
+ else
54
+ val = String(v);
55
+ qp[`filter[q][${p}]`] = val;
39
56
  });
40
57
  }
41
58
  }