@commercelayer/sdk 2.3.13 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/lib/cjs/api.d.ts +1 -1
  2. package/lib/cjs/client.d.ts +1 -1
  3. package/lib/cjs/client.js +1 -1
  4. package/lib/cjs/commercelayer.d.ts +1 -0
  5. package/lib/cjs/commercelayer.js +1 -1
  6. package/lib/cjs/common.js +1 -1
  7. package/lib/cjs/error.js +1 -1
  8. package/lib/cjs/index.js +1 -1
  9. package/lib/cjs/jsonapi.d.ts +0 -2
  10. package/lib/cjs/jsonapi.js +1 -1
  11. package/lib/cjs/model.d.ts +2 -2
  12. package/lib/cjs/query.d.ts +3 -37
  13. package/lib/cjs/query.js +1 -1
  14. package/lib/cjs/resource.d.ts +1 -1
  15. package/lib/cjs/resource.js +1 -1
  16. package/lib/cjs/resources/addresses.d.ts +0 -4
  17. package/lib/cjs/resources/adjustments.d.ts +0 -4
  18. package/lib/cjs/resources/adyen_gateways.d.ts +0 -4
  19. package/lib/cjs/resources/adyen_gateways.js +1 -1
  20. package/lib/cjs/resources/adyen_payments.d.ts +1 -6
  21. package/lib/cjs/resources/adyen_payments.js +1 -1
  22. package/lib/cjs/resources/application.d.ts +0 -4
  23. package/lib/cjs/resources/attachments.d.ts +1 -5
  24. package/lib/cjs/resources/authorizations.d.ts +0 -4
  25. package/lib/cjs/resources/avalara_accounts.d.ts +0 -4
  26. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -5
  27. package/lib/cjs/resources/bing_geocoders.d.ts +0 -4
  28. package/lib/cjs/resources/braintree_gateways.d.ts +0 -4
  29. package/lib/cjs/resources/braintree_gateways.js +1 -1
  30. package/lib/cjs/resources/braintree_payments.d.ts +1 -5
  31. package/lib/cjs/resources/braintree_payments.js +1 -1
  32. package/lib/cjs/resources/bundles.d.ts +1 -5
  33. package/lib/cjs/resources/captures.d.ts +0 -4
  34. package/lib/cjs/resources/carrier_accounts.d.ts +0 -4
  35. package/lib/cjs/resources/checkout_com_gateways.d.ts +0 -4
  36. package/lib/cjs/resources/checkout_com_gateways.js +1 -1
  37. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -6
  38. package/lib/cjs/resources/checkout_com_payments.js +1 -1
  39. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -5
  40. package/lib/cjs/resources/coupon_recipients.d.ts +0 -4
  41. package/lib/cjs/resources/coupons.d.ts +4 -5
  42. package/lib/cjs/resources/customer_addresses.d.ts +2 -6
  43. package/lib/cjs/resources/customer_groups.d.ts +0 -4
  44. package/lib/cjs/resources/customer_password_resets.d.ts +0 -4
  45. package/lib/cjs/resources/customer_payment_sources.d.ts +2 -6
  46. package/lib/cjs/resources/customer_subscriptions.d.ts +0 -4
  47. package/lib/cjs/resources/customers.d.ts +0 -4
  48. package/lib/cjs/resources/delivery_lead_times.d.ts +2 -6
  49. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  50. package/lib/cjs/resources/event_callbacks.d.ts +0 -4
  51. package/lib/cjs/resources/external_gateways.d.ts +0 -4
  52. package/lib/cjs/resources/external_gateways.js +1 -1
  53. package/lib/cjs/resources/external_payments.d.ts +1 -5
  54. package/lib/cjs/resources/external_payments.js +1 -1
  55. package/lib/cjs/resources/external_promotions.d.ts +0 -4
  56. package/lib/cjs/resources/external_promotions.js +1 -1
  57. package/lib/cjs/resources/external_tax_calculators.d.ts +0 -4
  58. package/lib/cjs/resources/external_tax_calculators.js +1 -1
  59. package/lib/cjs/resources/fixed_amount_promotions.d.ts +0 -4
  60. package/lib/cjs/resources/fixed_amount_promotions.js +1 -1
  61. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -5
  62. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -5
  63. package/lib/cjs/resources/free_gift_promotions.js +1 -1
  64. package/lib/cjs/resources/free_shipping_promotions.d.ts +0 -4
  65. package/lib/cjs/resources/geocoders.d.ts +2 -5
  66. package/lib/cjs/resources/geocoders.js +1 -1
  67. package/lib/cjs/resources/gift_card_recipients.d.ts +0 -4
  68. package/lib/cjs/resources/gift_card_recipients.js +1 -1
  69. package/lib/cjs/resources/gift_cards.d.ts +0 -4
  70. package/lib/cjs/resources/google_geocoders.d.ts +0 -4
  71. package/lib/cjs/resources/imports.d.ts +0 -4
  72. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -7
  73. package/lib/cjs/resources/in_stock_subscriptions.js +1 -1
  74. package/lib/cjs/resources/inventory_models.d.ts +0 -4
  75. package/lib/cjs/resources/inventory_return_locations.d.ts +2 -6
  76. package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -6
  77. package/lib/cjs/resources/line_item_options.d.ts +2 -6
  78. package/lib/cjs/resources/line_item_options.js +1 -1
  79. package/lib/cjs/resources/line_items.d.ts +1 -5
  80. package/lib/cjs/resources/line_items.js +1 -1
  81. package/lib/cjs/resources/manual_gateways.d.ts +0 -4
  82. package/lib/cjs/resources/manual_gateways.js +1 -1
  83. package/lib/cjs/resources/manual_tax_calculators.d.ts +0 -4
  84. package/lib/cjs/resources/markets.d.ts +3 -7
  85. package/lib/cjs/resources/merchants.d.ts +1 -5
  86. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -5
  87. package/lib/cjs/resources/order_amount_promotion_rules.js +1 -1
  88. package/lib/cjs/resources/order_copies.d.ts +1 -5
  89. package/lib/cjs/resources/order_subscriptions.d.ts +1 -5
  90. package/lib/cjs/resources/order_validation_rules.d.ts +2 -5
  91. package/lib/cjs/resources/order_validation_rules.js +1 -1
  92. package/lib/cjs/resources/orders.d.ts +0 -4
  93. package/lib/cjs/resources/organization.d.ts +0 -4
  94. package/lib/cjs/resources/organization.js +1 -1
  95. package/lib/cjs/resources/packages.d.ts +1 -5
  96. package/lib/cjs/resources/parcel_line_items.d.ts +2 -6
  97. package/lib/cjs/resources/parcels.d.ts +2 -6
  98. package/lib/cjs/resources/payment_gateways.d.ts +2 -15
  99. package/lib/cjs/resources/payment_gateways.js +1 -1
  100. package/lib/cjs/resources/payment_methods.d.ts +5 -6
  101. package/lib/cjs/resources/payment_methods.js +1 -1
  102. package/lib/cjs/resources/paypal_gateways.d.ts +0 -4
  103. package/lib/cjs/resources/paypal_gateways.js +1 -1
  104. package/lib/cjs/resources/paypal_payments.d.ts +1 -5
  105. package/lib/cjs/resources/paypal_payments.js +1 -1
  106. package/lib/cjs/resources/percentage_discount_promotions.d.ts +0 -4
  107. package/lib/cjs/resources/percentage_discount_promotions.js +1 -1
  108. package/lib/cjs/resources/price_lists.d.ts +0 -4
  109. package/lib/cjs/resources/prices.d.ts +1 -5
  110. package/lib/cjs/resources/promotion_rules.d.ts +2 -5
  111. package/lib/cjs/resources/promotion_rules.js +1 -1
  112. package/lib/cjs/resources/promotions.d.ts +2 -5
  113. package/lib/cjs/resources/promotions.js +1 -1
  114. package/lib/cjs/resources/refunds.d.ts +0 -4
  115. package/lib/cjs/resources/return_line_items.d.ts +2 -6
  116. package/lib/cjs/resources/return_line_items.js +1 -1
  117. package/lib/cjs/resources/returns.d.ts +1 -5
  118. package/lib/cjs/resources/shipments.d.ts +0 -4
  119. package/lib/cjs/resources/shipping_categories.d.ts +0 -4
  120. package/lib/cjs/resources/shipping_methods.d.ts +3 -7
  121. package/lib/cjs/resources/shipping_methods.js +1 -1
  122. package/lib/cjs/resources/shipping_zones.d.ts +0 -4
  123. package/lib/cjs/resources/sku_list_items.d.ts +7 -8
  124. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -5
  125. package/lib/cjs/resources/sku_lists.d.ts +0 -4
  126. package/lib/cjs/resources/sku_lists.js +1 -1
  127. package/lib/cjs/resources/sku_options.d.ts +1 -5
  128. package/lib/cjs/resources/sku_options.js +1 -1
  129. package/lib/cjs/resources/skus.d.ts +1 -5
  130. package/lib/cjs/resources/stock_items.d.ts +1 -5
  131. package/lib/cjs/resources/stock_line_items.d.ts +0 -4
  132. package/lib/cjs/resources/stock_locations.d.ts +1 -5
  133. package/lib/cjs/resources/stock_transfers.d.ts +3 -7
  134. package/lib/cjs/resources/stripe_gateways.d.ts +0 -4
  135. package/lib/cjs/resources/stripe_gateways.js +1 -1
  136. package/lib/cjs/resources/stripe_payments.d.ts +1 -5
  137. package/lib/cjs/resources/stripe_payments.js +1 -1
  138. package/lib/cjs/resources/tax_calculators.d.ts +2 -5
  139. package/lib/cjs/resources/tax_calculators.js +1 -1
  140. package/lib/cjs/resources/tax_categories.d.ts +2 -6
  141. package/lib/cjs/resources/tax_rules.d.ts +1 -5
  142. package/lib/cjs/resources/taxjar_accounts.d.ts +0 -4
  143. package/lib/cjs/resources/transactions.d.ts +2 -5
  144. package/lib/cjs/resources/transactions.js +1 -1
  145. package/lib/cjs/resources/voids.d.ts +0 -4
  146. package/lib/cjs/resources/webhooks.d.ts +0 -4
  147. package/lib/cjs/resources/wire_transfers.d.ts +1 -5
  148. package/lib/cjs/static.js +1 -1
  149. package/lib/esm/api.d.ts +1 -1
  150. package/lib/esm/client.d.ts +1 -1
  151. package/lib/esm/client.js +1 -1
  152. package/lib/esm/commercelayer.d.ts +1 -0
  153. package/lib/esm/commercelayer.js +1 -1
  154. package/lib/esm/common.js +1 -1
  155. package/lib/esm/error.js +1 -1
  156. package/lib/esm/jsonapi.d.ts +0 -2
  157. package/lib/esm/jsonapi.js +1 -1
  158. package/lib/esm/model.d.ts +2 -2
  159. package/lib/esm/query.d.ts +3 -37
  160. package/lib/esm/query.js +1 -1
  161. package/lib/esm/resource.d.ts +1 -1
  162. package/lib/esm/resource.js +1 -1
  163. package/lib/esm/resources/addresses.d.ts +0 -4
  164. package/lib/esm/resources/addresses.js +1 -1
  165. package/lib/esm/resources/adjustments.d.ts +0 -4
  166. package/lib/esm/resources/adjustments.js +1 -1
  167. package/lib/esm/resources/adyen_gateways.d.ts +0 -4
  168. package/lib/esm/resources/adyen_gateways.js +1 -1
  169. package/lib/esm/resources/adyen_payments.d.ts +1 -6
  170. package/lib/esm/resources/adyen_payments.js +1 -1
  171. package/lib/esm/resources/application.d.ts +0 -4
  172. package/lib/esm/resources/application.js +1 -1
  173. package/lib/esm/resources/attachments.d.ts +1 -5
  174. package/lib/esm/resources/attachments.js +1 -1
  175. package/lib/esm/resources/authorizations.d.ts +0 -4
  176. package/lib/esm/resources/authorizations.js +1 -1
  177. package/lib/esm/resources/avalara_accounts.d.ts +0 -4
  178. package/lib/esm/resources/avalara_accounts.js +1 -1
  179. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -5
  180. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  181. package/lib/esm/resources/bing_geocoders.d.ts +0 -4
  182. package/lib/esm/resources/bing_geocoders.js +1 -1
  183. package/lib/esm/resources/braintree_gateways.d.ts +0 -4
  184. package/lib/esm/resources/braintree_gateways.js +1 -1
  185. package/lib/esm/resources/braintree_payments.d.ts +1 -5
  186. package/lib/esm/resources/braintree_payments.js +1 -1
  187. package/lib/esm/resources/bundles.d.ts +1 -5
  188. package/lib/esm/resources/bundles.js +1 -1
  189. package/lib/esm/resources/captures.d.ts +0 -4
  190. package/lib/esm/resources/captures.js +1 -1
  191. package/lib/esm/resources/carrier_accounts.d.ts +0 -4
  192. package/lib/esm/resources/carrier_accounts.js +1 -1
  193. package/lib/esm/resources/checkout_com_gateways.d.ts +0 -4
  194. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  195. package/lib/esm/resources/checkout_com_payments.d.ts +1 -6
  196. package/lib/esm/resources/checkout_com_payments.js +1 -1
  197. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -5
  198. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  199. package/lib/esm/resources/coupon_recipients.d.ts +0 -4
  200. package/lib/esm/resources/coupon_recipients.js +1 -1
  201. package/lib/esm/resources/coupons.d.ts +4 -5
  202. package/lib/esm/resources/coupons.js +1 -1
  203. package/lib/esm/resources/customer_addresses.d.ts +2 -6
  204. package/lib/esm/resources/customer_addresses.js +1 -1
  205. package/lib/esm/resources/customer_groups.d.ts +0 -4
  206. package/lib/esm/resources/customer_groups.js +1 -1
  207. package/lib/esm/resources/customer_password_resets.d.ts +0 -4
  208. package/lib/esm/resources/customer_password_resets.js +1 -1
  209. package/lib/esm/resources/customer_payment_sources.d.ts +2 -6
  210. package/lib/esm/resources/customer_payment_sources.js +1 -1
  211. package/lib/esm/resources/customer_subscriptions.d.ts +0 -4
  212. package/lib/esm/resources/customer_subscriptions.js +1 -1
  213. package/lib/esm/resources/customers.d.ts +0 -4
  214. package/lib/esm/resources/customers.js +1 -1
  215. package/lib/esm/resources/delivery_lead_times.d.ts +2 -6
  216. package/lib/esm/resources/delivery_lead_times.js +1 -1
  217. package/lib/esm/resources/event_callbacks.d.ts +0 -4
  218. package/lib/esm/resources/event_callbacks.js +1 -1
  219. package/lib/esm/resources/external_gateways.d.ts +0 -4
  220. package/lib/esm/resources/external_payments.d.ts +1 -5
  221. package/lib/esm/resources/external_promotions.d.ts +0 -4
  222. package/lib/esm/resources/external_promotions.js +1 -1
  223. package/lib/esm/resources/external_tax_calculators.d.ts +0 -4
  224. package/lib/esm/resources/external_tax_calculators.js +1 -1
  225. package/lib/esm/resources/fixed_amount_promotions.d.ts +0 -4
  226. package/lib/esm/resources/fixed_amount_promotions.js +1 -1
  227. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -5
  228. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  229. package/lib/esm/resources/free_gift_promotions.d.ts +1 -5
  230. package/lib/esm/resources/free_gift_promotions.js +1 -1
  231. package/lib/esm/resources/free_shipping_promotions.d.ts +0 -4
  232. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  233. package/lib/esm/resources/geocoders.d.ts +2 -5
  234. package/lib/esm/resources/geocoders.js +1 -1
  235. package/lib/esm/resources/gift_card_recipients.d.ts +0 -4
  236. package/lib/esm/resources/gift_card_recipients.js +1 -1
  237. package/lib/esm/resources/gift_cards.d.ts +0 -4
  238. package/lib/esm/resources/gift_cards.js +1 -1
  239. package/lib/esm/resources/google_geocoders.d.ts +0 -4
  240. package/lib/esm/resources/google_geocoders.js +1 -1
  241. package/lib/esm/resources/imports.d.ts +0 -4
  242. package/lib/esm/resources/imports.js +1 -1
  243. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -7
  244. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  245. package/lib/esm/resources/inventory_models.d.ts +0 -4
  246. package/lib/esm/resources/inventory_models.js +1 -1
  247. package/lib/esm/resources/inventory_return_locations.d.ts +2 -6
  248. package/lib/esm/resources/inventory_return_locations.js +1 -1
  249. package/lib/esm/resources/inventory_stock_locations.d.ts +2 -6
  250. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  251. package/lib/esm/resources/line_item_options.d.ts +2 -6
  252. package/lib/esm/resources/line_item_options.js +1 -1
  253. package/lib/esm/resources/line_items.d.ts +1 -5
  254. package/lib/esm/resources/line_items.js +1 -1
  255. package/lib/esm/resources/manual_gateways.d.ts +0 -4
  256. package/lib/esm/resources/manual_gateways.js +1 -1
  257. package/lib/esm/resources/manual_tax_calculators.d.ts +0 -4
  258. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  259. package/lib/esm/resources/markets.d.ts +3 -7
  260. package/lib/esm/resources/markets.js +1 -1
  261. package/lib/esm/resources/merchants.d.ts +1 -5
  262. package/lib/esm/resources/merchants.js +1 -1
  263. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -5
  264. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  265. package/lib/esm/resources/order_copies.d.ts +1 -5
  266. package/lib/esm/resources/order_copies.js +1 -1
  267. package/lib/esm/resources/order_subscriptions.d.ts +1 -5
  268. package/lib/esm/resources/order_subscriptions.js +1 -1
  269. package/lib/esm/resources/order_validation_rules.d.ts +2 -5
  270. package/lib/esm/resources/order_validation_rules.js +1 -1
  271. package/lib/esm/resources/orders.d.ts +0 -4
  272. package/lib/esm/resources/orders.js +1 -1
  273. package/lib/esm/resources/organization.d.ts +0 -4
  274. package/lib/esm/resources/organization.js +1 -1
  275. package/lib/esm/resources/packages.d.ts +1 -5
  276. package/lib/esm/resources/packages.js +1 -1
  277. package/lib/esm/resources/parcel_line_items.d.ts +2 -6
  278. package/lib/esm/resources/parcel_line_items.js +1 -1
  279. package/lib/esm/resources/parcels.d.ts +2 -6
  280. package/lib/esm/resources/parcels.js +1 -1
  281. package/lib/esm/resources/payment_gateways.d.ts +2 -15
  282. package/lib/esm/resources/payment_gateways.js +1 -1
  283. package/lib/esm/resources/payment_methods.d.ts +5 -6
  284. package/lib/esm/resources/payment_methods.js +1 -1
  285. package/lib/esm/resources/paypal_gateways.d.ts +0 -4
  286. package/lib/esm/resources/paypal_gateways.js +1 -1
  287. package/lib/esm/resources/paypal_payments.d.ts +1 -5
  288. package/lib/esm/resources/paypal_payments.js +1 -1
  289. package/lib/esm/resources/percentage_discount_promotions.d.ts +0 -4
  290. package/lib/esm/resources/percentage_discount_promotions.js +1 -1
  291. package/lib/esm/resources/price_lists.d.ts +0 -4
  292. package/lib/esm/resources/price_lists.js +1 -1
  293. package/lib/esm/resources/prices.d.ts +1 -5
  294. package/lib/esm/resources/prices.js +1 -1
  295. package/lib/esm/resources/promotion_rules.d.ts +2 -5
  296. package/lib/esm/resources/promotion_rules.js +1 -1
  297. package/lib/esm/resources/promotions.d.ts +2 -5
  298. package/lib/esm/resources/promotions.js +1 -1
  299. package/lib/esm/resources/refunds.d.ts +0 -4
  300. package/lib/esm/resources/refunds.js +1 -1
  301. package/lib/esm/resources/return_line_items.d.ts +2 -6
  302. package/lib/esm/resources/return_line_items.js +1 -1
  303. package/lib/esm/resources/returns.d.ts +1 -5
  304. package/lib/esm/resources/returns.js +1 -1
  305. package/lib/esm/resources/shipments.d.ts +0 -4
  306. package/lib/esm/resources/shipments.js +1 -1
  307. package/lib/esm/resources/shipping_categories.d.ts +0 -4
  308. package/lib/esm/resources/shipping_categories.js +1 -1
  309. package/lib/esm/resources/shipping_methods.d.ts +3 -7
  310. package/lib/esm/resources/shipping_methods.js +1 -1
  311. package/lib/esm/resources/shipping_zones.d.ts +0 -4
  312. package/lib/esm/resources/shipping_zones.js +1 -1
  313. package/lib/esm/resources/sku_list_items.d.ts +7 -8
  314. package/lib/esm/resources/sku_list_items.js +1 -1
  315. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -5
  316. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  317. package/lib/esm/resources/sku_lists.d.ts +0 -4
  318. package/lib/esm/resources/sku_lists.js +1 -1
  319. package/lib/esm/resources/sku_options.d.ts +1 -5
  320. package/lib/esm/resources/sku_options.js +1 -1
  321. package/lib/esm/resources/skus.d.ts +1 -5
  322. package/lib/esm/resources/skus.js +1 -1
  323. package/lib/esm/resources/stock_items.d.ts +1 -5
  324. package/lib/esm/resources/stock_items.js +1 -1
  325. package/lib/esm/resources/stock_line_items.d.ts +0 -4
  326. package/lib/esm/resources/stock_line_items.js +1 -1
  327. package/lib/esm/resources/stock_locations.d.ts +1 -5
  328. package/lib/esm/resources/stock_locations.js +1 -1
  329. package/lib/esm/resources/stock_transfers.d.ts +3 -7
  330. package/lib/esm/resources/stock_transfers.js +1 -1
  331. package/lib/esm/resources/stripe_gateways.d.ts +0 -4
  332. package/lib/esm/resources/stripe_gateways.js +1 -1
  333. package/lib/esm/resources/stripe_payments.d.ts +1 -5
  334. package/lib/esm/resources/stripe_payments.js +1 -1
  335. package/lib/esm/resources/tax_calculators.d.ts +2 -5
  336. package/lib/esm/resources/tax_calculators.js +1 -1
  337. package/lib/esm/resources/tax_categories.d.ts +2 -6
  338. package/lib/esm/resources/tax_categories.js +1 -1
  339. package/lib/esm/resources/tax_rules.d.ts +1 -5
  340. package/lib/esm/resources/tax_rules.js +1 -1
  341. package/lib/esm/resources/taxjar_accounts.d.ts +0 -4
  342. package/lib/esm/resources/taxjar_accounts.js +1 -1
  343. package/lib/esm/resources/transactions.d.ts +2 -5
  344. package/lib/esm/resources/transactions.js +1 -1
  345. package/lib/esm/resources/voids.d.ts +0 -4
  346. package/lib/esm/resources/voids.js +1 -1
  347. package/lib/esm/resources/webhooks.d.ts +0 -4
  348. package/lib/esm/resources/webhooks.js +1 -1
  349. package/lib/esm/resources/wire_transfers.d.ts +1 -5
  350. package/lib/esm/resources/wire_transfers.js +1 -1
  351. package/lib/esm/static.js +1 -1
  352. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  353. package/lib/tsconfig.tsbuildinfo +1 -1
  354. package/package.json +18 -14
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Sku } from './skus';
@@ -38,9 +34,9 @@ interface StockTransfer extends Resource {
38
34
  interface StockTransferCreate extends ResourceCreate {
39
35
  sku_code?: string;
40
36
  quantity: number;
41
- sku?: SkuRel;
42
- origin_stock_location?: StockLocationRel;
43
- destination_stock_location?: StockLocationRel;
37
+ sku: SkuRel;
38
+ origin_stock_location: StockLocationRel;
39
+ destination_stock_location: StockLocationRel;
44
40
  shipment?: ShipmentRel;
45
41
  line_item?: LineItemRel;
46
42
  }
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { PaymentMethod } from './payment_methods';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripeGateways extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripeGateways.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:StripeGateways.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:StripeGateways.TYPE,id:e},s)}isStripeGateway(e){return e.type&&e.type===StripeGateways.TYPE}relationship(e){return typeof e=="string"?{id:e,type:StripeGateways.TYPE}:{id:e.id,type:StripeGateways.TYPE}}type(){return StripeGateways.TYPE}}StripeGateways.TYPE="stripe_gateways",exports.default=StripeGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripeGateways extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripeGateways.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:StripeGateways.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:StripeGateways.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:StripeGateways.TYPE,id:e},s)}isStripeGateway(e){return e.type&&e.type===StripeGateways.TYPE}relationship(e){return typeof e=="string"?{id:e,type:StripeGateways.TYPE}:{id:e.id,type:StripeGateways.TYPE}}type(){return StripeGateways.TYPE}}StripeGateways.TYPE="stripe_gateways",exports.default=StripeGateways;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
@@ -22,7 +18,7 @@ interface StripePayment extends Resource {
22
18
  }
