@commercelayer/sdk 3.3.0 → 3.5.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 (398) hide show
  1. package/lib/cjs/client.js +1 -1
  2. package/lib/cjs/jsonapi.js +1 -1
  3. package/lib/cjs/resource.d.ts +6 -2
  4. package/lib/cjs/resources/addresses.d.ts +5 -5
  5. package/lib/cjs/resources/addresses.js +1 -1
  6. package/lib/cjs/resources/adjustments.d.ts +4 -4
  7. package/lib/cjs/resources/adjustments.js +1 -1
  8. package/lib/cjs/resources/adyen_gateways.d.ts +5 -5
  9. package/lib/cjs/resources/adyen_gateways.js +1 -1
  10. package/lib/cjs/resources/adyen_payments.d.ts +5 -5
  11. package/lib/cjs/resources/adyen_payments.js +1 -1
  12. package/lib/cjs/resources/application.d.ts +4 -4
  13. package/lib/cjs/resources/application.js +1 -1
  14. package/lib/cjs/resources/attachments.d.ts +34 -34
  15. package/lib/cjs/resources/attachments.js +1 -1
  16. package/lib/cjs/resources/authorizations.d.ts +4 -4
  17. package/lib/cjs/resources/authorizations.js +1 -1
  18. package/lib/cjs/resources/avalara_accounts.d.ts +5 -5
  19. package/lib/cjs/resources/avalara_accounts.js +1 -1
  20. package/lib/cjs/resources/billing_info_validation_rules.d.ts +5 -5
  21. package/lib/cjs/resources/billing_info_validation_rules.js +1 -1
  22. package/lib/cjs/resources/bing_geocoders.d.ts +4 -4
  23. package/lib/cjs/resources/bing_geocoders.js +1 -1
  24. package/lib/cjs/resources/braintree_gateways.d.ts +5 -5
  25. package/lib/cjs/resources/braintree_gateways.js +1 -1
  26. package/lib/cjs/resources/braintree_payments.d.ts +5 -5
  27. package/lib/cjs/resources/braintree_payments.js +1 -1
  28. package/lib/cjs/resources/bundles.d.ts +6 -6
  29. package/lib/cjs/resources/bundles.js +1 -1
  30. package/lib/cjs/resources/captures.d.ts +4 -4
  31. package/lib/cjs/resources/captures.js +1 -1
  32. package/lib/cjs/resources/carrier_accounts.d.ts +4 -4
  33. package/lib/cjs/resources/carrier_accounts.js +1 -1
  34. package/lib/cjs/resources/checkout_com_gateways.d.ts +5 -5
  35. package/lib/cjs/resources/checkout_com_gateways.js +1 -1
  36. package/lib/cjs/resources/checkout_com_payments.d.ts +5 -5
  37. package/lib/cjs/resources/checkout_com_payments.js +1 -1
  38. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +11 -11
  39. package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -1
  40. package/lib/cjs/resources/coupon_recipients.d.ts +5 -5
  41. package/lib/cjs/resources/coupon_recipients.js +1 -1
  42. package/lib/cjs/resources/coupons.d.ts +5 -5
  43. package/lib/cjs/resources/coupons.js +1 -1
  44. package/lib/cjs/resources/customer_addresses.d.ts +6 -6
  45. package/lib/cjs/resources/customer_addresses.js +1 -1
  46. package/lib/cjs/resources/customer_groups.d.ts +4 -4
  47. package/lib/cjs/resources/customer_groups.js +1 -1
  48. package/lib/cjs/resources/customer_password_resets.d.ts +4 -4
  49. package/lib/cjs/resources/customer_password_resets.js +1 -1
  50. package/lib/cjs/resources/customer_payment_sources.d.ts +13 -13
  51. package/lib/cjs/resources/customer_payment_sources.js +1 -1
  52. package/lib/cjs/resources/customer_subscriptions.d.ts +4 -4
  53. package/lib/cjs/resources/customer_subscriptions.js +1 -1
  54. package/lib/cjs/resources/customers.d.ts +5 -5
  55. package/lib/cjs/resources/customers.js +1 -1
  56. package/lib/cjs/resources/delivery_lead_times.d.ts +6 -6
  57. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  58. package/lib/cjs/resources/event_callbacks.d.ts +4 -4
  59. package/lib/cjs/resources/event_callbacks.js +1 -1
  60. package/lib/cjs/resources/external_gateways.d.ts +4 -4
  61. package/lib/cjs/resources/external_gateways.js +1 -1
  62. package/lib/cjs/resources/external_payments.d.ts +5 -5
  63. package/lib/cjs/resources/external_payments.js +1 -1
  64. package/lib/cjs/resources/external_promotions.d.ts +9 -9
  65. package/lib/cjs/resources/external_promotions.js +1 -1
  66. package/lib/cjs/resources/external_tax_calculators.d.ts +5 -5
  67. package/lib/cjs/resources/external_tax_calculators.js +1 -1
  68. package/lib/cjs/resources/fixed_amount_promotions.d.ts +9 -9
  69. package/lib/cjs/resources/fixed_amount_promotions.js +1 -1
  70. package/lib/cjs/resources/fixed_price_promotions.d.ts +10 -10
  71. package/lib/cjs/resources/fixed_price_promotions.js +1 -1
  72. package/lib/cjs/resources/free_gift_promotions.d.ts +10 -10
  73. package/lib/cjs/resources/free_gift_promotions.js +1 -1
  74. package/lib/cjs/resources/free_shipping_promotions.d.ts +9 -9
  75. package/lib/cjs/resources/free_shipping_promotions.js +1 -1
  76. package/lib/cjs/resources/geocoders.d.ts +4 -4
  77. package/lib/cjs/resources/geocoders.js +1 -1
  78. package/lib/cjs/resources/gift_card_recipients.d.ts +5 -5
  79. package/lib/cjs/resources/gift_card_recipients.js +1 -1
  80. package/lib/cjs/resources/gift_cards.d.ts +6 -6
  81. package/lib/cjs/resources/gift_cards.js +1 -1
  82. package/lib/cjs/resources/google_geocoders.d.ts +4 -4
  83. package/lib/cjs/resources/google_geocoders.js +1 -1
  84. package/lib/cjs/resources/imports.d.ts +4 -4
  85. package/lib/cjs/resources/imports.js +1 -1
  86. package/lib/cjs/resources/in_stock_subscriptions.d.ts +7 -7
  87. package/lib/cjs/resources/in_stock_subscriptions.js +1 -1
  88. package/lib/cjs/resources/inventory_models.d.ts +4 -4
  89. package/lib/cjs/resources/inventory_models.js +1 -1
  90. package/lib/cjs/resources/inventory_return_locations.d.ts +6 -6
  91. package/lib/cjs/resources/inventory_return_locations.js +1 -1
  92. package/lib/cjs/resources/inventory_stock_locations.d.ts +6 -6
  93. package/lib/cjs/resources/inventory_stock_locations.js +1 -1
  94. package/lib/cjs/resources/klarna_gateways.d.ts +5 -5
  95. package/lib/cjs/resources/klarna_gateways.js +1 -1
  96. package/lib/cjs/resources/klarna_payments.d.ts +5 -5
  97. package/lib/cjs/resources/klarna_payments.js +1 -1
  98. package/lib/cjs/resources/line_item_options.d.ts +6 -6
  99. package/lib/cjs/resources/line_item_options.js +1 -1
  100. package/lib/cjs/resources/line_items.d.ts +15 -15
  101. package/lib/cjs/resources/line_items.js +1 -1
  102. package/lib/cjs/resources/manual_gateways.d.ts +4 -4
  103. package/lib/cjs/resources/manual_gateways.js +1 -1
  104. package/lib/cjs/resources/manual_tax_calculators.d.ts +6 -6
  105. package/lib/cjs/resources/manual_tax_calculators.js +1 -1
  106. package/lib/cjs/resources/markets.d.ts +9 -9
  107. package/lib/cjs/resources/markets.js +1 -1
  108. package/lib/cjs/resources/merchants.d.ts +5 -5
  109. package/lib/cjs/resources/merchants.js +1 -1
  110. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +10 -10
  111. package/lib/cjs/resources/order_amount_promotion_rules.js +1 -1
  112. package/lib/cjs/resources/order_copies.d.ts +5 -5
  113. package/lib/cjs/resources/order_copies.js +1 -1
  114. package/lib/cjs/resources/order_subscriptions.d.ts +6 -6
  115. package/lib/cjs/resources/order_subscriptions.js +1 -1
  116. package/lib/cjs/resources/order_validation_rules.d.ts +4 -4
  117. package/lib/cjs/resources/order_validation_rules.js +1 -1
  118. package/lib/cjs/resources/orders.d.ts +16 -16
  119. package/lib/cjs/resources/orders.js +1 -1
  120. package/lib/cjs/resources/organization.d.ts +4 -4
  121. package/lib/cjs/resources/organization.js +1 -1
  122. package/lib/cjs/resources/packages.d.ts +5 -5
  123. package/lib/cjs/resources/packages.js +1 -1
  124. package/lib/cjs/resources/parcel_line_items.d.ts +6 -6
  125. package/lib/cjs/resources/parcel_line_items.js +1 -1
  126. package/lib/cjs/resources/parcels.d.ts +6 -6
  127. package/lib/cjs/resources/parcels.js +1 -1
  128. package/lib/cjs/resources/payment_gateways.d.ts +4 -4
  129. package/lib/cjs/resources/payment_gateways.js +1 -1
  130. package/lib/cjs/resources/payment_methods.d.ts +6 -6
  131. package/lib/cjs/resources/payment_methods.js +1 -1
  132. package/lib/cjs/resources/paypal_gateways.d.ts +4 -4
  133. package/lib/cjs/resources/paypal_gateways.js +1 -1
  134. package/lib/cjs/resources/paypal_payments.d.ts +5 -5
  135. package/lib/cjs/resources/paypal_payments.js +1 -1
  136. package/lib/cjs/resources/percentage_discount_promotions.d.ts +10 -10
  137. package/lib/cjs/resources/percentage_discount_promotions.js +1 -1
  138. package/lib/cjs/resources/price_lists.d.ts +4 -4
  139. package/lib/cjs/resources/price_lists.js +1 -1
  140. package/lib/cjs/resources/prices.d.ts +6 -6
  141. package/lib/cjs/resources/prices.js +1 -1
  142. package/lib/cjs/resources/promotion_rules.d.ts +4 -4
  143. package/lib/cjs/resources/promotion_rules.js +1 -1
  144. package/lib/cjs/resources/promotions.d.ts +4 -4
  145. package/lib/cjs/resources/promotions.js +1 -1
  146. package/lib/cjs/resources/refunds.d.ts +4 -4
  147. package/lib/cjs/resources/refunds.js +1 -1
  148. package/lib/cjs/resources/return_line_items.d.ts +6 -6
  149. package/lib/cjs/resources/return_line_items.js +1 -1
  150. package/lib/cjs/resources/returns.d.ts +6 -6
  151. package/lib/cjs/resources/returns.js +1 -1
  152. package/lib/cjs/resources/shipments.d.ts +5 -5
  153. package/lib/cjs/resources/shipments.js +1 -1
  154. package/lib/cjs/resources/shipping_categories.d.ts +4 -4
  155. package/lib/cjs/resources/shipping_categories.js +1 -1
  156. package/lib/cjs/resources/shipping_methods.d.ts +7 -7
  157. package/lib/cjs/resources/shipping_methods.js +1 -1
  158. package/lib/cjs/resources/shipping_zones.d.ts +4 -4
  159. package/lib/cjs/resources/shipping_zones.js +1 -1
  160. package/lib/cjs/resources/sku_list_items.d.ts +6 -6
  161. package/lib/cjs/resources/sku_list_items.js +1 -1
  162. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +11 -11
  163. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -1
  164. package/lib/cjs/resources/sku_lists.d.ts +4 -4
  165. package/lib/cjs/resources/sku_lists.js +1 -1
  166. package/lib/cjs/resources/sku_options.d.ts +5 -5
  167. package/lib/cjs/resources/sku_options.js +1 -1
  168. package/lib/cjs/resources/skus.d.ts +5 -5
  169. package/lib/cjs/resources/skus.js +1 -1
  170. package/lib/cjs/resources/stock_items.d.ts +6 -6
  171. package/lib/cjs/resources/stock_items.js +1 -1
  172. package/lib/cjs/resources/stock_line_items.d.ts +4 -4
  173. package/lib/cjs/resources/stock_line_items.js +1 -1
  174. package/lib/cjs/resources/stock_locations.d.ts +5 -5
  175. package/lib/cjs/resources/stock_locations.js +1 -1
  176. package/lib/cjs/resources/stock_transfers.d.ts +8 -8
  177. package/lib/cjs/resources/stock_transfers.js +1 -1
  178. package/lib/cjs/resources/stripe_gateways.d.ts +4 -4
  179. package/lib/cjs/resources/stripe_gateways.js +1 -1
  180. package/lib/cjs/resources/stripe_payments.d.ts +5 -5
  181. package/lib/cjs/resources/stripe_payments.js +1 -1
  182. package/lib/cjs/resources/tax_calculators.d.ts +4 -4
  183. package/lib/cjs/resources/tax_calculators.js +1 -1
  184. package/lib/cjs/resources/tax_categories.d.ts +9 -9
  185. package/lib/cjs/resources/tax_categories.js +1 -1
  186. package/lib/cjs/resources/tax_rules.d.ts +5 -5
  187. package/lib/cjs/resources/tax_rules.js +1 -1
  188. package/lib/cjs/resources/taxjar_accounts.d.ts +5 -5
  189. package/lib/cjs/resources/taxjar_accounts.js +1 -1
  190. package/lib/cjs/resources/transactions.d.ts +4 -4
  191. package/lib/cjs/resources/transactions.js +1 -1
  192. package/lib/cjs/resources/voids.d.ts +4 -4
  193. package/lib/cjs/resources/voids.js +1 -1
  194. package/lib/cjs/resources/webhooks.d.ts +4 -4
  195. package/lib/cjs/resources/webhooks.js +1 -1
  196. package/lib/cjs/resources/wire_transfers.d.ts +5 -5
  197. package/lib/cjs/resources/wire_transfers.js +1 -1
  198. package/lib/esm/client.js +1 -1
  199. package/lib/esm/error.js +1 -1
  200. package/lib/esm/jsonapi.js +1 -1
  201. package/lib/esm/resource.d.ts +6 -2
  202. package/lib/esm/resources/addresses.d.ts +5 -5
  203. package/lib/esm/resources/addresses.js +1 -1
  204. package/lib/esm/resources/adjustments.d.ts +4 -4
  205. package/lib/esm/resources/adjustments.js +1 -1
  206. package/lib/esm/resources/adyen_gateways.d.ts +5 -5
  207. package/lib/esm/resources/adyen_gateways.js +1 -1
  208. package/lib/esm/resources/adyen_payments.d.ts +5 -5
  209. package/lib/esm/resources/adyen_payments.js +1 -1
  210. package/lib/esm/resources/application.d.ts +4 -4
  211. package/lib/esm/resources/application.js +1 -1
  212. package/lib/esm/resources/attachments.d.ts +34 -34
  213. package/lib/esm/resources/attachments.js +1 -1
  214. package/lib/esm/resources/authorizations.d.ts +4 -4
  215. package/lib/esm/resources/authorizations.js +1 -1
  216. package/lib/esm/resources/avalara_accounts.d.ts +5 -5
  217. package/lib/esm/resources/avalara_accounts.js +1 -1
  218. package/lib/esm/resources/billing_info_validation_rules.d.ts +5 -5
  219. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  220. package/lib/esm/resources/bing_geocoders.d.ts +4 -4
  221. package/lib/esm/resources/bing_geocoders.js +1 -1
  222. package/lib/esm/resources/braintree_gateways.d.ts +5 -5
  223. package/lib/esm/resources/braintree_gateways.js +1 -1
  224. package/lib/esm/resources/braintree_payments.d.ts +5 -5
  225. package/lib/esm/resources/braintree_payments.js +1 -1
  226. package/lib/esm/resources/bundles.d.ts +6 -6
  227. package/lib/esm/resources/bundles.js +1 -1
  228. package/lib/esm/resources/captures.d.ts +4 -4
  229. package/lib/esm/resources/captures.js +1 -1
  230. package/lib/esm/resources/carrier_accounts.d.ts +4 -4
  231. package/lib/esm/resources/carrier_accounts.js +1 -1
  232. package/lib/esm/resources/checkout_com_gateways.d.ts +5 -5
  233. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  234. package/lib/esm/resources/checkout_com_payments.d.ts +5 -5
  235. package/lib/esm/resources/checkout_com_payments.js +1 -1
  236. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +11 -11
  237. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  238. package/lib/esm/resources/coupon_recipients.d.ts +5 -5
  239. package/lib/esm/resources/coupon_recipients.js +1 -1
  240. package/lib/esm/resources/coupons.d.ts +5 -5
  241. package/lib/esm/resources/coupons.js +1 -1
  242. package/lib/esm/resources/customer_addresses.d.ts +6 -6
  243. package/lib/esm/resources/customer_addresses.js +1 -1
  244. package/lib/esm/resources/customer_groups.d.ts +4 -4
  245. package/lib/esm/resources/customer_groups.js +1 -1
  246. package/lib/esm/resources/customer_password_resets.d.ts +4 -4
  247. package/lib/esm/resources/customer_password_resets.js +1 -1
  248. package/lib/esm/resources/customer_payment_sources.d.ts +13 -13
  249. package/lib/esm/resources/customer_payment_sources.js +1 -1
  250. package/lib/esm/resources/customer_subscriptions.d.ts +4 -4
  251. package/lib/esm/resources/customer_subscriptions.js +1 -1
  252. package/lib/esm/resources/customers.d.ts +5 -5
  253. package/lib/esm/resources/customers.js +1 -1
  254. package/lib/esm/resources/delivery_lead_times.d.ts +6 -6
  255. package/lib/esm/resources/delivery_lead_times.js +1 -1
  256. package/lib/esm/resources/event_callbacks.d.ts +4 -4
  257. package/lib/esm/resources/event_callbacks.js +1 -1
  258. package/lib/esm/resources/external_gateways.d.ts +4 -4
  259. package/lib/esm/resources/external_gateways.js +1 -1
  260. package/lib/esm/resources/external_payments.d.ts +5 -5
  261. package/lib/esm/resources/external_payments.js +1 -1
  262. package/lib/esm/resources/external_promotions.d.ts +9 -9
  263. package/lib/esm/resources/external_promotions.js +1 -1
  264. package/lib/esm/resources/external_tax_calculators.d.ts +5 -5
  265. package/lib/esm/resources/external_tax_calculators.js +1 -1
  266. package/lib/esm/resources/fixed_amount_promotions.d.ts +9 -9
  267. package/lib/esm/resources/fixed_amount_promotions.js +1 -1
  268. package/lib/esm/resources/fixed_price_promotions.d.ts +10 -10
  269. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  270. package/lib/esm/resources/free_gift_promotions.d.ts +10 -10
  271. package/lib/esm/resources/free_gift_promotions.js +1 -1
  272. package/lib/esm/resources/free_shipping_promotions.d.ts +9 -9
  273. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  274. package/lib/esm/resources/geocoders.d.ts +4 -4
  275. package/lib/esm/resources/geocoders.js +1 -1
  276. package/lib/esm/resources/gift_card_recipients.d.ts +5 -5
  277. package/lib/esm/resources/gift_card_recipients.js +1 -1
  278. package/lib/esm/resources/gift_cards.d.ts +6 -6
  279. package/lib/esm/resources/gift_cards.js +1 -1
  280. package/lib/esm/resources/google_geocoders.d.ts +4 -4
  281. package/lib/esm/resources/google_geocoders.js +1 -1
  282. package/lib/esm/resources/imports.d.ts +4 -4
  283. package/lib/esm/resources/imports.js +1 -1
  284. package/lib/esm/resources/in_stock_subscriptions.d.ts +7 -7
  285. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  286. package/lib/esm/resources/inventory_models.d.ts +4 -4
  287. package/lib/esm/resources/inventory_models.js +1 -1
  288. package/lib/esm/resources/inventory_return_locations.d.ts +6 -6
  289. package/lib/esm/resources/inventory_return_locations.js +1 -1
  290. package/lib/esm/resources/inventory_stock_locations.d.ts +6 -6
  291. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  292. package/lib/esm/resources/klarna_gateways.d.ts +5 -5
  293. package/lib/esm/resources/klarna_gateways.js +1 -1
  294. package/lib/esm/resources/klarna_payments.d.ts +5 -5
  295. package/lib/esm/resources/klarna_payments.js +1 -1
  296. package/lib/esm/resources/line_item_options.d.ts +6 -6
  297. package/lib/esm/resources/line_item_options.js +1 -1
  298. package/lib/esm/resources/line_items.d.ts +15 -15
  299. package/lib/esm/resources/line_items.js +1 -1
  300. package/lib/esm/resources/manual_gateways.d.ts +4 -4
  301. package/lib/esm/resources/manual_gateways.js +1 -1
  302. package/lib/esm/resources/manual_tax_calculators.d.ts +6 -6
  303. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  304. package/lib/esm/resources/markets.d.ts +9 -9
  305. package/lib/esm/resources/markets.js +1 -1
  306. package/lib/esm/resources/merchants.d.ts +5 -5
  307. package/lib/esm/resources/merchants.js +1 -1
  308. package/lib/esm/resources/order_amount_promotion_rules.d.ts +10 -10
  309. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  310. package/lib/esm/resources/order_copies.d.ts +5 -5
  311. package/lib/esm/resources/order_copies.js +1 -1
  312. package/lib/esm/resources/order_subscriptions.d.ts +6 -6
  313. package/lib/esm/resources/order_subscriptions.js +1 -1
  314. package/lib/esm/resources/order_validation_rules.d.ts +4 -4
  315. package/lib/esm/resources/order_validation_rules.js +1 -1
  316. package/lib/esm/resources/orders.d.ts +16 -16
  317. package/lib/esm/resources/orders.js +1 -1
  318. package/lib/esm/resources/organization.d.ts +4 -4
  319. package/lib/esm/resources/organization.js +1 -1
  320. package/lib/esm/resources/packages.d.ts +5 -5
  321. package/lib/esm/resources/packages.js +1 -1
  322. package/lib/esm/resources/parcel_line_items.d.ts +6 -6
  323. package/lib/esm/resources/parcel_line_items.js +1 -1
  324. package/lib/esm/resources/parcels.d.ts +6 -6
  325. package/lib/esm/resources/parcels.js +1 -1
  326. package/lib/esm/resources/payment_gateways.d.ts +4 -4
  327. package/lib/esm/resources/payment_gateways.js +1 -1
  328. package/lib/esm/resources/payment_methods.d.ts +6 -6
  329. package/lib/esm/resources/payment_methods.js +1 -1
  330. package/lib/esm/resources/paypal_gateways.d.ts +4 -4
  331. package/lib/esm/resources/paypal_gateways.js +1 -1
  332. package/lib/esm/resources/paypal_payments.d.ts +5 -5
  333. package/lib/esm/resources/paypal_payments.js +1 -1
  334. package/lib/esm/resources/percentage_discount_promotions.d.ts +10 -10
  335. package/lib/esm/resources/percentage_discount_promotions.js +1 -1
  336. package/lib/esm/resources/price_lists.d.ts +4 -4
  337. package/lib/esm/resources/price_lists.js +1 -1
  338. package/lib/esm/resources/prices.d.ts +6 -6
  339. package/lib/esm/resources/prices.js +1 -1
  340. package/lib/esm/resources/promotion_rules.d.ts +4 -4
  341. package/lib/esm/resources/promotion_rules.js +1 -1
  342. package/lib/esm/resources/promotions.d.ts +4 -4
  343. package/lib/esm/resources/promotions.js +1 -1
  344. package/lib/esm/resources/refunds.d.ts +4 -4
  345. package/lib/esm/resources/refunds.js +1 -1
  346. package/lib/esm/resources/return_line_items.d.ts +6 -6
  347. package/lib/esm/resources/return_line_items.js +1 -1
  348. package/lib/esm/resources/returns.d.ts +6 -6
  349. package/lib/esm/resources/returns.js +1 -1
  350. package/lib/esm/resources/shipments.d.ts +5 -5
  351. package/lib/esm/resources/shipments.js +1 -1
  352. package/lib/esm/resources/shipping_categories.d.ts +4 -4
  353. package/lib/esm/resources/shipping_categories.js +1 -1
  354. package/lib/esm/resources/shipping_methods.d.ts +7 -7
  355. package/lib/esm/resources/shipping_methods.js +1 -1
  356. package/lib/esm/resources/shipping_zones.d.ts +4 -4
  357. package/lib/esm/resources/shipping_zones.js +1 -1
  358. package/lib/esm/resources/sku_list_items.d.ts +6 -6
  359. package/lib/esm/resources/sku_list_items.js +1 -1
  360. package/lib/esm/resources/sku_list_promotion_rules.d.ts +11 -11
  361. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  362. package/lib/esm/resources/sku_lists.d.ts +4 -4
  363. package/lib/esm/resources/sku_lists.js +1 -1
  364. package/lib/esm/resources/sku_options.d.ts +5 -5
  365. package/lib/esm/resources/sku_options.js +1 -1
  366. package/lib/esm/resources/skus.d.ts +5 -5
  367. package/lib/esm/resources/skus.js +1 -1
  368. package/lib/esm/resources/stock_items.d.ts +6 -6
  369. package/lib/esm/resources/stock_items.js +1 -1
  370. package/lib/esm/resources/stock_line_items.d.ts +4 -4
  371. package/lib/esm/resources/stock_line_items.js +1 -1
  372. package/lib/esm/resources/stock_locations.d.ts +5 -5
  373. package/lib/esm/resources/stock_locations.js +1 -1
  374. package/lib/esm/resources/stock_transfers.d.ts +8 -8
  375. package/lib/esm/resources/stock_transfers.js +1 -1
  376. package/lib/esm/resources/stripe_gateways.d.ts +4 -4
  377. package/lib/esm/resources/stripe_gateways.js +1 -1
  378. package/lib/esm/resources/stripe_payments.d.ts +5 -5
  379. package/lib/esm/resources/stripe_payments.js +1 -1
  380. package/lib/esm/resources/tax_calculators.d.ts +4 -4
  381. package/lib/esm/resources/tax_calculators.js +1 -1
  382. package/lib/esm/resources/tax_categories.d.ts +9 -9
  383. package/lib/esm/resources/tax_categories.js +1 -1
  384. package/lib/esm/resources/tax_rules.d.ts +5 -5
  385. package/lib/esm/resources/tax_rules.js +1 -1
  386. package/lib/esm/resources/taxjar_accounts.d.ts +5 -5
  387. package/lib/esm/resources/taxjar_accounts.js +1 -1
  388. package/lib/esm/resources/transactions.d.ts +4 -4
  389. package/lib/esm/resources/transactions.js +1 -1
  390. package/lib/esm/resources/voids.d.ts +4 -4
  391. package/lib/esm/resources/voids.js +1 -1
  392. package/lib/esm/resources/webhooks.d.ts +4 -4
  393. package/lib/esm/resources/webhooks.js +1 -1
  394. package/lib/esm/resources/wire_transfers.d.ts +5 -5
  395. package/lib/esm/resources/wire_transfers.js +1 -1
  396. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  397. package/lib/tsconfig.tsbuildinfo +1 -1
  398. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { ManualTaxCalculator } from './manual_tax_calculators';