23
19
  interface StripePaymentCreate extends ResourceCreate {
24
20
  options?: object;
25
- order?: OrderRel;
21
+ order: OrderRel;
26
22
  }
27
23
  interface StripePaymentUpdate extends ResourceUpdate {
28
24
  options?: object;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripePayments extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripePayments.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:StripePayments.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:StripePayments.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:StripePayments.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:StripePayments.TYPE,id:e},s)}isStripePayment(e){return e.type&&e.type===StripePayments.TYPE}relationship(e){return typeof e=="string"?{id:e,type:StripePayments.TYPE}:{id:e.id,type:StripePayments.TYPE}}type(){return StripePayments.TYPE}}StripePayments.TYPE="stripe_payments",exports.default=StripePayments;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class StripePayments extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:StripePayments.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:StripePayments.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:StripePayments.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:StripePayments.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:StripePayments.TYPE,id:e},s)}isStripePayment(e){return e.type&&e.type===StripePayments.TYPE}relationship(e){return typeof e=="string"?{id:e,type:StripePayments.TYPE}:{id:e.id,type:StripePayments.TYPE}}type(){return StripePayments.TYPE}}StripePayments.TYPE="stripe_payments",exports.default=StripePayments;
@@ -1,9 +1,5 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList } from '../query';
2
+ import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { TaxCategory } from './tax_categories';
8
4
  import { Market } from './markets';
9
5
  import { Attachment } from './attachments';
@@ -19,6 +15,7 @@ interface TaxCalculator extends Resource {
19
15
  declare class TaxCalculators extends ApiResource {
20
16
  static readonly TYPE: 'tax_calculators';
21
17
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCalculator>>;
18
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCalculator>;
22
19
  isTaxCalculator(resource: any): resource is TaxCalculator;
23
20
  relationship(id: string | ResourceId): TaxCalculatorRel;
24
21
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCalculators extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxCalculators.TYPE},e,t)}isTaxCalculator(e){return e.type&&e.type===TaxCalculators.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxCalculators.TYPE}:{id:e.id,type:TaxCalculators.TYPE}}type(){return TaxCalculators.TYPE}}TaxCalculators.TYPE="tax_calculators",exports.default=TaxCalculators;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCalculators extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxCalculators.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxCalculators.TYPE,id:e},t,r)}isTaxCalculator(e){return e.type&&e.type===TaxCalculators.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxCalculators.TYPE}:{id:e.id,type:TaxCalculators.TYPE}}type(){return TaxCalculators.TYPE}}TaxCalculators.TYPE="tax_calculators",exports.default=TaxCalculators;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Sku } from './skus';
@@ -38,8 +34,8 @@ interface TaxCategory extends Resource {
38
34
  interface TaxCategoryCreate extends ResourceCreate {
39
35
  code: string;
40
36
  sku_code?: string;
41
- sku?: SkuRel;
42
- tax_calculator?: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
37
+ sku: SkuRel;
38
+ tax_calculator: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
43
39
  }
44
40
  interface TaxCategoryUpdate extends ResourceUpdate {
45
41
  code?: string;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { ManualTaxCalculator } from './manual_tax_calculators';
@@ -40,7 +36,7 @@ interface TaxRuleCreate extends ResourceCreate {
40
36
  payment_method_taxable?: boolean;
41
37
  gift_card_taxable?: boolean;
42
38
  adjustment_taxable?: boolean;
43
- manual_tax_calculator?: ManualTaxCalculatorRel;
39
+ manual_tax_calculator: ManualTaxCalculatorRel;
44
40
  }
45
41
  interface TaxRuleUpdate extends ResourceUpdate {
46
42
  name?: string;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { TaxCategory } from './tax_categories';
@@ -1,9 +1,5 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList } from '../query';
2
+ import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
8
4
  declare type TransactionRel = ResourceId & {
9
5
  type: typeof Transactions.TYPE;
@@ -25,6 +21,7 @@ interface Transaction extends Resource {
25
21
  declare class Transactions extends ApiResource {
26
22
  static readonly TYPE: 'transactions';
27
23
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Transaction>>;
24
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Transaction>;
28
25
  isTransaction(resource: any): resource is Transaction;
29
26
  relationship(id: string | ResourceId): TransactionRel;
30
27
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Transactions extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Transactions.TYPE},e,t)}isTransaction(e){return e.type&&e.type===Transactions.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Transactions.TYPE}:{id:e.id,type:Transactions.TYPE}}type(){return Transactions.TYPE}}Transactions.TYPE="transactions",exports.default=Transactions;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Transactions extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Transactions.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:Transactions.TYPE,id:e},t,r)}isTransaction(e){return e.type&&e.type===Transactions.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Transactions.TYPE}:{id:e.id,type:Transactions.TYPE}}type(){return Transactions.TYPE}}Transactions.TYPE="transactions",exports.default=Transactions;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { EventCallback } from './event_callbacks';
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
@@ -15,7 +11,7 @@ interface WireTransfer extends Resource {
15
11
  order?: Order;
16
12
  }