4
- declare type TaxRuleRel = ResourceId & {
4
+ declare type TaxRuleRel = ResourceRel & {
5
5
  type: typeof TaxRules.TYPE;
6
6
  };
7
- declare type ManualTaxCalculatorRel = ResourceId & {
7
+ declare type ManualTaxCalculatorRel = ResourceRel & {
8
8
  type: 'manual_tax_calculators';
9
9
  };
10
10
  interface TaxRule extends Resource {
@@ -61,7 +61,7 @@ declare class TaxRules extends ApiResource {
61
61
  update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
62
62
  delete(id: string, options?: ResourcesConfig): Promise<void>;
63
63
  isTaxRule(resource: any): resource is TaxRule;
64
- relationship(id: string | ResourceId): TaxRuleRel;
64
+ relationship(id: string | ResourceId | null): TaxRuleRel;
65
65
  type(): string;
66
66
  }
67
67
  export default TaxRules;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxRules extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxRules.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxRules.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxRules.TYPE,id:e},t)}isTaxRule(e){return e.type&&e.type===TaxRules.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxRules.TYPE}:{id:e.id,type:TaxRules.TYPE}}type(){return TaxRules.TYPE}}TaxRules.TYPE="tax_rules",exports.default=TaxRules;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxRules extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxRules.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxRules.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxRules.TYPE,id:e},t)}isTaxRule(e){return e.type&&e.type===TaxRules.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxRules.TYPE}:{id:e.id,type:TaxRules.TYPE}}type(){return TaxRules.TYPE}}TaxRules.TYPE="tax_rules",exports.default=TaxRules;