17
13
  interface WireTransferCreate extends ResourceCreate {
18
- order?: OrderRel;
14
+ order: OrderRel;
19
15
  }
20
16
  interface WireTransferUpdate extends ResourceUpdate {
21
17
  order?: OrderRel;
package/lib/cjs/static.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&__createBinding(e,r,t);return __setModuleDefault(e,r),e};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:r=>error_1.SdkError.isSdkError(r),isApiError:r=>error_1.ApiError.isApiError(r)};
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){i===void 0&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){i===void 0&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:e=>error_1.SdkError.isSdkError(e),isApiError:e=>error_1.ApiError.isApiError(e)};
package/lib/esm/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
3
+ * OpenAPI schema, version 2.7.6
4
4
  **/
5
5
  export { default as Addresses } from './resources/addresses';
6
6
  export { default as Adjustments } from './resources/adjustments';
@@ -1,5 +1,5 @@
1
1
  import { Method } from 'axios';
2
- import { DocWithData as JSONApiDocument, ResourceObject as JSONApiResource } from 'jsonapi-typescript';
2
+ import type { DocWithData as JSONApiDocument, ResourceObject as JSONApiResource } from 'jsonapi-typescript';
3
3
  import type { InterceptorManager } from './interceptor';
4
4
  declare type RequestConfig = {
5
5
  timeout?: number;
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var h=this&&this.__classPrivateFieldSet||function(t,e,r,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},c=this&&this.__classPrivateFieldGet||function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},s,o;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as n}from"./error";import l from"./config";const p=(t,e)=>`https://${t.toLowerCase()}.${e||l.default.domain}/api`,y=t=>{let e=new T({message:t.message,type:n.GENERIC});if(u.isAxiosError(t))if(t.response){const r=new g(e);r.type=n.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=n.REQUEST,e.request=t.request):e.type=n.CLIENT;else u.isCancel(t)?e.type=n.CANCEL:e.source=t;throw e};class f{constructor(e){s.set(this,void 0),o.set(this,void 0),this.baseUrl=p(e.organization,e.domain),h(this,s,e.accessToken,"f");const r={timeout:e.timeout||l.client.timeout};h(this,o,u.create(Object.assign({baseURL:this.baseUrl,timeout:l.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+c(this,s,"f")}},r)),"f"),this.interceptors=c(this,o,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new f(e)}config(e){const r=c(this,o,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.organization&&(this.baseUrl=p(e.organization,e.domain)),e.accessToken&&h(this,s,e.accessToken,"f")}async request(e,r,i,a){const m=i?{data:i}:void 0,w=r,v=(a==null?void 0:a.organization)?p(a.organization,a.domain):void 0,E=(a==null?void 0:a.accessToken)?{Authorization:"Bearer "+a.accessToken}:void 0;return c(this,o,"f").request(Object.assign({method:e,baseURL:v,url:w,data:m,headers:E},a)).then(d=>d.data).catch(d=>y(d))}}s=new WeakMap,o=new WeakMap;export default f;
1
+ var l=this&&this.__classPrivateFieldSet||function(t,e,a,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(t,a):r?r.value=a:e.set(t,a),a},c=this&&this.__classPrivateFieldGet||function(t,e,a,s){if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?s:a==="a"?s.call(t):s?s.value:e.get(t)},n,i;import u from"axios";import{SdkError as T,ApiError as y,ErrorType as o}from"./error";import h from"./config";const f=(t,e)=>`https://${t.toLowerCase()}.${e||h.default.domain}/api`,b=t=>{let e=new T({message:t.message,type:o.GENERIC});if(u.isAxiosError(t))if(t.response){const a=new y(e);a.type=o.RESPONSE,a.status=t.response.status,a.code=String(a.status),a.errors=t.response.data.errors,e=a}else t.request?(e.type=o.REQUEST,e.request=t.request):e.type=o.CLIENT;else u.isCancel(t)?e.type=o.CANCEL:e.source=t;throw e};class m{constructor(e){n.set(this,void 0),i.set(this,void 0),this.baseUrl=f(e.organization,e.domain),l(this,n,e.accessToken,"f");const a={timeout:e.timeout||h.client.timeout};l(this,i,u.create(Object.assign({baseURL:this.baseUrl,timeout:h.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+c(this,n,"f")}},a)),"f"),this.interceptors=c(this,i,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new m(e)}config(e){const a=c(this,i,"f").defaults;e.timeout&&(a.timeout=e.timeout),e.organization&&(this.baseUrl=f(e.organization,e.domain)),e.accessToken&&l(this,n,e.accessToken,"f")}async request(e,a,s,r){const w=s?{data:s}:void 0,p=a,E=(r==null?void 0:r.organization)?f(r.organization,r.domain):void 0,v=(r==null?void 0:r.accessToken)?{Authorization:"Bearer "+r.accessToken}:void 0;return c(this,i,"f").request(Object.assign({method:e,baseURL:E,url:p,data:w,headers:v},r)).then(d=>d.data).catch(d=>b(d))}}n=new WeakMap,i=new WeakMap;export default m;
@@ -7,6 +7,7 @@ declare type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
7
7
  declare type CommerceLayerConfig = SdkConfig & ResourcesConfig;
8
8
  declare class CommerceLayerClient {
9
9
  #private;
10
+ static get openApiSchemaVersion(): string;
10
11
  addresses: api.Addresses;
11
12
  adjustments: api.Adjustments;
12
13
  adyen_gateways: api.AdyenGateways;
@@ -1 +1 @@
1
- var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as f}from"./static";import w from"./resource";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new w(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}get currentOrganization(){return s(this,h,"f")}config(i){!i||(i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i))}resources(){return f.resources()}isApiError(i){return f.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const p=o=>new u(o);export default p;
1
+ var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const u="2.7.6";class p{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return u}get currentOrganization(){return s(this,h,"f")}config(i){!i||(i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i))}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new p(o);export default m;
package/lib/esm/common.js CHANGED
@@ -1 +1 @@
1
- const s=e=>e&&e.type&&e.id,p=e=>e&&typeof e.type!="undefined"&&e.type;export{s as isResourceId,p as isResourceType};
1
+ import{resourceList as p}from"./api";const e=t=>t&&t.type&&t.id&&p.includes(t.type),i=t=>t&&typeof t.type!="undefined"&&t.type&&p.includes(t.type);export{e as isResourceId,i as isResourceType};
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class n extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){return this.errors.length>0?this.errors[0]:void 0}}export{t as SdkError,n as ApiError,s as ErrorType};
1
+ var e;(function(t){t.CLIENT="client",t.REQUEST="request",t.RESPONSE="response",t.GENERIC="generic",t.CANCEL="cancel"})(e||(e={}));class r extends Error{constructor(s){super(s.message);this.name=this.constructor.name,this.type=s.type||e.GENERIC}static isSdkError(s){return s&&["SdkError","ApiError"].includes(s.name)&&Object.values(e).includes(s.type)}}class n extends r{constructor(s){super(Object.assign(Object.assign({},s),{type:e.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(s){return r.isSdkError(s)&&s.name==="ApiError"&&s.type===e.RESPONSE}first(){var s;return((s=this.errors)===null||s===void 0?void 0:s.length)>0?this.errors[0]:void 0}}export{r as SdkError,n as ApiError,e as ErrorType};
@@ -1,7 +1,5 @@
1
- import { Value } from 'json-typescript';
2
1
  import { DocWithData, ResourceObject } from 'jsonapi-typescript';
3
2
  import type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource } from './resource';
4
- export type { DocWithData, Value as JSONValue };
5
3
  declare const denormalize: <R extends Resource>(response: DocWithData) => R | R[];
6
4
  declare const normalize: (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)) => ResourceObject;
7
5
  export { denormalize, normalize };
@@ -1 +1 @@
1
- import{isResourceId as o}from"./common";const l=i=>{let e;i.links&&delete i.links;const s=i.data,a=i.included;return Array.isArray(s)?e=s.map(r=>t(r,a)):e=t(s,a),e},d=(i,e=[])=>e.find(s=>i.id===s.id&&i.type===s.type)||i,t=(i,e)=>{const s=Object.assign({id:i.id,type:i.type},i.attributes);return i.relationships&&Object.keys(i.relationships).forEach(a=>{const r=i.relationships[a].data;r?Array.isArray(r)?s[a]=r.map(n=>t(d(n,e),e)):s[a]=t(d(r,e),e):r===null&&(s[a]=null)}),s},c=i=>{const e={},s={};for(const r in i){if(["type","id"].includes(r))continue;const n=i[r];n&&(o(n)||Array.isArray(n)&&o(n[0]))?s[r]={data:n}:e[r]=n}const a={type:i.type,attributes:e,relationships:s};return o(i)&&(a.id=i.id),a};export{l as denormalize,c as normalize};
1
+ import{isResourceId as r}from"./common";const d=t=>{let i;t.links&&delete t.links;const e=t.data,n=t.included;return Array.isArray(e)?i=e.map(a=>o(a,n)):i=o(e,n),i},l=(t,i=[])=>i.find(n=>t.id===n.id&&t.type===n.type)||t,o=(t,i)=>{const e=Object.assign({id:t.id,type:t.type},t.attributes);return t.relationships&&Object.keys(t.relationships).forEach(n=>{const a=t.relationships[n].data;a?Array.isArray(a)?e[n]=a.map(s=>o(l(s,i),i)):e[n]=o(l(a,i),i):a===null&&(e[n]=null)}),e},c=t=>{const i={},e={};for(const a in t){if(["type","id"].includes(a))continue;const s=t[a];s&&(r(s)||Array.isArray(s)&&r(s[0]))?e[a]={data:s}:i[a]=s}const n={type:t.type,attributes:i,relationships:e};return r(t)&&(n.id=t.id),n};export{d as denormalize,c as normalize};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
3
+ * OpenAPI schema, version 2.7.6
4
4
  **/
5
5
  export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
6
6
  export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
@@ -62,7 +62,7 @@ export type { Organization } from './resources/organization';
62
62
  export type { Package, PackageCreate, PackageUpdate } from './resources/packages';
63
63
  export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate } from './resources/parcel_line_items';
64
64
  export type { Parcel, ParcelCreate, ParcelUpdate } from './resources/parcels';
65
- export type { PaymentGateway, PaymentGatewayCreate, PaymentGatewayUpdate } from './resources/payment_gateways';
65
+ export type { PaymentGateway } from './resources/payment_gateways';
66
66
  export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate } from './resources/payment_methods';