@@ -1,12 +1,12 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { TaxCategory } from './tax_categories';
4
4
  import { Market } from './markets';
5
5
  import { Attachment } from './attachments';
6
- declare type TaxjarAccountRel = ResourceId & {
6
+ declare type TaxjarAccountRel = ResourceRel & {
7
7
  type: typeof TaxjarAccounts.TYPE;
8
8
  };
9
- declare type TaxCategoryRel = ResourceId & {
9
+ declare type TaxCategoryRel = ResourceRel & {
10
10
  type: 'tax_categories';
11
11
  };
12
12
  interface TaxjarAccount extends Resource {
@@ -33,7 +33,7 @@ declare class TaxjarAccounts extends ApiResource {
33
33
  update(resource: TaxjarAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
34
34
  delete(id: string, options?: ResourcesConfig): Promise<void>;
35
35
  isTaxjarAccount(resource: any): resource is TaxjarAccount;
36
- relationship(id: string | ResourceId): TaxjarAccountRel;
36
+ relationship(id: string | ResourceId | null): TaxjarAccountRel;
37
37
  type(): string;
38
38
  }
39
39
  export default TaxjarAccounts;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxjarAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxjarAccounts.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxjarAccounts.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxjarAccounts.TYPE,id:e},t)}isTaxjarAccount(e){return e.type&&e.type===TaxjarAccounts.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxjarAccounts.TYPE}:{id:e.id,type:TaxjarAccounts.TYPE}}type(){return TaxjarAccounts.TYPE}}TaxjarAccounts.TYPE="taxjar_accounts",exports.default=TaxjarAccounts;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxjarAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxjarAccounts.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxjarAccounts.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxjarAccounts.TYPE,id:e},t)}isTaxjarAccount(e){return e.type&&e.type===TaxjarAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxjarAccounts.TYPE}:{id:e.id,type:TaxjarAccounts.TYPE}}type(){return TaxjarAccounts.TYPE}}TaxjarAccounts.TYPE="taxjar_accounts",exports.default=TaxjarAccounts;
@@ -1,7 +1,7 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
- declare type TransactionRel = ResourceId & {
4
+ declare type TransactionRel = ResourceRel & {
5
5
  type: typeof Transactions.TYPE;
6
6
  };
7
7
  interface Transaction extends Resource {
@@ -23,7 +23,7 @@ declare class Transactions extends ApiResource {
23
23
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Transaction>>;
24
24
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Transaction>;
25
25
  isTransaction(resource: any): resource is Transaction;
26
- relationship(id: string | ResourceId): TransactionRel;
26
+ relationship(id: string | ResourceId | null): TransactionRel;
27
27
  type(): string;
28
28
  }
29
29
  export default Transactions;
@@ -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,r){return this.resources.list({type:Transactions.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Transactions.TYPE,id:e},r,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,r){return this.resources.list({type:Transactions.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Transactions.TYPE,id:e},r,t)}isTransaction(e){return e.type&&e.type===Transactions.TYPE}relationship(e){return e===null||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,8 +1,8 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { Authorization } from './authorizations';
5
- declare type VoidRel = ResourceId & {
5
+ declare type VoidRel = ResourceRel & {
6
6
  type: typeof Voids.TYPE;
7
7
  };
8
8
  interface Void extends Resource {
@@ -25,7 +25,7 @@ declare class Voids extends ApiResource {
25
25
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
26
26
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Void>;
27
27
  isVoid(resource: any): resource is Void;
28
- relationship(id: string | ResourceId): VoidRel;
28
+ relationship(id: string | ResourceId | null): VoidRel;
29
29
  type(): string;
30
30
  }
31
31
  export default Voids;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Voids extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Voids.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Voids.TYPE,id:e},r,t)}isVoid(e){return e.type&&e.type===Voids.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Voids.TYPE}:{id:e.id,type:Voids.TYPE}}type(){return Voids.TYPE}}Voids.TYPE="voids",exports.default=Voids;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Voids extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Voids.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Voids.TYPE,id:e},r,t)}isVoid(e){return e.type&&e.type===Voids.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Voids.TYPE}:{id:e.id,type:Voids.TYPE}}type(){return Voids.TYPE}}Voids.TYPE="voids",exports.default=Voids;