67
67
  export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './resources/paypal_gateways';
68
68
  export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
@@ -1,6 +1,7 @@
1
+ import { ResourceType } from "./resource";
1
2
  interface QueryParamsRetrieve {
2
3
  include?: string[];
3
- fields?: {
4
+ fields?: string[] | {
4
5
  [key: string]: string[];
5
6
  };
6
7
  }
@@ -16,42 +17,7 @@ interface QueryParamsList extends QueryParamsRetrieve {
16
17
  }
17
18
  declare type QueryParams = QueryParamsRetrieve | QueryParamsList;
18
19
  export { QueryParamsRetrieve, QueryParamsList, QueryParams };
19
- declare type FilterPredicate = 'blank' | 'cont' | 'cont_all' | 'cont_any' | 'does_not_match' | 'does_not_match_all' | 'does_not_match_any' | 'end' | 'end_all' | 'end_any' | 'eq' | 'false' | 'gt' | 'gt_all' | 'gt_any' | 'gteq' | 'gteq_all' | 'gteq_any' | 'in' | 'lt' | 'lt_all' | 'lt_any' | 'lteq' | 'lteq_all' | 'lteq_any' | 'matches' | 'matches_all' | 'matches_any' | 'not_cont' | 'not_cont_all' | 'not_end' | 'not_end_all' | 'not_end_any' | 'not_eq' | 'not_eq_all' | 'not_in' | 'not_null' | 'not_start' | 'not_start_all' | 'not_start_any' | 'null' | 'present' | 'start' | 'start_all' | 'start_any' | 'true';
20
- declare class QueryBuilderRetrieve {
21
- #private;
22
- constructor(resource?: string);
23
- include(...resources: string[]): QueryBuilderRetrieve;
24
- field(field: string, resource?: string): QueryBuilderRetrieve;
25
- fields(fields: string[], resource?: string): QueryBuilderRetrieve;
26
- clear(): QueryBuilderRetrieve;
27
- build(): QueryParams;
28
- generate(): {
29
- [key: string]: string;
30
- };
31
- }
32
- declare class QueryBuilderList extends QueryBuilderRetrieve {
33
- #private;
34
- constructor(resource?: string);
35
- include(...resources: string[]): QueryBuilderList;
36
- field(field: string, resource?: string): QueryBuilderList;
37
- fields(fields: string[], resource?: string): QueryBuilderList;
38
- pageNumber(num: number): QueryBuilderList;
39
- pageSize(size: number): QueryBuilderList;
40
- page(num: number, size: number): QueryBuilderList;
41
- sort(field: string, descending?: boolean): QueryBuilderList;
42
- filter(field: string | string[], predicate: FilterPredicate, value: string | number | boolean | string[], resource?: string): QueryBuilderList;
43
- clear(): QueryBuilderList;
44
- build(): QueryParams;
45
- generate(): {
46
- [key: string]: string;
47
- };
48
- }
49
- declare class QueryBuilder extends QueryBuilderList {
50
- constructor(resource?: string);
51
- }
52
- export default QueryBuilder;
53
- export { QueryBuilderRetrieve, QueryBuilderList };
54
- declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined) => {
20
+ declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined, res: ResourceType) => {
55
21
  [key: string]: string;
56
22
  };