@@ -1,7 +1,7 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { EventCallback } from './event_callbacks';
4
- declare type WebhookRel = ResourceId & {
4
+ declare type WebhookRel = ResourceRel & {
5
5
  type: typeof Webhooks.TYPE;
6
6
  };
7
7
  interface Webhook extends Resource {
@@ -34,7 +34,7 @@ declare class Webhooks extends ApiResource {
34
34
  update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
35
35
  delete(id: string, options?: ResourcesConfig): Promise<void>;
36
36
  isWebhook(resource: any): resource is Webhook;
37
- relationship(id: string | ResourceId): WebhookRel;
37
+ relationship(id: string | ResourceId | null): WebhookRel;
38
38
  type(): string;
39
39
  }
40
40
  export default Webhooks;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Webhooks extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Webhooks.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Webhooks.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Webhooks.TYPE,id:e},t)}isWebhook(e){return e.type&&e.type===Webhooks.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Webhooks.TYPE}:{id:e.id,type:Webhooks.TYPE}}type(){return Webhooks.TYPE}}Webhooks.TYPE="webhooks",exports.default=Webhooks;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Webhooks extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Webhooks.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Webhooks.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Webhooks.TYPE,id:e},t)}isWebhook(e){return e.type&&e.type===Webhooks.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Webhooks.TYPE}:{id:e.id,type:Webhooks.TYPE}}type(){return Webhooks.TYPE}}Webhooks.TYPE="webhooks",exports.default=Webhooks;
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
- declare type WireTransferRel = ResourceId & {
4
+ declare type WireTransferRel = ResourceRel & {
5
5
  type: typeof WireTransfers.TYPE;
6
6
  };
7
- declare type OrderRel = ResourceId & {
7
+ declare type OrderRel = ResourceRel & {
8
8
  type: 'orders';
9
9
  };
10
10
  interface WireTransfer extends Resource {
@@ -24,7 +24,7 @@ declare class WireTransfers extends ApiResource {
24
24
  update(resource: WireTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
25
25
  delete(id: string, options?: ResourcesConfig): Promise<void>;
26
26
  isWireTransfer(resource: any): resource is WireTransfer;
27
- relationship(id: string | ResourceId): WireTransferRel;
27
+ relationship(id: string | ResourceId | null): WireTransferRel;
28
28
  type(): string;
29
29
  }
30
30
  export default WireTransfers;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class WireTransfers extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:WireTransfers.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:WireTransfers.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:WireTransfers.TYPE,id:e},t)}isWireTransfer(e){return e.type&&e.type===WireTransfers.TYPE}relationship(e){return typeof e=="string"?{id:e,type:WireTransfers.TYPE}:{id:e.id,type:WireTransfers.TYPE}}type(){return WireTransfers.TYPE}}WireTransfers.TYPE="wire_transfers",exports.default=WireTransfers;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class WireTransfers extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:WireTransfers.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:WireTransfers.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:WireTransfers.TYPE,id:e},t)}isWireTransfer(e){return e.type&&e.type===WireTransfers.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:WireTransfers.TYPE}:{id:e.id,type:WireTransfers.TYPE}}type(){return WireTransfers.TYPE}}WireTransfers.TYPE="wire_transfers",exports.default=WireTransfers;
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var h=this&&this.__classPrivateFieldSet||function(o,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?o!==t||!i:!t.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(o,e):i?i.value=e:t.set(o,e),e},a=this&&this.__classPrivateFieldGet||function(o,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?o!==t||!r:!t.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(o):r?r.value:t.get(o)},s,n;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as c}from"./error";import l from"./config";const p=(o,t)=>`https://${o.toLowerCase()}.${t||l.default.domain}/api`,b=o=>{let t=new T({message:o.message,type:c.GENERIC});if(u.isAxiosError(o))if(o.response){const e=new g(t);e.type=c.RESPONSE,e.status=o.response.status,e.code=String(e.status),e.errors=o.response.data.errors,t=e}else o.request?(t.type=c.REQUEST,t.request=o.request):t.type=c.CLIENT;else u.isCancel(o)?t.type=c.CANCEL:t.source=o;throw t};class f{constructor(t){s.set(this,void 0),n.set(this,void 0),this.baseUrl=p(t.organization,t.domain),h(this,s,t.accessToken,"f");const e={timeout:t.timeout||l.client.timeout};h(this,n,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 "+a(this,s,"f")}},e)),"f"),this.interceptors=a(this,n,"f").interceptors}static create(t){if(!(t==null?void 0:t.organization))throw new Error("Undefined 'organization' parameter");if(!(t==null?void 0:t.accessToken))throw new Error("Undefined 'accessToken' parameter");return new f(t)}config(t){const e=a(this,n,"f").defaults;t.timeout&&(e.timeout=t.timeout),t.organization&&(this.baseUrl=p(t.organization,t.domain)),t.accessToken&&(h(this,s,t.accessToken,"f"),e.headers.common.Authorization="Bearer "+a(this,s,"f"))}async request(t,e,r,i){const w=r?{data:r}:void 0,v=e,E=(i==null?void 0:i.organization)?p(i.organization,i.domain):void 0,m=(i==null?void 0:i.accessToken)||a(this,s,"f"),y=m?{Authorization:"Bearer "+m}:void 0;return a(this,n,"f").request(Object.assign({method:t,baseURL:E,url:v,data:w,headers:y},i)).then(d=>d.data).catch(d=>b(d))}}s=new WeakMap,n=new WeakMap;export default f;
1
+ var h=this&&this.__classPrivateFieldSet||function(r,e,t,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},i=this&&this.__classPrivateFieldGet||function(r,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(r):a?a.value:e.get(r)},o,n;import u from"axios";import{SdkError as y,ApiError as T,ErrorType as c}from"./error";import l from"./config";const p=(r,e)=>`https://${r.toLowerCase()}.${e||l.default.domain}/api`,b=r=>{let e=new y({message:r.message,type:c.GENERIC});if(u.isAxiosError(r))if(r.response){const t=new T(e);t.type=c.RESPONSE,t.status=r.response.status,t.code=String(t.status),t.errors=r.response.data.errors,e=t}else r.request?(e.type=c.REQUEST,e.request=r.request):e.type=c.CLIENT;else u.isCancel(r)?e.type=c.CANCEL:e.source=r;throw e};class f{constructor(e){o.set(this,void 0),n.set(this,void 0),this.baseUrl=p(e.organization,e.domain),h(this,o,e.accessToken,"f");const t={timeout:e.timeout||l.client.timeout};h(this,n,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 "+i(this,o,"f")}},t)),"f"),this.interceptors=i(this,n,"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 t=i(this,n,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.organization&&(this.baseUrl=p(e.organization,e.domain)),e.accessToken&&(h(this,o,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+i(this,o,"f"))}async request(e,t,a,s){const w=a?{data:a}:void 0,v=t,E=(s==null?void 0:s.organization)?p(s.organization,s.domain):void 0,m=(s==null?void 0:s.accessToken)||i(this,o,"f"),g=m?{Authorization:"Bearer "+m}:void 0;return i(this,n,"f").request(Object.assign({method:e,baseURL:E,url:v,data:w,headers:g},s)).then(d=>d.data).catch(d=>b(d))}}o=new WeakMap,n=new WeakMap;export default f;
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 i 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(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
1
+ var t;(function(s){s.CLIENT="client",s.REQUEST="request",s.RESPONSE="response",s.GENERIC="generic",s.CANCEL="cancel"})(t||(t={}));class e extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||t.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(t).includes(r.type)}}class i extends e{constructor(r){super(Object.assign(Object.assign({},r),{type:t.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return e.isSdkError(r)&&r.name==="ApiError"&&r.type===t.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{e as SdkError,i as ApiError,t as ErrorType};
@@ -1 +1 @@
1
- import{isResourceId as o}from"./common";const l=e=>{let s;e.links&&delete e.links;const r=e.data,a=e.included;return Array.isArray(r)?s=r.map(i=>t(i,a)):s=t(r,a),s},d=(e,s=[])=>s.find(r=>e.id===r.id&&e.type===r.type)||e,t=(e,s)=>{const r=Object.assign({id:e.id,type:e.type},e.attributes);return e.relationships&&Object.keys(e.relationships).forEach(a=>{const i=e.relationships[a].data;i?Array.isArray(i)?r[a]=i.map(n=>t(d(n,s),s)):r[a]=t(d(i,s),s):i===null&&(r[a]=null)}),r},c=e=>{const s={},r={};for(const i in e){if(["type","id"].includes(i))continue;const n=e[i];n&&(o(n)||Array.isArray(n)&&o(n[0]))?r[i]={data:n}:s[i]=n}const a={type:e.type,attributes:s,relationships:r};return o(e)&&(a.id=e.id),a};export{l as denormalize,c as normalize};
1
+ import{isResourceId as i,isResourceType as d}from"./common";const c=t=>{let r;t.links&&delete t.links;const s=t.data,a=t.included;return Array.isArray(s)?r=s.map(e=>o(e,a)):r=o(s,a),r},l=(t,r=[])=>r.find(s=>t.id===s.id&&t.type===s.type)||t,o=(t,r)=>{const s=Object.assign({id:t.id,type:t.type},t.attributes);return t.relationships&&Object.keys(t.relationships).forEach(a=>{const e=t.relationships[a].data;e?Array.isArray(e)?s[a]=e.map(n=>o(l(n,r),r)):s[a]=o(l(e,r),r):e===null&&(s[a]=null)}),s},p=t=>{const r={},s={};for(const e in t){if(["type","id"].includes(e))continue;const n=t[e];n&&d(n)&&n.id===null?s[e]={data:null}:n&&(i(n)||Array.isArray(n)&&i(n[0]))?s[e]={data:n}:r[e]=n}const a={type:t.type,attributes:r,relationships:s};return i(t)&&(a.id=t.id),a};export{c as denormalize,p as normalize};
@@ -3,6 +3,10 @@ import { QueryParamsRetrieve, QueryParamsList } from './query';
3
3
  import { ResourceTypeLock } from './api';
4
4
  import { InterceptorManager } from './interceptor';
5
5
  import { Value as JSONValue } from 'json-typescript';
6
+ declare type ResourceNull = {
7
+ id: null;
8
+ } & ResourceType;
9
+ declare type ResourceRel = ResourceId | ResourceNull;
6
10
  declare type Metadata = {
7
11
  [key: string]: JSONValue;
8
12
  };
@@ -43,7 +47,7 @@ declare class ListResponse<R> extends Array<R> {
43
47
  last(): R | undefined;
44
48
  get(index: number): R | undefined;
45
49
  }
46
- export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse };
50
+ export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ResourceRel };
47
51
  declare type ResourceAdapterConfig = {};
48
52
  declare type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
49
53
  declare type ResourcesConfig = ResourceAdapterConfig & ApiClientConfig;
@@ -63,7 +67,7 @@ declare abstract class ApiResource {
63
67
  static readonly TYPE: ResourceTypeLock;
64
68
  protected resources: ResourceAdapter;
65
69
  constructor(adapter: ResourceAdapter);
66
- abstract relationship(id: string | ResourceId): ResourceId;
70
+ abstract relationship(id: string | ResourceId | null): ResourceRel;
67
71
  }
68
72
  export default ResourceAdapter;
69
73
  export { ApiResource, ResourcesConfig, ResourcesInitConfig };
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Geocoder } from './geocoders';
4
- declare type AddressRel = ResourceId & {
4
+ declare type AddressRel = ResourceRel & {
5
5
  type: typeof Addresses.TYPE;
6
6
  };
7
- declare type GeocoderRel = ResourceId & {
7
+ declare type GeocoderRel = ResourceRel & {
8
8
  type: 'geocoders';
9
9
  };
10
10
  interface Address extends Resource {
@@ -80,7 +80,7 @@ declare class Addresses extends ApiResource {
80
80
  update(resource: AddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
81
81
  delete(id: string, options?: ResourcesConfig): Promise<void>;
82
82
  isAddress(resource: any): resource is Address;
83
- relationship(id: string | ResourceId): AddressRel;
83
+ relationship(id: string | ResourceId | null): AddressRel;
84
84
  type(): string;
85
85
  }
86
86
  export default Addresses;
@@ -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)}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 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)}isAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="addresses";export default s;
@@ -1,6 +1,6 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
3
- declare type AdjustmentRel = ResourceId & {
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ declare type AdjustmentRel = ResourceRel & {
4
4
  type: typeof Adjustments.TYPE;
5
5
  };
6
6
  interface Adjustment extends Resource {
@@ -28,7 +28,7 @@ declare class Adjustments extends ApiResource {
28
28
  update(resource: AdjustmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Adjustment>;
29
29
  delete(id: string, options?: ResourcesConfig): Promise<void>;
30
30
  isAdjustment(resource: any): resource is Adjustment;
31
- relationship(id: string | ResourceId): AdjustmentRel;
31
+ relationship(id: string | ResourceId | null): AdjustmentRel;
32
32
  type(): string;
33
33
  }
34
34
  export default Adjustments;
@@ -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)}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 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)}isAdjustment(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adjustments";export default t;
@@ -1,11 +1,11 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { PaymentMethod } from './payment_methods';
4
4
  import { AdyenPayment } from './adyen_payments';
5
- declare type AdyenGatewayRel = ResourceId & {
5
+ declare type AdyenGatewayRel = ResourceRel & {
6
6
  type: typeof AdyenGateways.TYPE;
7
7
  };
8
- declare type AdyenPaymentRel = ResourceId & {
8
+ declare type AdyenPaymentRel = ResourceRel & {
9
9
  type: 'adyen_payments';
10
10
  };
11
11
  interface AdyenGateway extends Resource {
@@ -38,7 +38,7 @@ declare class AdyenGateways extends ApiResource {
38
38
  update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
39
39
  delete(id: string, options?: ResourcesConfig): Promise<void>;
40
40
  isAdyenGateway(resource: any): resource is AdyenGateway;
41
- relationship(id: string | ResourceId): AdyenGatewayRel;
41
+ relationship(id: string | ResourceId | null): AdyenGatewayRel;
42
42
  type(): string;
43
43
  }
44
44
  export default AdyenGateways;
@@ -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 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 e===null||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,11 +1,11 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { PaymentGateway } from './payment_gateways';
5
- declare type AdyenPaymentRel = ResourceId & {
5
+ declare type AdyenPaymentRel = ResourceRel & {
6
6
  type: typeof AdyenPayments.TYPE;
7
7
  };
8
- declare type OrderRel = ResourceId & {
8
+ declare type OrderRel = ResourceRel & {
9
9
  type: 'orders';
10
10
  };
11
11
  interface AdyenPayment extends Resource {
@@ -35,7 +35,7 @@ declare class AdyenPayments extends ApiResource {
35
35
  update(resource: AdyenPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenPayment>;
36
36
  delete(id: string, options?: ResourcesConfig): Promise<void>;
37
37
  isAdyenPayment(resource: any): resource is AdyenPayment;
38
- relationship(id: string | ResourceId): AdyenPaymentRel;
38
+ relationship(id: string | ResourceId | null): AdyenPaymentRel;
39
39
  type(): string;
40
40
  }
41
41
  export default AdyenPayments;
@@ -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 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 e===null||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,6 +1,6 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsRetrieve } from '../query';
3
- declare type ApplicationRel = ResourceId & {
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel } from '../resource';
2
+ import { QueryParamsRetrieve } from '../query';
3
+ declare type ApplicationRel = ResourceRel & {
4
4
  type: typeof Applications.TYPE;
5
5
  };
6
6
  interface Application extends Resource {
@@ -14,7 +14,7 @@ declare class Applications extends ApiResource {
14
14
  static readonly TYPE: 'application';
15
15
  retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Application>;
16
16
  isApplication(resource: any): resource is Application;
17
- relationship(id: string | ResourceId): ApplicationRel;
17
+ relationship(id: string | ResourceId | null): ApplicationRel;
18
18
  type(): string;
19
19
  }
20
20
  export default Applications;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{async retrieve(e,t){return this.resources.singleton({type:r.TYPE},e,t)}isApplication(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="application";export default r;
1
+ import{ApiResource as i}from"../resource";class r extends i{async retrieve(e,t){return this.resources.singleton({type:r.TYPE},e,t)}isApplication(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="application";export default r;
@@ -1,5 +1,5 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Bundle } from './bundles';
4
4
  import { CarrierAccount } from './carrier_accounts';
5
5
  import { CustomerGroup } from './customer_groups';
@@ -30,97 +30,97 @@ import { StockItem } from './stock_items';
30
30
  import { StockLocation } from './stock_locations';
31
31
  import { TaxCalculator } from './tax_calculators';
32
32
  import { TaxCategory } from './tax_categories';
33
- declare type AttachmentRel = ResourceId & {
33
+ declare type AttachmentRel = ResourceRel & {
34
34
  type: typeof Attachments.TYPE;
35
35
  };
36
- declare type BundleRel = ResourceId & {
36
+ declare type BundleRel = ResourceRel & {
37
37
  type: 'bundles';
38
38
  };
39
- declare type CarrierAccountRel = ResourceId & {
39
+ declare type CarrierAccountRel = ResourceRel & {
40
40
  type: 'carrier_accounts';
41
41
  };
42
- declare type CustomerGroupRel = ResourceId & {
42
+ declare type CustomerGroupRel = ResourceRel & {
43
43
  type: 'customer_groups';
44
44
  };
45
- declare type CustomerRel = ResourceId & {
45
+ declare type CustomerRel = ResourceRel & {
46
46
  type: 'customers';
47
47
  };
48
- declare type DeliveryLeadTimeRel = ResourceId & {
48
+ declare type DeliveryLeadTimeRel = ResourceRel & {
49
49
  type: 'delivery_lead_times';
50
50
  };
51
- declare type GeocoderRel = ResourceId & {
51
+ declare type GeocoderRel = ResourceRel & {
52
52
  type: 'geocoders';
53
53
  };
54
- declare type GiftCardRecipientRel = ResourceId & {
54
+ declare type GiftCardRecipientRel = ResourceRel & {
55
55
  type: 'gift_card_recipients';
56
56
  };
57
- declare type GiftCardRel = ResourceId & {
57
+ declare type GiftCardRel = ResourceRel & {
58
58
  type: 'gift_cards';
59
59
  };
60
- declare type InventoryModelRel = ResourceId & {
60
+ declare type InventoryModelRel = ResourceRel & {
61
61
  type: 'inventory_models';
62
62
  };
63
- declare type MarketRel = ResourceId & {
63
+ declare type MarketRel = ResourceRel & {
64
64
  type: 'markets';
65
65
  };
66
- declare type MerchantRel = ResourceId & {
66
+ declare type MerchantRel = ResourceRel & {
67
67
  type: 'merchants';
68
68
  };
69
- declare type BillingInfoValidationRuleRel = ResourceId & {
69
+ declare type BillingInfoValidationRuleRel = ResourceRel & {
70
70
  type: 'billing_info_validation_rules';
71
71
  };
72
- declare type OrderRel = ResourceId & {
72
+ declare type OrderRel = ResourceRel & {
73
73
  type: 'orders';
74
74
  };
75
- declare type PackageRel = ResourceId & {
75
+ declare type PackageRel = ResourceRel & {
76
76
  type: 'packages';
77
77
  };
78
- declare type ParcelRel = ResourceId & {
78
+ declare type ParcelRel = ResourceRel & {
79
79
  type: 'parcels';
80
80
  };
81
- declare type PaymentMethodRel = ResourceId & {
81
+ declare type PaymentMethodRel = ResourceRel & {
82
82
  type: 'payment_methods';
83
83
  };
84
- declare type PriceListRel = ResourceId & {
84
+ declare type PriceListRel = ResourceRel & {
85
85
  type: 'price_lists';
86
86
  };
87
- declare type PriceRel = ResourceId & {
87
+ declare type PriceRel = ResourceRel & {
88
88
  type: 'prices';
89
89
  };
90
- declare type PromotionRel = ResourceId & {
90
+ declare type PromotionRel = ResourceRel & {
91
91
  type: 'promotions';
92
92
  };
93
- declare type ReturnRel = ResourceId & {
93
+ declare type ReturnRel = ResourceRel & {
94
94
  type: 'returns';
95
95
  };
96
- declare type ShipmentRel = ResourceId & {
96
+ declare type ShipmentRel = ResourceRel & {
97
97
  type: 'shipments';
98
98
  };
99
- declare type ShippingCategoryRel = ResourceId & {
99
+ declare type ShippingCategoryRel = ResourceRel & {
100
100
  type: 'shipping_categories';
101
101
  };
102
- declare type ShippingMethodRel = ResourceId & {
102
+ declare type ShippingMethodRel = ResourceRel & {
103
103
  type: 'shipping_methods';
104
104
  };
105
- declare type ShippingZoneRel = ResourceId & {
105
+ declare type ShippingZoneRel = ResourceRel & {
106
106
  type: 'shipping_zones';
107
107
  };
108
- declare type SkuOptionRel = ResourceId & {
108
+ declare type SkuOptionRel = ResourceRel & {
109
109
  type: 'sku_options';
110
110
  };
111
- declare type SkuRel = ResourceId & {
111
+ declare type SkuRel = ResourceRel & {
112
112
  type: 'skus';
113
113
  };
114
- declare type StockItemRel = ResourceId & {
114
+ declare type StockItemRel = ResourceRel & {
115
115
  type: 'stock_items';
116
116
  };
117
- declare type StockLocationRel = ResourceId & {
117
+ declare type StockLocationRel = ResourceRel & {
118
118
  type: 'stock_locations';
119
119
  };
120
- declare type TaxCalculatorRel = ResourceId & {
120
+ declare type TaxCalculatorRel = ResourceRel & {
121
121
  type: 'tax_calculators';
122
122
  };
123
- declare type TaxCategoryRel = ResourceId & {
123
+ declare type TaxCategoryRel = ResourceRel & {
124
124
  type: 'tax_categories';
125
125
  };
126
126
  interface Attachment extends Resource {
@@ -149,7 +149,7 @@ declare class Attachments extends ApiResource {
149
149
  update(resource: AttachmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Attachment>;
150
150
  delete(id: string, options?: ResourcesConfig): Promise<void>;
151
151
  isAttachment(resource: any): resource is Attachment;
152
- relationship(id: string | ResourceId): AttachmentRel;
152
+ relationship(id: string | ResourceId | null): AttachmentRel;
153
153
  type(): string;
154
154
  }
155
155
  export default Attachments;
@@ -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 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 e===null||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,9 +1,9 @@
1
- import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { Capture } from './captures';
5
5
  import { Void } from './voids';
6
- declare type AuthorizationRel = ResourceId & {
6
+ declare type AuthorizationRel = ResourceRel & {
7
7
  type: typeof Authorizations.TYPE;
8
8
  };
9
9
  interface Authorization extends Resource {
@@ -47,7 +47,7 @@ declare class Authorizations extends ApiResource {
47
47
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
48
48
  update(resource: AuthorizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
49
49
  isAuthorization(resource: any): resource is Authorization;
50
- relationship(id: string | ResourceId): AuthorizationRel;
50
+ relationship(id: string | ResourceId | null): AuthorizationRel;
51
51
  type(): string;
52
52
  }
53
53
  export default Authorizations;
@@ -1 +1 @@
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 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)}isAuthorization(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="authorizations";export default r;
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 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)}isAuthorization(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="authorizations";export default r;
@@ -1,12 +1,12 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { TaxCategory } from './tax_categories';
4
4
  import { Market } from './markets';
5
5
  import { Attachment } from './attachments';
6
- declare type AvalaraAccountRel = ResourceId & {
6
+ declare type AvalaraAccountRel = ResourceRel & {
7
7
  type: typeof AvalaraAccounts.TYPE;
8
8
  };
9
- declare type TaxCategoryRel = ResourceId & {
9
+ declare type TaxCategoryRel = ResourceRel & {
10
10
  type: 'tax_categories';
11
11
  };
12
12
  interface AvalaraAccount extends Resource {
@@ -42,7 +42,7 @@ declare class AvalaraAccounts extends ApiResource {
42
42
  update(resource: AvalaraAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
43
43
  delete(id: string, options?: ResourcesConfig): Promise<void>;
44
44
  isAvalaraAccount(resource: any): resource is AvalaraAccount;
45
- relationship(id: string | ResourceId): AvalaraAccountRel;
45
+ relationship(id: string | ResourceId | null): AvalaraAccountRel;
46
46
  type(): string;
47
47
  }
48
48
  export default AvalaraAccounts;
@@ -1 +1 @@
1
- import{ApiResource as a}from"../resource";class s extends a{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)}isAvalaraAccount(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="avalara_accounts";export default s;
1
+ import{ApiResource as a}from"../resource";class s extends a{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)}isAvalaraAccount(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="avalara_accounts";export default s;