57
23
  export { generateQueryStringParams };
package/lib/esm/query.js CHANGED
@@ -1 +1 @@
1
- var a=this&&this.__classPrivateFieldSet||function(t,e,s,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(t,s):o?o.value=s:e.set(t,s),s},i=this&&this.__classPrivateFieldGet||function(t,e,s,r){if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(t):r?r.value:e.get(t)},c,h,n,f,u,d,l;const m=t=>t.filters||t.pageNumber||t.pageSize||t.sort;class v{constructor(e){c.set(this,void 0),h.set(this,void 0),n.set(this,void 0),a(this,c,e||"","f")}include(...e){return i(this,h,"f")||a(this,h,[],"f"),i(this,h,"f").push(...e),this}field(e,s){return i(this,n,"f")||a(this,n,{},"f"),s||(s=i(this,c,"f")),i(this,n,"f")[s]||(i(this,n,"f")[s]=[]),i(this,n,"f")[s].push(e),this}fields(e,s){return e.forEach(r=>{this.field(r,s)}),this}clear(){return a(this,h,void 0,"f"),a(this,n,void 0,"f"),this}build(){return{include:i(this,h,"f"),fields:i(this,n,"f")}}generate(){return p(this.build())}}c=new WeakMap,h=new WeakMap,n=new WeakMap;class g extends v{constructor(e){super(e);f.set(this,void 0),u.set(this,void 0),d.set(this,void 0),l.set(this,void 0)}include(...e){return super.include(...e)}field(e,s){return super.field(e,s)}fields(e,s){return super.fields(e,s)}pageNumber(e){return a(this,d,e,"f"),this}pageSize(e){return a(this,l,e,"f"),this}page(e,s){return a(this,d,e,"f"),a(this,l,s,"f"),this}sort(e,s){return i(this,f,"f")||a(this,f,[],"f"),i(this,f,"f").push(`${s?"-":""}${e}`),this}filter(e,s,r,o){i(this,u,"f")||a(this,u,{},"f");const w=o?`${o}_`:"";return i(this,u,"f")[`${Array.isArray(e)?e.map(b=>`${w}${b}`).join("_or_"):w+e}_${s}`]=Array.isArray(r)?r.join(","):r,this}clear(){return super.clear(),a(this,f,void 0,"f"),a(this,u,void 0,"f"),a(this,d,void 0,"f"),a(this,l,void 0,"f"),this}build(){return Object.assign(super.build(),{sort:i(this,f,"f"),filters:i(this,u,"f"),pageNumber:i(this,d,"f"),pageSize:i(this,l,"f")})}generate(){return p(this.build())}}f=new WeakMap,u=new WeakMap,d=new WeakMap,l=new WeakMap;class y extends g{constructor(e){super(e)}}export default y;export{v as QueryBuilderRetrieve,g as QueryBuilderList};const p=t=>{const e={};return t&&(t.include&&(e.include=t.include.join(",")),t.fields&&Object.entries(t.fields).forEach(([s,r])=>{e[`fields[${s}]`]=r.join(",")}),m(t)&&(t.sort&&(Array.isArray(t.sort)?e.sort=t.sort.join(","):e.sort=Object.entries(t.sort).map(([s,r])=>`${r==="desc"?"-":""}${s}`).join(",")),t.pageNumber&&(e["page[number]"]=String(t.pageNumber)),t.pageSize&&(e["page[size]"]=String(t.pageSize)),t.filters&&Object.entries(t.filters).forEach(([s,r])=>{e[`filter[q][${s}]`]=String(r)}))),e};export{p as generateQueryStringParams};
1
+ const r=e=>e.filters||e.pageNumber||e.pageSize||e.sort,o=(e,n)=>{const i={};return e&&(e.include&&(i.include=e.include.join(",")),e.fields&&(Array.isArray(e.fields)&&(e.fields={[n.type]:e.fields}),Object.entries(e.fields).forEach(([t,f])=>{i[`fields[${t}]`]=f.join(",")})),r(e)&&(e.sort&&(Array.isArray(e.sort)?i.sort=e.sort.join(","):i.sort=Object.entries(e.sort).map(([t,f])=>`${f==="desc"?"-":""}${t}`).join(",")),e.pageNumber&&(i["page[number]"]=String(e.pageNumber)),e.pageSize&&(i["page[size]"]=String(e.pageSize)),e.filters&&Object.entries(e.filters).forEach(([t,f])=>{i[`filter[q][${t}]`]=String(f)}))),i};export{o as generateQueryStringParams};
@@ -1,8 +1,8 @@
1
1
  import { ApiClientConfig, ApiClientInitConfig } from './client';
2
- import { JSONValue } from './jsonapi';
3
2
  import { QueryParamsRetrieve, QueryParamsList } from './query';
4
3
  import { ResourceTypeLock } from './api';
5
4
  import { InterceptorManager } from './interceptor';
5
+ import { Value as JSONValue } from 'json-typescript';
6
6
  declare type Metadata = {
7
7
  [key: string]: JSONValue;
8
8
  };
@@ -1 +1 @@
1
- var f=this&&this.__classPrivateFieldSet||function(a,e,r,t,s){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?s.call(a,r):s?s.value=r:e.set(a,r),r},o=this&&this.__classPrivateFieldGet||function(a,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!t:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(a):t?t.value:e.get(a)},n,p;import w from"./client";import{denormalize as l,normalize as h}from"./jsonapi";import{generateQueryStringParams as u}from"./query";import m from"./config";class b extends Array{constructor(e,r){super(...r||[]);this.meta=e}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(e){return this.length&&e>=0?this[e]:void 0}}class y{constructor(e){n.set(this,void 0),p.set(this,{}),f(this,n,w.create(e),"f"),this.config(e)}get interceptors(){return o(this,n,"f").interceptors}config(e){!e||o(this,n,"f").config(e)}async singleton(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=await o(this,n,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:s}));return l(i)}async retrieve(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=await o(this,n,"f").request("get",`${e.type}/${e.id}`,void 0,Object.assign(Object.assign({},t),{params:s}));return l(i)}async list(e,r,t){var s,i;const c=u(r);(t==null?void 0:t.params)&&Object.assign(c,t==null?void 0:t.params);const d=await o(this,n,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:c})),g=l(d),v={pageCount:Number((s=d.meta)===null||s===void 0?void 0:s.page_count),recordCount:Number((i=d.meta)===null||i===void 0?void 0:i.record_count),currentPage:(r==null?void 0:r.pageNumber)||m.default.pageNumber,recordsPerPage:(r==null?void 0:r.pageSize)||m.default.pageSize};return new b(v,g)}async create(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=h(e),c=await o(this,n,"f").request("post",e.type,i,Object.assign(Object.assign({},t),{params:s}));return l(c)}async update(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=h(e),c=await o(this,n,"f").request("patch",`${e.type}/${e.id}`,i,Object.assign(Object.assign({},t),{params:s}));return l(c)}async delete(e,r){await o(this,n,"f").request("delete",`${e.type}/${e.id}`,void 0,r)}}n=new WeakMap,p=new WeakMap;class j{constructor(e){this.resources=e}}export default y;export{j as ApiResource};
1
+ var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},c=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as m}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import g from"./config";class b extends Array{constructor(t,a){super(...a||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return c(this,n,"f").interceptors}config(t){!t||c(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await c(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await c(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const d=o(a,t);(e==null?void 0:e.params)&&Object.assign(d,e==null?void 0:e.params);const l=await c(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:d})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:(a==null?void 0:a.pageNumber)||g.default.pageNumber,recordsPerPage:(a==null?void 0:a.pageSize)||g.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=m(t),d=await c(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(d)}async update(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=m(t),d=await c(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(d)}async delete(t,a){await c(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Geocoder } from './geocoders';
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="addresses";export default s;
1
+ import{ApiResource as a}from"../resource";class e extends a{async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async create(t,r,i){return this.resources.create(Object.assign(Object.assign({},t),{type:e.TYPE}),r,i)}async retrieve(t,r,i){return this.resources.retrieve({type:e.TYPE,id:t},r,i)}async update(t,r,i){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),r,i)}async delete(t,r){await this.resources.delete({type:e.TYPE,id:t},r)}isAddress(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="addresses";export default e;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  declare type AdjustmentRel = ResourceId & {
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdjustment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adjustments";export default t;
1
+ import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isAdjustment(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="adjustments";export default r;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { PaymentMethod } from './payment_methods';
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdyenGateway(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adyen_gateways";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_gateways";export default t;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
@@ -22,13 +18,12 @@ interface AdyenPayment extends Resource {
22
18
  payment_gateway?: PaymentGateway;
23
19
  }
24
20
  interface AdyenPaymentCreate extends ResourceCreate {
25
- order?: OrderRel;
21
+ order: OrderRel;
26
22
  }
27
23
  interface AdyenPaymentUpdate extends ResourceUpdate {
28
24
  payment_request_data?: object;
29
25
  payment_request_details?: object;
30
26
  payment_response?: object;
31
- _authorize?: boolean;
32
27
  _details?: boolean;
33
28
  order?: OrderRel;
34
29
  }
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdyenPayment(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adyen_payments";export default s;
1
+ import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenPayment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_payments";export default t;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourcesConfig, ResourceId } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsRetrieve } from '../query';
7
3
  declare type ApplicationRel = ResourceId & {
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async retrieve(e,r){return this.resources.singleton({type:t.TYPE},e,r)}isApplication(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="application";export default t;
1
+ import{ApiResource as n}from"../resource";class t extends n{async retrieve(e,r){return this.resources.singleton({type:t.TYPE},e,r)}isApplication(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="application";export default t;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Bundle } from './bundles';
@@ -137,7 +133,7 @@ interface AttachmentCreate extends ResourceCreate {
137
133
  name: string;
138
134
  description?: string;
139
135
  url?: string;
140
- attachable?: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
136
+ attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
141
137
  }
142
138
  interface AttachmentUpdate extends ResourceUpdate {
143
139
  name?: string;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isAttachment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="attachments";export default t;
1
+ import{ApiResource as i}from"../resource";class r extends i{async list(e,s){return this.resources.list({type:r.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:r.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:r.TYPE,id:e},s)}isAttachment(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="attachments";export default r;
@@ -1,7 +1,3 @@
1
- /**
2
- * ©2021 Commerce Layer Inc.
3
- * Source code generated automatically by SDK codegen from OpenAPI schema 2.7.4
4
- **/
5
1
  import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
6
2
  import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
7
3
  import { Order } from './orders';
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class e extends i{async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async retrieve(t,r,s){return this.resources.retrieve({type:e.TYPE,id:t},r,s)}async update(t,r,s){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),r,s)}isAuthorization(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="authorizations";export default e;
1
+ import{ApiResource as p}from"../resource";class t extends p{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}isAuthorization(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="authorizations";export default t;