@commercelayer/sdk 7.0.0-beta.19 → 7.0.0-beta.20

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 (879) hide show
  1. package/lib/{api-CUXmETkx.d.ts → api-DDgIE2i8.d.ts} +6 -3
  2. package/lib/{api-CRmSToGa.d.cts → api-DmIZO_Np.d.cts} +6 -3
  3. package/lib/api.cjs +2 -0
  4. package/lib/api.cjs.map +1 -0
  5. package/lib/api.d.cts +1 -1
  6. package/lib/api.d.ts +1 -1
  7. package/lib/api.js +2 -0
  8. package/lib/api.js.map +1 -0
  9. package/lib/client.cjs +2 -0
  10. package/lib/client.cjs.map +1 -0
  11. package/lib/client.js +2 -0
  12. package/lib/client.js.map +1 -0
  13. package/lib/commercelayer.cjs +2 -0
  14. package/lib/commercelayer.cjs.map +1 -0
  15. package/lib/commercelayer.d.cts +1 -1
  16. package/lib/commercelayer.d.ts +1 -1
  17. package/lib/commercelayer.js +2 -0
  18. package/lib/commercelayer.js.map +1 -0
  19. package/lib/config.cjs +2 -0
  20. package/lib/config.cjs.map +1 -0
  21. package/lib/config.js +2 -0
  22. package/lib/config.js.map +1 -0
  23. package/lib/debug.cjs +2 -0
  24. package/lib/debug.cjs.map +1 -0
  25. package/lib/debug.js +2 -0
  26. package/lib/debug.js.map +1 -0
  27. package/lib/enum.cjs +2 -0
  28. package/lib/enum.cjs.map +1 -0
  29. package/lib/enum.d.cts +1 -1
  30. package/lib/enum.d.ts +1 -1
  31. package/lib/enum.js +2 -0
  32. package/lib/enum.js.map +1 -0
  33. package/lib/error.cjs +2 -0
  34. package/lib/error.cjs.map +1 -0
  35. package/lib/error.js +2 -0
  36. package/lib/error.js.map +1 -0
  37. package/lib/fetch.cjs +2 -0
  38. package/lib/fetch.cjs.map +1 -0
  39. package/lib/fetch.js +2 -0
  40. package/lib/fetch.js.map +1 -0
  41. package/lib/index.cjs +2 -0
  42. package/lib/index.cjs.map +1 -0
  43. package/lib/index.d.cts +1 -1
  44. package/lib/index.d.ts +1 -1
  45. package/lib/index.js +2 -0
  46. package/lib/index.js.map +1 -0
  47. package/lib/interceptor.cjs +2 -0
  48. package/lib/interceptor.cjs.map +1 -0
  49. package/lib/interceptor.js +2 -0
  50. package/lib/interceptor.js.map +1 -0
  51. package/lib/jsonapi.cjs +12 -10
  52. package/lib/jsonapi.cjs.map +1 -0
  53. package/lib/jsonapi.d.cts +1 -1
  54. package/lib/jsonapi.d.ts +1 -1
  55. package/lib/jsonapi.js +3 -1
  56. package/lib/jsonapi.js.map +1 -0
  57. package/lib/model.cjs +2 -0
  58. package/lib/model.cjs.map +1 -0
  59. package/lib/model.d.cts +1 -1
  60. package/lib/model.d.ts +1 -1
  61. package/lib/model.js +2 -0
  62. package/lib/model.js.map +1 -0
  63. package/lib/query.cjs +2 -0
  64. package/lib/query.cjs.map +1 -0
  65. package/lib/query.d.cts +1 -1
  66. package/lib/query.d.ts +1 -1
  67. package/lib/query.js +2 -0
  68. package/lib/query.js.map +1 -0
  69. package/lib/resource.cjs +11 -0
  70. package/lib/resource.cjs.map +1 -0
  71. package/lib/resource.d.cts +2 -2
  72. package/lib/resource.d.ts +2 -2
  73. package/lib/resource.js +10 -1
  74. package/lib/resource.js.map +1 -0
  75. package/lib/resources/addresses.cjs +2 -0
  76. package/lib/resources/addresses.cjs.map +1 -0
  77. package/lib/resources/addresses.d.cts +1 -1
  78. package/lib/resources/addresses.d.ts +1 -1
  79. package/lib/resources/addresses.js +2 -0
  80. package/lib/resources/addresses.js.map +1 -0
  81. package/lib/resources/adjustments.cjs +2 -0
  82. package/lib/resources/adjustments.cjs.map +1 -0
  83. package/lib/resources/adjustments.d.cts +1 -1
  84. package/lib/resources/adjustments.d.ts +1 -1
  85. package/lib/resources/adjustments.js +2 -0
  86. package/lib/resources/adjustments.js.map +1 -0
  87. package/lib/resources/adyen_gateways.cjs +2 -0
  88. package/lib/resources/adyen_gateways.cjs.map +1 -0
  89. package/lib/resources/adyen_gateways.d.cts +1 -1
  90. package/lib/resources/adyen_gateways.d.ts +1 -1
  91. package/lib/resources/adyen_gateways.js +2 -0
  92. package/lib/resources/adyen_gateways.js.map +1 -0
  93. package/lib/resources/adyen_payments.cjs +2 -0
  94. package/lib/resources/adyen_payments.cjs.map +1 -0
  95. package/lib/resources/adyen_payments.d.cts +1 -1
  96. package/lib/resources/adyen_payments.d.ts +1 -1
  97. package/lib/resources/adyen_payments.js +2 -0
  98. package/lib/resources/adyen_payments.js.map +1 -0
  99. package/lib/resources/applications.cjs +2 -0
  100. package/lib/resources/applications.cjs.map +1 -0
  101. package/lib/resources/applications.d.cts +1 -1
  102. package/lib/resources/applications.d.ts +1 -1
  103. package/lib/resources/applications.js +2 -0
  104. package/lib/resources/applications.js.map +1 -0
  105. package/lib/resources/attachments.cjs +2 -0
  106. package/lib/resources/attachments.cjs.map +1 -0
  107. package/lib/resources/attachments.d.cts +1 -1
  108. package/lib/resources/attachments.d.ts +1 -1
  109. package/lib/resources/attachments.js +2 -0
  110. package/lib/resources/attachments.js.map +1 -0
  111. package/lib/resources/authorizations.cjs +2 -0
  112. package/lib/resources/authorizations.cjs.map +1 -0
  113. package/lib/resources/authorizations.d.cts +1 -1
  114. package/lib/resources/authorizations.d.ts +1 -1
  115. package/lib/resources/authorizations.js +2 -0
  116. package/lib/resources/authorizations.js.map +1 -0
  117. package/lib/resources/avalara_accounts.cjs +2 -0
  118. package/lib/resources/avalara_accounts.cjs.map +1 -0
  119. package/lib/resources/avalara_accounts.d.cts +1 -1
  120. package/lib/resources/avalara_accounts.d.ts +1 -1
  121. package/lib/resources/avalara_accounts.js +2 -0
  122. package/lib/resources/avalara_accounts.js.map +1 -0
  123. package/lib/resources/axerve_gateways.cjs +2 -0
  124. package/lib/resources/axerve_gateways.cjs.map +1 -0
  125. package/lib/resources/axerve_gateways.d.cts +1 -1
  126. package/lib/resources/axerve_gateways.d.ts +1 -1
  127. package/lib/resources/axerve_gateways.js +2 -0
  128. package/lib/resources/axerve_gateways.js.map +1 -0
  129. package/lib/resources/axerve_payments.cjs +2 -0
  130. package/lib/resources/axerve_payments.cjs.map +1 -0
  131. package/lib/resources/axerve_payments.d.cts +1 -1
  132. package/lib/resources/axerve_payments.d.ts +1 -1
  133. package/lib/resources/axerve_payments.js +2 -0
  134. package/lib/resources/axerve_payments.js.map +1 -0
  135. package/lib/resources/bing_geocoders.cjs +2 -0
  136. package/lib/resources/bing_geocoders.cjs.map +1 -0
  137. package/lib/resources/bing_geocoders.d.cts +1 -1
  138. package/lib/resources/bing_geocoders.d.ts +1 -1
  139. package/lib/resources/bing_geocoders.js +2 -0
  140. package/lib/resources/bing_geocoders.js.map +1 -0
  141. package/lib/resources/braintree_gateways.cjs +2 -0
  142. package/lib/resources/braintree_gateways.cjs.map +1 -0
  143. package/lib/resources/braintree_gateways.d.cts +1 -1
  144. package/lib/resources/braintree_gateways.d.ts +1 -1
  145. package/lib/resources/braintree_gateways.js +2 -0
  146. package/lib/resources/braintree_gateways.js.map +1 -0
  147. package/lib/resources/braintree_payments.cjs +2 -0
  148. package/lib/resources/braintree_payments.cjs.map +1 -0
  149. package/lib/resources/braintree_payments.d.cts +1 -1
  150. package/lib/resources/braintree_payments.d.ts +1 -1
  151. package/lib/resources/braintree_payments.js +2 -0
  152. package/lib/resources/braintree_payments.js.map +1 -0
  153. package/lib/resources/bundles.cjs +2 -0
  154. package/lib/resources/bundles.cjs.map +1 -0
  155. package/lib/resources/bundles.d.cts +1 -1
  156. package/lib/resources/bundles.d.ts +1 -1
  157. package/lib/resources/bundles.js +2 -0
  158. package/lib/resources/bundles.js.map +1 -0
  159. package/lib/resources/buy_x_pay_y_promotions.cjs +2 -0
  160. package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -0
  161. package/lib/resources/buy_x_pay_y_promotions.d.cts +1 -1
  162. package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
  163. package/lib/resources/buy_x_pay_y_promotions.js +2 -0
  164. package/lib/resources/buy_x_pay_y_promotions.js.map +1 -0
  165. package/lib/resources/captures.cjs +2 -0
  166. package/lib/resources/captures.cjs.map +1 -0
  167. package/lib/resources/captures.d.cts +1 -1
  168. package/lib/resources/captures.d.ts +1 -1
  169. package/lib/resources/captures.js +2 -0
  170. package/lib/resources/captures.js.map +1 -0
  171. package/lib/resources/carrier_accounts.cjs +2 -0
  172. package/lib/resources/carrier_accounts.cjs.map +1 -0
  173. package/lib/resources/carrier_accounts.d.cts +1 -1
  174. package/lib/resources/carrier_accounts.d.ts +1 -1
  175. package/lib/resources/carrier_accounts.js +2 -0
  176. package/lib/resources/carrier_accounts.js.map +1 -0
  177. package/lib/resources/checkout_com_gateways.cjs +2 -0
  178. package/lib/resources/checkout_com_gateways.cjs.map +1 -0
  179. package/lib/resources/checkout_com_gateways.d.cts +1 -1
  180. package/lib/resources/checkout_com_gateways.d.ts +1 -1
  181. package/lib/resources/checkout_com_gateways.js +2 -0
  182. package/lib/resources/checkout_com_gateways.js.map +1 -0
  183. package/lib/resources/checkout_com_payments.cjs +2 -0
  184. package/lib/resources/checkout_com_payments.cjs.map +1 -0
  185. package/lib/resources/checkout_com_payments.d.cts +1 -1
  186. package/lib/resources/checkout_com_payments.d.ts +1 -1
  187. package/lib/resources/checkout_com_payments.js +2 -0
  188. package/lib/resources/checkout_com_payments.js.map +1 -0
  189. package/lib/resources/cleanups.cjs +2 -0
  190. package/lib/resources/cleanups.cjs.map +1 -0
  191. package/lib/resources/cleanups.d.cts +1 -1
  192. package/lib/resources/cleanups.d.ts +1 -1
  193. package/lib/resources/cleanups.js +2 -0
  194. package/lib/resources/cleanups.js.map +1 -0
  195. package/lib/resources/coupon_codes_promotion_rules.cjs +2 -0
  196. package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -0
  197. package/lib/resources/coupon_codes_promotion_rules.d.cts +1 -1
  198. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
  199. package/lib/resources/coupon_codes_promotion_rules.js +2 -0
  200. package/lib/resources/coupon_codes_promotion_rules.js.map +1 -0
  201. package/lib/resources/coupon_recipients.cjs +2 -0
  202. package/lib/resources/coupon_recipients.cjs.map +1 -0
  203. package/lib/resources/coupon_recipients.d.cts +1 -1
  204. package/lib/resources/coupon_recipients.d.ts +1 -1
  205. package/lib/resources/coupon_recipients.js +2 -0
  206. package/lib/resources/coupon_recipients.js.map +1 -0
  207. package/lib/resources/coupons.cjs +2 -0
  208. package/lib/resources/coupons.cjs.map +1 -0
  209. package/lib/resources/coupons.d.cts +1 -1
  210. package/lib/resources/coupons.d.ts +1 -1
  211. package/lib/resources/coupons.js +2 -0
  212. package/lib/resources/coupons.js.map +1 -0
  213. package/lib/resources/custom_promotion_rules.cjs +2 -0
  214. package/lib/resources/custom_promotion_rules.cjs.map +1 -0
  215. package/lib/resources/custom_promotion_rules.d.cts +1 -1
  216. package/lib/resources/custom_promotion_rules.d.ts +1 -1
  217. package/lib/resources/custom_promotion_rules.js +2 -0
  218. package/lib/resources/custom_promotion_rules.js.map +1 -0
  219. package/lib/resources/customer_addresses.cjs +2 -0
  220. package/lib/resources/customer_addresses.cjs.map +1 -0
  221. package/lib/resources/customer_addresses.d.cts +1 -1
  222. package/lib/resources/customer_addresses.d.ts +1 -1
  223. package/lib/resources/customer_addresses.js +2 -0
  224. package/lib/resources/customer_addresses.js.map +1 -0
  225. package/lib/resources/customer_groups.cjs +2 -0
  226. package/lib/resources/customer_groups.cjs.map +1 -0
  227. package/lib/resources/customer_groups.d.cts +1 -1
  228. package/lib/resources/customer_groups.d.ts +1 -1
  229. package/lib/resources/customer_groups.js +2 -0
  230. package/lib/resources/customer_groups.js.map +1 -0
  231. package/lib/resources/customer_password_resets.cjs +2 -0
  232. package/lib/resources/customer_password_resets.cjs.map +1 -0
  233. package/lib/resources/customer_password_resets.d.cts +1 -1
  234. package/lib/resources/customer_password_resets.d.ts +1 -1
  235. package/lib/resources/customer_password_resets.js +2 -0
  236. package/lib/resources/customer_password_resets.js.map +1 -0
  237. package/lib/resources/customer_payment_sources.cjs +2 -0
  238. package/lib/resources/customer_payment_sources.cjs.map +1 -0
  239. package/lib/resources/customer_payment_sources.d.cts +1 -1
  240. package/lib/resources/customer_payment_sources.d.ts +1 -1
  241. package/lib/resources/customer_payment_sources.js +2 -0
  242. package/lib/resources/customer_payment_sources.js.map +1 -0
  243. package/lib/resources/customer_subscriptions.cjs +2 -0
  244. package/lib/resources/customer_subscriptions.cjs.map +1 -0
  245. package/lib/resources/customer_subscriptions.d.cts +1 -1
  246. package/lib/resources/customer_subscriptions.d.ts +1 -1
  247. package/lib/resources/customer_subscriptions.js +2 -0
  248. package/lib/resources/customer_subscriptions.js.map +1 -0
  249. package/lib/resources/customers.cjs +2 -0
  250. package/lib/resources/customers.cjs.map +1 -0
  251. package/lib/resources/customers.d.cts +1 -1
  252. package/lib/resources/customers.d.ts +1 -1
  253. package/lib/resources/customers.js +2 -0
  254. package/lib/resources/customers.js.map +1 -0
  255. package/lib/resources/delivery_lead_times.cjs +2 -0
  256. package/lib/resources/delivery_lead_times.cjs.map +1 -0
  257. package/lib/resources/delivery_lead_times.d.cts +1 -1
  258. package/lib/resources/delivery_lead_times.d.ts +1 -1
  259. package/lib/resources/delivery_lead_times.js +2 -0
  260. package/lib/resources/delivery_lead_times.js.map +1 -0
  261. package/lib/resources/discount_engine_items.cjs +2 -0
  262. package/lib/resources/discount_engine_items.cjs.map +1 -0
  263. package/lib/resources/discount_engine_items.d.cts +1 -1
  264. package/lib/resources/discount_engine_items.d.ts +1 -1
  265. package/lib/resources/discount_engine_items.js +2 -0
  266. package/lib/resources/discount_engine_items.js.map +1 -0
  267. package/lib/resources/discount_engines.cjs +2 -0
  268. package/lib/resources/discount_engines.cjs.map +1 -0
  269. package/lib/resources/discount_engines.d.cts +1 -1
  270. package/lib/resources/discount_engines.d.ts +1 -1
  271. package/lib/resources/discount_engines.js +2 -0
  272. package/lib/resources/discount_engines.js.map +1 -0
  273. package/lib/resources/easypost_pickups.cjs +2 -0
  274. package/lib/resources/easypost_pickups.cjs.map +1 -0
  275. package/lib/resources/easypost_pickups.d.cts +1 -1
  276. package/lib/resources/easypost_pickups.d.ts +1 -1
  277. package/lib/resources/easypost_pickups.js +2 -0
  278. package/lib/resources/easypost_pickups.js.map +1 -0
  279. package/lib/resources/event_callbacks.cjs +2 -0
  280. package/lib/resources/event_callbacks.cjs.map +1 -0
  281. package/lib/resources/event_callbacks.d.cts +1 -1
  282. package/lib/resources/event_callbacks.d.ts +1 -1
  283. package/lib/resources/event_callbacks.js +2 -0
  284. package/lib/resources/event_callbacks.js.map +1 -0
  285. package/lib/resources/events.cjs +2 -0
  286. package/lib/resources/events.cjs.map +1 -0
  287. package/lib/resources/events.d.cts +1 -1
  288. package/lib/resources/events.d.ts +1 -1
  289. package/lib/resources/events.js +2 -0
  290. package/lib/resources/events.js.map +1 -0
  291. package/lib/resources/exports.cjs +2 -0
  292. package/lib/resources/exports.cjs.map +1 -0
  293. package/lib/resources/exports.d.cts +1 -1
  294. package/lib/resources/exports.d.ts +1 -1
  295. package/lib/resources/exports.js +2 -0
  296. package/lib/resources/exports.js.map +1 -0
  297. package/lib/resources/external_gateways.cjs +2 -0
  298. package/lib/resources/external_gateways.cjs.map +1 -0
  299. package/lib/resources/external_gateways.d.cts +1 -1
  300. package/lib/resources/external_gateways.d.ts +1 -1
  301. package/lib/resources/external_gateways.js +2 -0
  302. package/lib/resources/external_gateways.js.map +1 -0
  303. package/lib/resources/external_payments.cjs +2 -0
  304. package/lib/resources/external_payments.cjs.map +1 -0
  305. package/lib/resources/external_payments.d.cts +1 -1
  306. package/lib/resources/external_payments.d.ts +1 -1
  307. package/lib/resources/external_payments.js +2 -0
  308. package/lib/resources/external_payments.js.map +1 -0
  309. package/lib/resources/external_promotions.cjs +2 -0
  310. package/lib/resources/external_promotions.cjs.map +1 -0
  311. package/lib/resources/external_promotions.d.cts +1 -1
  312. package/lib/resources/external_promotions.d.ts +1 -1
  313. package/lib/resources/external_promotions.js +2 -0
  314. package/lib/resources/external_promotions.js.map +1 -0
  315. package/lib/resources/external_tax_calculators.cjs +2 -0
  316. package/lib/resources/external_tax_calculators.cjs.map +1 -0
  317. package/lib/resources/external_tax_calculators.d.cts +1 -1
  318. package/lib/resources/external_tax_calculators.d.ts +1 -1
  319. package/lib/resources/external_tax_calculators.js +2 -0
  320. package/lib/resources/external_tax_calculators.js.map +1 -0
  321. package/lib/resources/fixed_amount_promotions.cjs +2 -0
  322. package/lib/resources/fixed_amount_promotions.cjs.map +1 -0
  323. package/lib/resources/fixed_amount_promotions.d.cts +1 -1
  324. package/lib/resources/fixed_amount_promotions.d.ts +1 -1
  325. package/lib/resources/fixed_amount_promotions.js +2 -0
  326. package/lib/resources/fixed_amount_promotions.js.map +1 -0
  327. package/lib/resources/fixed_price_promotions.cjs +2 -0
  328. package/lib/resources/fixed_price_promotions.cjs.map +1 -0
  329. package/lib/resources/fixed_price_promotions.d.cts +1 -1
  330. package/lib/resources/fixed_price_promotions.d.ts +1 -1
  331. package/lib/resources/fixed_price_promotions.js +2 -0
  332. package/lib/resources/fixed_price_promotions.js.map +1 -0
  333. package/lib/resources/flex_promotions.cjs +2 -0
  334. package/lib/resources/flex_promotions.cjs.map +1 -0
  335. package/lib/resources/flex_promotions.d.cts +1 -1
  336. package/lib/resources/flex_promotions.d.ts +1 -1
  337. package/lib/resources/flex_promotions.js +2 -0
  338. package/lib/resources/flex_promotions.js.map +1 -0
  339. package/lib/resources/free_gift_promotions.cjs +2 -0
  340. package/lib/resources/free_gift_promotions.cjs.map +1 -0
  341. package/lib/resources/free_gift_promotions.d.cts +1 -1
  342. package/lib/resources/free_gift_promotions.d.ts +1 -1
  343. package/lib/resources/free_gift_promotions.js +2 -0
  344. package/lib/resources/free_gift_promotions.js.map +1 -0
  345. package/lib/resources/free_shipping_promotions.cjs +2 -0
  346. package/lib/resources/free_shipping_promotions.cjs.map +1 -0
  347. package/lib/resources/free_shipping_promotions.d.cts +1 -1
  348. package/lib/resources/free_shipping_promotions.d.ts +1 -1
  349. package/lib/resources/free_shipping_promotions.js +2 -0
  350. package/lib/resources/free_shipping_promotions.js.map +1 -0
  351. package/lib/resources/geocoders.cjs +2 -0
  352. package/lib/resources/geocoders.cjs.map +1 -0
  353. package/lib/resources/geocoders.d.cts +1 -1
  354. package/lib/resources/geocoders.d.ts +1 -1
  355. package/lib/resources/geocoders.js +2 -0
  356. package/lib/resources/geocoders.js.map +1 -0
  357. package/lib/resources/gift_card_recipients.cjs +2 -0
  358. package/lib/resources/gift_card_recipients.cjs.map +1 -0
  359. package/lib/resources/gift_card_recipients.d.cts +1 -1
  360. package/lib/resources/gift_card_recipients.d.ts +1 -1
  361. package/lib/resources/gift_card_recipients.js +2 -0
  362. package/lib/resources/gift_card_recipients.js.map +1 -0
  363. package/lib/resources/gift_cards.cjs +2 -0
  364. package/lib/resources/gift_cards.cjs.map +1 -0
  365. package/lib/resources/gift_cards.d.cts +1 -1
  366. package/lib/resources/gift_cards.d.ts +1 -1
  367. package/lib/resources/gift_cards.js +2 -0
  368. package/lib/resources/gift_cards.js.map +1 -0
  369. package/lib/resources/google_geocoders.cjs +2 -0
  370. package/lib/resources/google_geocoders.cjs.map +1 -0
  371. package/lib/resources/google_geocoders.d.cts +1 -1
  372. package/lib/resources/google_geocoders.d.ts +1 -1
  373. package/lib/resources/google_geocoders.js +2 -0
  374. package/lib/resources/google_geocoders.js.map +1 -0
  375. package/lib/resources/imports.cjs +2 -0
  376. package/lib/resources/imports.cjs.map +1 -0
  377. package/lib/resources/imports.d.cts +1 -1
  378. package/lib/resources/imports.d.ts +1 -1
  379. package/lib/resources/imports.js +2 -0
  380. package/lib/resources/imports.js.map +1 -0
  381. package/lib/resources/in_stock_subscriptions.cjs +2 -0
  382. package/lib/resources/in_stock_subscriptions.cjs.map +1 -0
  383. package/lib/resources/in_stock_subscriptions.d.cts +1 -1
  384. package/lib/resources/in_stock_subscriptions.d.ts +1 -1
  385. package/lib/resources/in_stock_subscriptions.js +2 -0
  386. package/lib/resources/in_stock_subscriptions.js.map +1 -0
  387. package/lib/resources/inventory_models.cjs +2 -0
  388. package/lib/resources/inventory_models.cjs.map +1 -0
  389. package/lib/resources/inventory_models.d.cts +1 -1
  390. package/lib/resources/inventory_models.d.ts +1 -1
  391. package/lib/resources/inventory_models.js +2 -0
  392. package/lib/resources/inventory_models.js.map +1 -0
  393. package/lib/resources/inventory_return_locations.cjs +2 -0
  394. package/lib/resources/inventory_return_locations.cjs.map +1 -0
  395. package/lib/resources/inventory_return_locations.d.cts +1 -1
  396. package/lib/resources/inventory_return_locations.d.ts +1 -1
  397. package/lib/resources/inventory_return_locations.js +2 -0
  398. package/lib/resources/inventory_return_locations.js.map +1 -0
  399. package/lib/resources/inventory_stock_locations.cjs +2 -0
  400. package/lib/resources/inventory_stock_locations.cjs.map +1 -0
  401. package/lib/resources/inventory_stock_locations.d.cts +1 -1
  402. package/lib/resources/inventory_stock_locations.d.ts +1 -1
  403. package/lib/resources/inventory_stock_locations.js +2 -0
  404. package/lib/resources/inventory_stock_locations.js.map +1 -0
  405. package/lib/resources/klarna_gateways.cjs +2 -0
  406. package/lib/resources/klarna_gateways.cjs.map +1 -0
  407. package/lib/resources/klarna_gateways.d.cts +1 -1
  408. package/lib/resources/klarna_gateways.d.ts +1 -1
  409. package/lib/resources/klarna_gateways.js +2 -0
  410. package/lib/resources/klarna_gateways.js.map +1 -0
  411. package/lib/resources/klarna_payments.cjs +2 -0
  412. package/lib/resources/klarna_payments.cjs.map +1 -0
  413. package/lib/resources/klarna_payments.d.cts +1 -1
  414. package/lib/resources/klarna_payments.d.ts +1 -1
  415. package/lib/resources/klarna_payments.js +2 -0
  416. package/lib/resources/klarna_payments.js.map +1 -0
  417. package/lib/resources/line_item_options.cjs +2 -0
  418. package/lib/resources/line_item_options.cjs.map +1 -0
  419. package/lib/resources/line_item_options.d.cts +1 -1
  420. package/lib/resources/line_item_options.d.ts +1 -1
  421. package/lib/resources/line_item_options.js +2 -0
  422. package/lib/resources/line_item_options.js.map +1 -0
  423. package/lib/resources/line_items.cjs +2 -0
  424. package/lib/resources/line_items.cjs.map +1 -0
  425. package/lib/resources/line_items.d.cts +1 -1
  426. package/lib/resources/line_items.d.ts +1 -1
  427. package/lib/resources/line_items.js +2 -0
  428. package/lib/resources/line_items.js.map +1 -0
  429. package/lib/resources/links.cjs +2 -0
  430. package/lib/resources/links.cjs.map +1 -0
  431. package/lib/resources/links.d.cts +1 -1
  432. package/lib/resources/links.d.ts +1 -1
  433. package/lib/resources/links.js +2 -0
  434. package/lib/resources/links.js.map +1 -0
  435. package/lib/resources/manual_gateways.cjs +2 -0
  436. package/lib/resources/manual_gateways.cjs.map +1 -0
  437. package/lib/resources/manual_gateways.d.cts +1 -1
  438. package/lib/resources/manual_gateways.d.ts +1 -1
  439. package/lib/resources/manual_gateways.js +2 -0
  440. package/lib/resources/manual_gateways.js.map +1 -0
  441. package/lib/resources/manual_tax_calculators.cjs +2 -0
  442. package/lib/resources/manual_tax_calculators.cjs.map +1 -0
  443. package/lib/resources/manual_tax_calculators.d.cts +1 -1
  444. package/lib/resources/manual_tax_calculators.d.ts +1 -1
  445. package/lib/resources/manual_tax_calculators.js +2 -0
  446. package/lib/resources/manual_tax_calculators.js.map +1 -0
  447. package/lib/resources/markets.cjs +2 -0
  448. package/lib/resources/markets.cjs.map +1 -0
  449. package/lib/resources/markets.d.cts +1 -1
  450. package/lib/resources/markets.d.ts +1 -1
  451. package/lib/resources/markets.js +2 -0
  452. package/lib/resources/markets.js.map +1 -0
  453. package/lib/resources/merchants.cjs +2 -0
  454. package/lib/resources/merchants.cjs.map +1 -0
  455. package/lib/resources/merchants.d.cts +1 -1
  456. package/lib/resources/merchants.d.ts +1 -1
  457. package/lib/resources/merchants.js +2 -0
  458. package/lib/resources/merchants.js.map +1 -0
  459. package/lib/resources/notifications.cjs +2 -0
  460. package/lib/resources/notifications.cjs.map +1 -0
  461. package/lib/resources/notifications.d.cts +1 -1
  462. package/lib/resources/notifications.d.ts +1 -1
  463. package/lib/resources/notifications.js +2 -0
  464. package/lib/resources/notifications.js.map +1 -0
  465. package/lib/resources/order_amount_promotion_rules.cjs +2 -0
  466. package/lib/resources/order_amount_promotion_rules.cjs.map +1 -0
  467. package/lib/resources/order_amount_promotion_rules.d.cts +1 -1
  468. package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
  469. package/lib/resources/order_amount_promotion_rules.js +2 -0
  470. package/lib/resources/order_amount_promotion_rules.js.map +1 -0
  471. package/lib/resources/order_copies.cjs +2 -0
  472. package/lib/resources/order_copies.cjs.map +1 -0
  473. package/lib/resources/order_copies.d.cts +1 -1
  474. package/lib/resources/order_copies.d.ts +1 -1
  475. package/lib/resources/order_copies.js +2 -0
  476. package/lib/resources/order_copies.js.map +1 -0
  477. package/lib/resources/order_factories.cjs +2 -0
  478. package/lib/resources/order_factories.cjs.map +1 -0
  479. package/lib/resources/order_factories.d.cts +1 -1
  480. package/lib/resources/order_factories.d.ts +1 -1
  481. package/lib/resources/order_factories.js +2 -0
  482. package/lib/resources/order_factories.js.map +1 -0
  483. package/lib/resources/order_subscription_items.cjs +2 -0
  484. package/lib/resources/order_subscription_items.cjs.map +1 -0
  485. package/lib/resources/order_subscription_items.d.cts +1 -1
  486. package/lib/resources/order_subscription_items.d.ts +1 -1
  487. package/lib/resources/order_subscription_items.js +2 -0
  488. package/lib/resources/order_subscription_items.js.map +1 -0
  489. package/lib/resources/order_subscriptions.cjs +2 -0
  490. package/lib/resources/order_subscriptions.cjs.map +1 -0
  491. package/lib/resources/order_subscriptions.d.cts +1 -1
  492. package/lib/resources/order_subscriptions.d.ts +1 -1
  493. package/lib/resources/order_subscriptions.js +2 -0
  494. package/lib/resources/order_subscriptions.js.map +1 -0
  495. package/lib/resources/orders.cjs +2 -0
  496. package/lib/resources/orders.cjs.map +1 -0
  497. package/lib/resources/orders.d.cts +1 -1
  498. package/lib/resources/orders.d.ts +1 -1
  499. package/lib/resources/orders.js +2 -0
  500. package/lib/resources/orders.js.map +1 -0
  501. package/lib/resources/organizations.cjs +2 -0
  502. package/lib/resources/organizations.cjs.map +1 -0
  503. package/lib/resources/organizations.d.cts +1 -1
  504. package/lib/resources/organizations.d.ts +1 -1
  505. package/lib/resources/organizations.js +2 -0
  506. package/lib/resources/organizations.js.map +1 -0
  507. package/lib/resources/packages.cjs +2 -0
  508. package/lib/resources/packages.cjs.map +1 -0
  509. package/lib/resources/packages.d.cts +1 -1
  510. package/lib/resources/packages.d.ts +1 -1
  511. package/lib/resources/packages.js +2 -0
  512. package/lib/resources/packages.js.map +1 -0
  513. package/lib/resources/parcel_line_items.cjs +2 -0
  514. package/lib/resources/parcel_line_items.cjs.map +1 -0
  515. package/lib/resources/parcel_line_items.d.cts +1 -1
  516. package/lib/resources/parcel_line_items.d.ts +1 -1
  517. package/lib/resources/parcel_line_items.js +2 -0
  518. package/lib/resources/parcel_line_items.js.map +1 -0
  519. package/lib/resources/parcels.cjs +2 -0
  520. package/lib/resources/parcels.cjs.map +1 -0
  521. package/lib/resources/parcels.d.cts +1 -1
  522. package/lib/resources/parcels.d.ts +1 -1
  523. package/lib/resources/parcels.js +2 -0
  524. package/lib/resources/parcels.js.map +1 -0
  525. package/lib/resources/payment_gateways.cjs +2 -0
  526. package/lib/resources/payment_gateways.cjs.map +1 -0
  527. package/lib/resources/payment_gateways.d.cts +1 -1
  528. package/lib/resources/payment_gateways.d.ts +1 -1
  529. package/lib/resources/payment_gateways.js +2 -0
  530. package/lib/resources/payment_gateways.js.map +1 -0
  531. package/lib/resources/payment_methods.cjs +2 -0
  532. package/lib/resources/payment_methods.cjs.map +1 -0
  533. package/lib/resources/payment_methods.d.cts +1 -1
  534. package/lib/resources/payment_methods.d.ts +1 -1
  535. package/lib/resources/payment_methods.js +2 -0
  536. package/lib/resources/payment_methods.js.map +1 -0
  537. package/lib/resources/payment_options.cjs +2 -0
  538. package/lib/resources/payment_options.cjs.map +1 -0
  539. package/lib/resources/payment_options.d.cts +1 -1
  540. package/lib/resources/payment_options.d.ts +1 -1
  541. package/lib/resources/payment_options.js +2 -0
  542. package/lib/resources/payment_options.js.map +1 -0
  543. package/lib/resources/paypal_gateways.cjs +2 -0
  544. package/lib/resources/paypal_gateways.cjs.map +1 -0
  545. package/lib/resources/paypal_gateways.d.cts +1 -1
  546. package/lib/resources/paypal_gateways.d.ts +1 -1
  547. package/lib/resources/paypal_gateways.js +2 -0
  548. package/lib/resources/paypal_gateways.js.map +1 -0
  549. package/lib/resources/paypal_payments.cjs +2 -0
  550. package/lib/resources/paypal_payments.cjs.map +1 -0
  551. package/lib/resources/paypal_payments.d.cts +1 -1
  552. package/lib/resources/paypal_payments.d.ts +1 -1
  553. package/lib/resources/paypal_payments.js +2 -0
  554. package/lib/resources/paypal_payments.js.map +1 -0
  555. package/lib/resources/percentage_discount_promotions.cjs +2 -0
  556. package/lib/resources/percentage_discount_promotions.cjs.map +1 -0
  557. package/lib/resources/percentage_discount_promotions.d.cts +1 -1
  558. package/lib/resources/percentage_discount_promotions.d.ts +1 -1
  559. package/lib/resources/percentage_discount_promotions.js +2 -0
  560. package/lib/resources/percentage_discount_promotions.js.map +1 -0
  561. package/lib/resources/pickups.cjs +2 -0
  562. package/lib/resources/pickups.cjs.map +1 -0
  563. package/lib/resources/pickups.d.cts +1 -1
  564. package/lib/resources/pickups.d.ts +1 -1
  565. package/lib/resources/pickups.js +2 -0
  566. package/lib/resources/pickups.js.map +1 -0
  567. package/lib/resources/price_frequency_tiers.cjs +2 -0
  568. package/lib/resources/price_frequency_tiers.cjs.map +1 -0
  569. package/lib/resources/price_frequency_tiers.d.cts +1 -1
  570. package/lib/resources/price_frequency_tiers.d.ts +1 -1
  571. package/lib/resources/price_frequency_tiers.js +2 -0
  572. package/lib/resources/price_frequency_tiers.js.map +1 -0
  573. package/lib/resources/price_list_schedulers.cjs +2 -0
  574. package/lib/resources/price_list_schedulers.cjs.map +1 -0
  575. package/lib/resources/price_list_schedulers.d.cts +1 -1
  576. package/lib/resources/price_list_schedulers.d.ts +1 -1
  577. package/lib/resources/price_list_schedulers.js +2 -0
  578. package/lib/resources/price_list_schedulers.js.map +1 -0
  579. package/lib/resources/price_lists.cjs +2 -0
  580. package/lib/resources/price_lists.cjs.map +1 -0
  581. package/lib/resources/price_lists.d.cts +1 -1
  582. package/lib/resources/price_lists.d.ts +1 -1
  583. package/lib/resources/price_lists.js +2 -0
  584. package/lib/resources/price_lists.js.map +1 -0
  585. package/lib/resources/price_tiers.cjs +2 -0
  586. package/lib/resources/price_tiers.cjs.map +1 -0
  587. package/lib/resources/price_tiers.d.cts +1 -1
  588. package/lib/resources/price_tiers.d.ts +1 -1
  589. package/lib/resources/price_tiers.js +2 -0
  590. package/lib/resources/price_tiers.js.map +1 -0
  591. package/lib/resources/price_volume_tiers.cjs +2 -0
  592. package/lib/resources/price_volume_tiers.cjs.map +1 -0
  593. package/lib/resources/price_volume_tiers.d.cts +1 -1
  594. package/lib/resources/price_volume_tiers.d.ts +1 -1
  595. package/lib/resources/price_volume_tiers.js +2 -0
  596. package/lib/resources/price_volume_tiers.js.map +1 -0
  597. package/lib/resources/prices.cjs +2 -0
  598. package/lib/resources/prices.cjs.map +1 -0
  599. package/lib/resources/prices.d.cts +1 -1
  600. package/lib/resources/prices.d.ts +1 -1
  601. package/lib/resources/prices.js +2 -0
  602. package/lib/resources/prices.js.map +1 -0
  603. package/lib/resources/promotion_rules.cjs +2 -0
  604. package/lib/resources/promotion_rules.cjs.map +1 -0
  605. package/lib/resources/promotion_rules.d.cts +1 -1
  606. package/lib/resources/promotion_rules.d.ts +1 -1
  607. package/lib/resources/promotion_rules.js +2 -0
  608. package/lib/resources/promotion_rules.js.map +1 -0
  609. package/lib/resources/promotions.cjs +2 -0
  610. package/lib/resources/promotions.cjs.map +1 -0
  611. package/lib/resources/promotions.d.cts +1 -1
  612. package/lib/resources/promotions.d.ts +1 -1
  613. package/lib/resources/promotions.js +2 -0
  614. package/lib/resources/promotions.js.map +1 -0
  615. package/lib/resources/recurring_order_copies.cjs +2 -0
  616. package/lib/resources/recurring_order_copies.cjs.map +1 -0
  617. package/lib/resources/recurring_order_copies.d.cts +1 -1
  618. package/lib/resources/recurring_order_copies.d.ts +1 -1
  619. package/lib/resources/recurring_order_copies.js +2 -0
  620. package/lib/resources/recurring_order_copies.js.map +1 -0
  621. package/lib/resources/refunds.cjs +2 -0
  622. package/lib/resources/refunds.cjs.map +1 -0
  623. package/lib/resources/refunds.d.cts +1 -1
  624. package/lib/resources/refunds.d.ts +1 -1
  625. package/lib/resources/refunds.js +2 -0
  626. package/lib/resources/refunds.js.map +1 -0
  627. package/lib/resources/reserved_stocks.cjs +2 -0
  628. package/lib/resources/reserved_stocks.cjs.map +1 -0
  629. package/lib/resources/reserved_stocks.d.cts +1 -1
  630. package/lib/resources/reserved_stocks.d.ts +1 -1
  631. package/lib/resources/reserved_stocks.js +2 -0
  632. package/lib/resources/reserved_stocks.js.map +1 -0
  633. package/lib/resources/resource_errors.cjs +2 -0
  634. package/lib/resources/resource_errors.cjs.map +1 -0
  635. package/lib/resources/resource_errors.d.cts +1 -1
  636. package/lib/resources/resource_errors.d.ts +1 -1
  637. package/lib/resources/resource_errors.js +2 -0
  638. package/lib/resources/resource_errors.js.map +1 -0
  639. package/lib/resources/return_line_items.cjs +2 -0
  640. package/lib/resources/return_line_items.cjs.map +1 -0
  641. package/lib/resources/return_line_items.d.cts +1 -1
  642. package/lib/resources/return_line_items.d.ts +1 -1
  643. package/lib/resources/return_line_items.js +2 -0
  644. package/lib/resources/return_line_items.js.map +1 -0
  645. package/lib/resources/returns.cjs +2 -0
  646. package/lib/resources/returns.cjs.map +1 -0
  647. package/lib/resources/returns.d.cts +1 -1
  648. package/lib/resources/returns.d.ts +1 -1
  649. package/lib/resources/returns.js +2 -0
  650. package/lib/resources/returns.js.map +1 -0
  651. package/lib/resources/satispay_gateways.cjs +2 -0
  652. package/lib/resources/satispay_gateways.cjs.map +1 -0
  653. package/lib/resources/satispay_gateways.d.cts +1 -1
  654. package/lib/resources/satispay_gateways.d.ts +1 -1
  655. package/lib/resources/satispay_gateways.js +2 -0
  656. package/lib/resources/satispay_gateways.js.map +1 -0
  657. package/lib/resources/satispay_payments.cjs +2 -0
  658. package/lib/resources/satispay_payments.cjs.map +1 -0
  659. package/lib/resources/satispay_payments.d.cts +1 -1
  660. package/lib/resources/satispay_payments.d.ts +1 -1
  661. package/lib/resources/satispay_payments.js +2 -0
  662. package/lib/resources/satispay_payments.js.map +1 -0
  663. package/lib/resources/shipments.cjs +2 -0
  664. package/lib/resources/shipments.cjs.map +1 -0
  665. package/lib/resources/shipments.d.cts +1 -1
  666. package/lib/resources/shipments.d.ts +1 -1
  667. package/lib/resources/shipments.js +2 -0
  668. package/lib/resources/shipments.js.map +1 -0
  669. package/lib/resources/shipping_categories.cjs +2 -0
  670. package/lib/resources/shipping_categories.cjs.map +1 -0
  671. package/lib/resources/shipping_categories.d.cts +1 -1
  672. package/lib/resources/shipping_categories.d.ts +1 -1
  673. package/lib/resources/shipping_categories.js +2 -0
  674. package/lib/resources/shipping_categories.js.map +1 -0
  675. package/lib/resources/shipping_method_tiers.cjs +2 -0
  676. package/lib/resources/shipping_method_tiers.cjs.map +1 -0
  677. package/lib/resources/shipping_method_tiers.d.cts +1 -1
  678. package/lib/resources/shipping_method_tiers.d.ts +1 -1
  679. package/lib/resources/shipping_method_tiers.js +2 -0
  680. package/lib/resources/shipping_method_tiers.js.map +1 -0
  681. package/lib/resources/shipping_methods.cjs +2 -0
  682. package/lib/resources/shipping_methods.cjs.map +1 -0
  683. package/lib/resources/shipping_methods.d.cts +1 -1
  684. package/lib/resources/shipping_methods.d.ts +1 -1
  685. package/lib/resources/shipping_methods.js +2 -0
  686. package/lib/resources/shipping_methods.js.map +1 -0
  687. package/lib/resources/shipping_weight_tiers.cjs +2 -0
  688. package/lib/resources/shipping_weight_tiers.cjs.map +1 -0
  689. package/lib/resources/shipping_weight_tiers.d.cts +1 -1
  690. package/lib/resources/shipping_weight_tiers.d.ts +1 -1
  691. package/lib/resources/shipping_weight_tiers.js +2 -0
  692. package/lib/resources/shipping_weight_tiers.js.map +1 -0
  693. package/lib/resources/shipping_zones.cjs +2 -0
  694. package/lib/resources/shipping_zones.cjs.map +1 -0
  695. package/lib/resources/shipping_zones.d.cts +1 -1
  696. package/lib/resources/shipping_zones.d.ts +1 -1
  697. package/lib/resources/shipping_zones.js +2 -0
  698. package/lib/resources/shipping_zones.js.map +1 -0
  699. package/lib/resources/sku_list_items.cjs +2 -0
  700. package/lib/resources/sku_list_items.cjs.map +1 -0
  701. package/lib/resources/sku_list_items.d.cts +1 -1
  702. package/lib/resources/sku_list_items.d.ts +1 -1
  703. package/lib/resources/sku_list_items.js +2 -0
  704. package/lib/resources/sku_list_items.js.map +1 -0
  705. package/lib/resources/sku_list_promotion_rules.cjs +2 -0
  706. package/lib/resources/sku_list_promotion_rules.cjs.map +1 -0
  707. package/lib/resources/sku_list_promotion_rules.d.cts +1 -1
  708. package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
  709. package/lib/resources/sku_list_promotion_rules.js +2 -0
  710. package/lib/resources/sku_list_promotion_rules.js.map +1 -0
  711. package/lib/resources/sku_lists.cjs +2 -0
  712. package/lib/resources/sku_lists.cjs.map +1 -0
  713. package/lib/resources/sku_lists.d.cts +1 -1
  714. package/lib/resources/sku_lists.d.ts +1 -1
  715. package/lib/resources/sku_lists.js +2 -0
  716. package/lib/resources/sku_lists.js.map +1 -0
  717. package/lib/resources/sku_options.cjs +2 -0
  718. package/lib/resources/sku_options.cjs.map +1 -0
  719. package/lib/resources/sku_options.d.cts +1 -1
  720. package/lib/resources/sku_options.d.ts +1 -1
  721. package/lib/resources/sku_options.js +2 -0
  722. package/lib/resources/sku_options.js.map +1 -0
  723. package/lib/resources/skus.cjs +2 -0
  724. package/lib/resources/skus.cjs.map +1 -0
  725. package/lib/resources/skus.d.cts +1 -1
  726. package/lib/resources/skus.d.ts +1 -1
  727. package/lib/resources/skus.js +2 -0
  728. package/lib/resources/skus.js.map +1 -0
  729. package/lib/resources/stock_items.cjs +2 -0
  730. package/lib/resources/stock_items.cjs.map +1 -0
  731. package/lib/resources/stock_items.d.cts +1 -1
  732. package/lib/resources/stock_items.d.ts +1 -1
  733. package/lib/resources/stock_items.js +2 -0
  734. package/lib/resources/stock_items.js.map +1 -0
  735. package/lib/resources/stock_line_items.cjs +2 -0
  736. package/lib/resources/stock_line_items.cjs.map +1 -0
  737. package/lib/resources/stock_line_items.d.cts +1 -1
  738. package/lib/resources/stock_line_items.d.ts +1 -1
  739. package/lib/resources/stock_line_items.js +2 -0
  740. package/lib/resources/stock_line_items.js.map +1 -0
  741. package/lib/resources/stock_locations.cjs +2 -0
  742. package/lib/resources/stock_locations.cjs.map +1 -0
  743. package/lib/resources/stock_locations.d.cts +1 -1
  744. package/lib/resources/stock_locations.d.ts +1 -1
  745. package/lib/resources/stock_locations.js +2 -0
  746. package/lib/resources/stock_locations.js.map +1 -0
  747. package/lib/resources/stock_reservations.cjs +2 -0
  748. package/lib/resources/stock_reservations.cjs.map +1 -0
  749. package/lib/resources/stock_reservations.d.cts +1 -1
  750. package/lib/resources/stock_reservations.d.ts +1 -1
  751. package/lib/resources/stock_reservations.js +2 -0
  752. package/lib/resources/stock_reservations.js.map +1 -0
  753. package/lib/resources/stock_transfers.cjs +2 -0
  754. package/lib/resources/stock_transfers.cjs.map +1 -0
  755. package/lib/resources/stock_transfers.d.cts +1 -1
  756. package/lib/resources/stock_transfers.d.ts +1 -1
  757. package/lib/resources/stock_transfers.js +2 -0
  758. package/lib/resources/stock_transfers.js.map +1 -0
  759. package/lib/resources/stores.cjs +2 -0
  760. package/lib/resources/stores.cjs.map +1 -0
  761. package/lib/resources/stores.d.cts +1 -1
  762. package/lib/resources/stores.d.ts +1 -1
  763. package/lib/resources/stores.js +2 -0
  764. package/lib/resources/stores.js.map +1 -0
  765. package/lib/resources/stripe_gateways.cjs +2 -0
  766. package/lib/resources/stripe_gateways.cjs.map +1 -0
  767. package/lib/resources/stripe_gateways.d.cts +1 -1
  768. package/lib/resources/stripe_gateways.d.ts +1 -1
  769. package/lib/resources/stripe_gateways.js +2 -0
  770. package/lib/resources/stripe_gateways.js.map +1 -0
  771. package/lib/resources/stripe_payments.cjs +2 -0
  772. package/lib/resources/stripe_payments.cjs.map +1 -0
  773. package/lib/resources/stripe_payments.d.cts +1 -1
  774. package/lib/resources/stripe_payments.d.ts +1 -1
  775. package/lib/resources/stripe_payments.js +2 -0
  776. package/lib/resources/stripe_payments.js.map +1 -0
  777. package/lib/resources/stripe_tax_accounts.cjs +2 -0
  778. package/lib/resources/stripe_tax_accounts.cjs.map +1 -0
  779. package/lib/resources/stripe_tax_accounts.d.cts +1 -1
  780. package/lib/resources/stripe_tax_accounts.d.ts +1 -1
  781. package/lib/resources/stripe_tax_accounts.js +2 -0
  782. package/lib/resources/stripe_tax_accounts.js.map +1 -0
  783. package/lib/resources/subscription_models.cjs +2 -0
  784. package/lib/resources/subscription_models.cjs.map +1 -0
  785. package/lib/resources/subscription_models.d.cts +1 -1
  786. package/lib/resources/subscription_models.d.ts +1 -1
  787. package/lib/resources/subscription_models.js +2 -0
  788. package/lib/resources/subscription_models.js.map +1 -0
  789. package/lib/resources/tags.cjs +2 -0
  790. package/lib/resources/tags.cjs.map +1 -0
  791. package/lib/resources/tags.d.cts +1 -1
  792. package/lib/resources/tags.d.ts +1 -1
  793. package/lib/resources/tags.js +2 -0
  794. package/lib/resources/tags.js.map +1 -0
  795. package/lib/resources/talon_one_accounts.cjs +2 -0
  796. package/lib/resources/talon_one_accounts.cjs.map +1 -0
  797. package/lib/resources/talon_one_accounts.d.cts +1 -1
  798. package/lib/resources/talon_one_accounts.d.ts +1 -1
  799. package/lib/resources/talon_one_accounts.js +2 -0
  800. package/lib/resources/talon_one_accounts.js.map +1 -0
  801. package/lib/resources/tax_calculators.cjs +2 -0
  802. package/lib/resources/tax_calculators.cjs.map +1 -0
  803. package/lib/resources/tax_calculators.d.cts +1 -1
  804. package/lib/resources/tax_calculators.d.ts +1 -1
  805. package/lib/resources/tax_calculators.js +2 -0
  806. package/lib/resources/tax_calculators.js.map +1 -0
  807. package/lib/resources/tax_categories.cjs +2 -0
  808. package/lib/resources/tax_categories.cjs.map +1 -0
  809. package/lib/resources/tax_categories.d.cts +1 -1
  810. package/lib/resources/tax_categories.d.ts +1 -1
  811. package/lib/resources/tax_categories.js +2 -0
  812. package/lib/resources/tax_categories.js.map +1 -0
  813. package/lib/resources/tax_rules.cjs +2 -0
  814. package/lib/resources/tax_rules.cjs.map +1 -0
  815. package/lib/resources/tax_rules.d.cts +1 -1
  816. package/lib/resources/tax_rules.d.ts +1 -1
  817. package/lib/resources/tax_rules.js +2 -0
  818. package/lib/resources/tax_rules.js.map +1 -0
  819. package/lib/resources/taxjar_accounts.cjs +2 -0
  820. package/lib/resources/taxjar_accounts.cjs.map +1 -0
  821. package/lib/resources/taxjar_accounts.d.cts +1 -1
  822. package/lib/resources/taxjar_accounts.d.ts +1 -1
  823. package/lib/resources/taxjar_accounts.js +2 -0
  824. package/lib/resources/taxjar_accounts.js.map +1 -0
  825. package/lib/resources/transactions.cjs +2 -0
  826. package/lib/resources/transactions.cjs.map +1 -0
  827. package/lib/resources/transactions.d.cts +1 -1
  828. package/lib/resources/transactions.d.ts +1 -1
  829. package/lib/resources/transactions.js +2 -0
  830. package/lib/resources/transactions.js.map +1 -0
  831. package/lib/resources/versions.cjs +2 -0
  832. package/lib/resources/versions.cjs.map +1 -0
  833. package/lib/resources/versions.d.cts +1 -1
  834. package/lib/resources/versions.d.ts +1 -1
  835. package/lib/resources/versions.js +2 -0
  836. package/lib/resources/versions.js.map +1 -0
  837. package/lib/resources/vertex_accounts.cjs +2 -0
  838. package/lib/resources/vertex_accounts.cjs.map +1 -0
  839. package/lib/resources/vertex_accounts.d.cts +1 -1
  840. package/lib/resources/vertex_accounts.d.ts +1 -1
  841. package/lib/resources/vertex_accounts.js +2 -0
  842. package/lib/resources/vertex_accounts.js.map +1 -0
  843. package/lib/resources/voids.cjs +2 -0
  844. package/lib/resources/voids.cjs.map +1 -0
  845. package/lib/resources/voids.d.cts +1 -1
  846. package/lib/resources/voids.d.ts +1 -1
  847. package/lib/resources/voids.js +2 -0
  848. package/lib/resources/voids.js.map +1 -0
  849. package/lib/resources/webhooks.cjs +2 -0
  850. package/lib/resources/webhooks.cjs.map +1 -0
  851. package/lib/resources/webhooks.d.cts +1 -1
  852. package/lib/resources/webhooks.d.ts +1 -1
  853. package/lib/resources/webhooks.js +2 -0
  854. package/lib/resources/webhooks.js.map +1 -0
  855. package/lib/resources/wire_transfers.cjs +2 -0
  856. package/lib/resources/wire_transfers.cjs.map +1 -0
  857. package/lib/resources/wire_transfers.d.cts +1 -1
  858. package/lib/resources/wire_transfers.d.ts +1 -1
  859. package/lib/resources/wire_transfers.js +2 -0
  860. package/lib/resources/wire_transfers.js.map +1 -0
  861. package/lib/static.cjs +2 -0
  862. package/lib/static.cjs.map +1 -0
  863. package/lib/static.d.cts +1 -1
  864. package/lib/static.d.ts +1 -1
  865. package/lib/static.js +2 -0
  866. package/lib/static.js.map +1 -0
  867. package/lib/types.cjs +2 -0
  868. package/lib/types.cjs.map +1 -0
  869. package/lib/types.js +2 -0
  870. package/lib/types.js.map +1 -0
  871. package/lib/util.cjs +2 -0
  872. package/lib/util.cjs.map +1 -0
  873. package/lib/util.js +2 -0
  874. package/lib/util.js.map +1 -0
  875. package/package.json +1 -1
  876. package/lib/common.cjs +0 -17
  877. package/lib/common.d.cts +0 -13
  878. package/lib/common.d.ts +0 -13
  879. package/lib/common.js +0 -13
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsonapi.ts"],"names":["Debug","inc","config","resource","isResourceType","isResourceId"],"mappings":";;;;;;;;;;;AAQA,MAAM,KAAA,GAAQA,uBAAM,SAAS,CAAA;AAQvB,MAAA,WAAA,GAAc,CAAqB,QAAmC,KAAA;AAE3E,EAAI,IAAA,CAAC,UAAiB,OAAA,QAAA;AAEtB,EAAI,IAAA,oBAAA;AAEJ,EAAI,IAAA,QAAA,CAAS,KAAO,EAAA,OAAO,QAAS,CA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MAAM,OAAQ,CAAA,KAAK,CAAM,IAAA,KAAA,CAAM,WAAW,CAAM,IAAAC,uBAAA,CAAe,KAAM,CAAA,CAAC,CAAC,CAAO,IAAA,KAAA,CAAM,CAAC,CAAA,CAAkB,OAAO,IAAO,EAAA;AACxH,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,EAAG,EAAA;AAAA,eAG/B,KAAS,IAAAA,uBAAA,CAAe,KAAK,CAAO,IAAA,KAAA,CAAsB,OAAO,IAAO,EAAA;AAC3E,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,IAAK,EAAA;AAAA,KAGjC,MAAA,IAAA,KAAA,KAAUC,qBAAa,CAAA,KAAK,CAAM,IAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,CAAK,IAAAA,qBAAA,CAAa,KAAM,CAAA,CAAC,CAAC,CAAK,CAAA,EAAA;AACvF,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAkC,EAAA;AAAA,KAClE,MACgB,UAAA,CAAA,KAAK,CAAI,GAAA,KAAA;AAAA;AAG1B,EAAA,MAAM,UAA4B,GAAA;AAAA,IACjC,MAAMF,UAAS,CAAA,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAIE,qBAAa,CAAAF,UAAQ,CAAG,EAAA,UAAA,CAAW,KAAKA,UAAS,CAAA,EAAA;AAErD,EAAA,KAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAO,OAAA,UAAA;AAER","file":"jsonapi.cjs","sourcesContent":["\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
package/lib/jsonapi.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DocWithData, ResourceObject } from 'jsonapi-typescript';
2
2
  export { DocWithData } from 'jsonapi-typescript';
3
- import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-CRmSToGa.cjs';
3
+ import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-DmIZO_Np.cjs';
4
4
  import './client.cjs';
5
5
  import './interceptor-5MISI1yn.cjs';
6
6
  import './types.cjs';
package/lib/jsonapi.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DocWithData, ResourceObject } from 'jsonapi-typescript';
2
2
  export { DocWithData } from 'jsonapi-typescript';
3
- import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-CUXmETkx.js';
3
+ import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-DDgIE2i8.js';
4
4
  import './client.js';
5
5
  import './interceptor-5MISI1yn.js';
6
6
  import './types.js';
package/lib/jsonapi.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isResourceType, isResourceId } from './common';
1
+ import { isResourceType, isResourceId } from './resource';
2
2
  import config from './config';
3
3
  import Debug from './debug';
4
4
 
@@ -69,3 +69,5 @@ const normalize = (resource) => {
69
69
  };
70
70
 
71
71
  export { denormalize, normalize };
72
+ //# sourceMappingURL=jsonapi.js.map
73
+ //# sourceMappingURL=jsonapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsonapi.ts"],"names":["inc"],"mappings":";;;;AAQA,MAAM,KAAA,GAAQ,MAAM,SAAS,CAAA;AAQvB,MAAA,WAAA,GAAc,CAAqB,QAAmC,KAAA;AAE3E,EAAI,IAAA,CAAC,UAAiB,OAAA,QAAA;AAEtB,EAAI,IAAA,oBAAA;AAEJ,EAAI,IAAA,QAAA,CAAS,KAAO,EAAA,OAAO,QAAS,CAAA,KAAA;AAEpC,EAAA,MAAM,OAAO,QAAS,CAAA,IAAA;AACtB,EAAA,MAAM,WAAW,QAAS,CAAA,QAAA;AAE1B,EAAI,IAAA,CAAC,MAA6B,oBAAA,GAAA,IAAA;AAAA,OAC7B;AACJ,IAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,IAAI,CAAG,EAAA,oBAAA,GAAuB,IAAK,CAAA,GAAA,CAAI,CAAO,GAAA,KAAA,mBAAA,CAAuB,GAAK,EAAA,QAAQ,CAAC,CAAA;AAAA,SAChG,oBAAA,GAAuB,mBAAuB,CAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAGlE,EAAO,OAAA,oBAAA;AAER;AAGA,MAAM,YAAe,GAAA,CAAC,GAA+B,EAAA,QAAA,GAAqB,EAAkC,KAAA;AAC3G,EAAA,MAAM,GAAM,GAAA,QAAA,CAAS,IAAK,CAAA,CAAAA,IAAO,KAAA;AAChC,IAA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,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAkC,EAAA;AAAA,KAClE,MACgB,UAAA,CAAA,KAAK,CAAI,GAAA,KAAA;AAAA;AAG1B,EAAA,MAAM,UAA4B,GAAA;AAAA,IACjC,MAAM,QAAS,CAAA,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAa,CAAA,QAAQ,CAAG,EAAA,UAAA,CAAW,KAAK,QAAS,CAAA,EAAA;AAErD,EAAA,KAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAO,OAAA,UAAA;AAER","file":"jsonapi.js","sourcesContent":["\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
package/lib/model.cjs CHANGED
@@ -1,2 +1,4 @@
1
1
  'use strict';
2
2
 
3
+ //# sourceMappingURL=model.cjs.map
4
+ //# sourceMappingURL=model.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"model.cjs"}
package/lib/model.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, h9 as ResourceError, ha as ResourceErrorSort, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, j7 as Version, j8 as VersionSort, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate } from './api-CRmSToGa.cjs';
1
+ export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, h9 as ResourceError, ha as ResourceErrorSort, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, j7 as Version, j8 as VersionSort, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate } from './api-DmIZO_Np.cjs';
2
2
  import './client.cjs';
3
3
  import './interceptor-5MISI1yn.cjs';
4
4
  import './types.cjs';
package/lib/model.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, h9 as ResourceError, ha as ResourceErrorSort, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, j7 as Version, j8 as VersionSort, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate } from './api-CUXmETkx.js';
1
+ export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, h9 as ResourceError, ha as ResourceErrorSort, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, j7 as Version, j8 as VersionSort, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate } from './api-DDgIE2i8.js';
2
2
  import './client.js';
3
3
  import './interceptor-5MISI1yn.js';
4
4
  import './types.js';
package/lib/model.js CHANGED
@@ -1 +1,3 @@
1
1
 
2
+ //# sourceMappingURL=model.js.map
3
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"model.js"}
package/lib/query.cjs CHANGED
@@ -62,3 +62,5 @@ const generateSearchString = (params, questionMark = true) => {
62
62
  exports.generateQueryStringParams = generateQueryStringParams;
63
63
  exports.generateSearchString = generateSearchString;
64
64
  exports.isParamsList = isParamsList;
65
+ //# sourceMappingURL=query.cjs.map
66
+ //# sourceMappingURL=query.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/query.ts"],"names":["Debug","SdkError","ErrorType"],"mappings":";;;;;;;;;AAOA,MAAM,KAAA,GAAQA,uBAAM,OAAO,CAAA;AAG3B,MAAM,YAAe,GAAA,CAAC,MAAQ,EAAA,MAAA,EAAQ,OAAO,iBAAiB,CAAA;AAC9D,MAAM,aAAA,GAAgB,CAAC,MAA4B,KAAA;AAClD,EAAA,OAAO,aAAa,IAAK,CAAA,CAAA,CAAA,KAAK,MAAO,CAAA,QAAA,CAAS,CAAC,CAAC,CAAA;AACjD,CAAA;AAEA,MAAM,aAAA,GAAgB,CAAC,QAAQ,CAAA;AAC/B,MAAM,cAAA,GAAiB,CAAC,MAA4B,KAAA;AACnD,EAAA,OAAO,cAAc,IAAK,CAAA,CAAA,CAAA,KAAK,MAAO,CAAA,QAAA,CAAS,CAAC,CAAC,CAAA;AAClD,CAAA;AAyCM,MAAA,YAAA,GAAe,CAAqB,MA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A,OACxB,CAAA;AAAA;AACF;AAGD,EAAA,KAAA,CAAM,2BAA2B,EAAE,CAAA;AAEnC,EAAO,OAAA,EAAA;AAER;AAGA,MAAM,oBAAuB,GAAA,CAAC,MAA4B,EAAA,YAAA,GAAwB,IAAiB,KAAA;AAClG,EAAI,IAAA,CAAC,UAAW,MAAO,CAAA,IAAA,CAAK,MAAM,CAAE,CAAA,MAAA,KAAW,GAAW,OAAA,EAAA;AAC1D,EAAO,OAAA,CAAA,EAAG,YAAe,GAAA,GAAA,GAAM,EAAE,CAAA,EAAG,OAAO,OAAQ,CAAA,MAAM,CAAE,CAAA,GAAA,CAAI,CAAC,CAAC,KAAK,GAAG,CAAA,KAAM,CAAG,EAAA,GAAG,CAAI,CAAA,EAAA,MAAA,CAAO,GAAG,CAAC,CAAE,CAAA,CAAA,CAAE,IAAK,CAAA,GAAG,CAAC,CAAA,CAAA;AAClH","file":"query.cjs","sourcesContent":["\nimport type { Resource, ResourceType } from \"./resource\"\nimport { ErrorType, SdkError } from \"./error\"\nimport type { PositiveNumberRange, StringKey } from \"./types\"\nimport type { ResourceFields, ResourceSortFields, ResourceTypeLock } from \"./enum\"\n\nimport Debug from './debug'\nconst debug = Debug('query')\n\n\nconst arrayFilters = ['_any', '_all', '_in', '_not_in_or_null']\nconst isArrayFilter = (filter: string): boolean => {\n\treturn arrayFilters.some(f => filter.endsWith(f))\n}\n\nconst objectFilters = ['_jcont']\nconst isObjectFilter = (filter: string): boolean => {\n\treturn objectFilters.some(f => filter.endsWith(f))\n}\n\n\n// type QueryResType<T> = T extends { type: infer Type } ? Type : never\ntype QueryResType<T extends Resource> = T['type']\n\nexport type QueryInclude = string[]\n\ntype QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R]\ntype QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>\ntype QueryRecordFields = { [key in keyof ResourceFields]?: Array<(QueryResourceFields<key>)> }\nexport type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields\n\nexport interface QueryParamsRetrieve<R extends Resource = Resource> {\n\tinclude?: QueryInclude\n\tfields?: QueryFields<R>\n}\n\ntype QuerySortType = 'asc' | 'desc'\ntype QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>]\ntype QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>\ntype QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>\ntype QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>\nexport type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>\n\nexport type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>\n\nexport type QueryPageNumber = number\nexport type QueryPageSize = PositiveNumberRange<25>\n\nexport interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {\n\tsort?: QuerySort<R>\n\tfilters?: QueryFilter\n\tpageNumber?: QueryPageNumber\n\tpageSize?: QueryPageSize\n}\n\nexport type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>\n\n\n\nconst isParamsList = <R extends Resource>(params: any): params is QueryParamsList<R> => {\n\treturn params && (params.filters || params.pageNumber || params.pageSize || params.sort)\n}\n\n\ntype QueryStringParams = Record<string, string>\n\nconst generateQueryStringParams = <R extends Resource>(params: QueryParams<R> | undefined, res: string | ResourceType): QueryStringParams => {\n\n\tdebug('generate query string params: %O, %O', params, res)\n\n\tconst qp: QueryStringParams = {}\n\tif (!params) return qp\n\n\t// Include\n\tif (params.include) qp.include = params.include.join(',')\n\t// Fields\n\tif (params.fields) {\n\t\tif (Array.isArray(params.fields)) params.fields = { [(res as ResourceType).type || res]: params.fields }\n\t\tObject.entries(params.fields).forEach(([p, v]) => {\n\t\t\tqp[`fields[${p}]`] = v.join(',')\n\t\t})\n\t}\n\n\tif (isParamsList(params)) {\n\t\t// Sort\n\t\tif (params.sort) {\n\t\t\tif (Array.isArray(params.sort)) qp.sort = params.sort.join(',')\n\t\t\telse qp.sort = Object.entries(params.sort).map(([k, v]) => `${v === 'desc' ? '-' : ''}${k}`).join(',')\n\t\t}\n\t\t// Page\n\t\tif (params.pageNumber) qp['page[number]'] = String(params.pageNumber)\n\t\tif (params.pageSize) qp['page[size]'] = String(params.pageSize)\n\t\t// Filters\n\t\tif (params.filters) {\n\t\t\tObject.entries(params.filters).forEach(([p, v]) => {\n\t\t\t\tlet val\n\t\t\t\tif (Array.isArray(v)) {\n\t\t\t\t\tif (!isArrayFilter(p)) throw new SdkError({ message: `Incorrect filter [${p}]: Array value is supported only for the following filters: ${arrayFilters.join(', ')}`, type: ErrorType.REQUEST })\n\t\t\t\t\tval = v.join(',')\n\t\t\t\t}\n\t\t\t\telse if (typeof v === 'object') {\n\t\t\t\t\tif (!isObjectFilter(p)) throw new SdkError({ message: `Incorrect filter [${p}]: Object value is supported only for the following filters: ${objectFilters.join(', ')}`, type: ErrorType.REQUEST })\n\t\t\t\t\tval = JSON.stringify(v)\n\t\t\t\t}\n\t\t\t\telse val = String(v)\n\t\t\t\tqp[`filter[q][${p}]`] = val\n\t\t\t})\n\t\t}\n\t}\n\n\tdebug('query string params: %O', qp)\n\n\treturn qp\n\n}\n\n\nconst generateSearchString = (params?: QueryStringParams, questionMark: boolean = true): string => {\n\tif (!params || (Object.keys(params).length === 0)) return ''\n\treturn `${questionMark ? '?' : ''}${Object.entries(params).map(([key, val]) => `${key}=${String(val)}`).join('&')}`\n}\n\n\nexport { generateQueryStringParams, isParamsList, generateSearchString }\n"]}
package/lib/query.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, lH as generateQueryStringParams, lJ as generateSearchString, lI as isParamsList } from './api-CRmSToGa.cjs';
1
+ export { a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, lH as generateQueryStringParams, lJ as generateSearchString, lI as isParamsList } from './api-DmIZO_Np.cjs';
2
2
  import './types.cjs';
3
3
  import './client.cjs';
4
4
  import './interceptor-5MISI1yn.cjs';
package/lib/query.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, lH as generateQueryStringParams, lJ as generateSearchString, lI as isParamsList } from './api-CUXmETkx.js';
1
+ export { a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, lH as generateQueryStringParams, lJ as generateSearchString, lI as isParamsList } from './api-DDgIE2i8.js';
2
2
  import './types.js';
3
3
  import './client.js';
4
4
  import './interceptor-5MISI1yn.js';
package/lib/query.js CHANGED
@@ -54,3 +54,5 @@ const generateSearchString = (params, questionMark = true) => {
54
54
  };
55
55
 
56
56
  export { generateQueryStringParams, generateSearchString, isParamsList };
57
+ //# sourceMappingURL=query.js.map
58
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/query.ts"],"names":[],"mappings":";;;AAOA,MAAM,KAAA,GAAQ,MAAM,OAAO,CAAA;AAG3B,MAAM,YAAe,GAAA,CAAC,MAAQ,EAAA,MAAA,EAAQ,OAAO,iBAAiB,CAAA;AAC9D,MAAM,aAAA,GAAgB,CAAC,MAA4B,KAAA;AAClD,EAAA,OAAO,aAAa,IAAK,CAAA,CAAA,CAAA,KAAK,MAAO,CAAA,QAAA,CAAS,CAAC,CAAC,CAAA;AACjD,CAAA;AAEA,MAAM,aAAA,GAAgB,CAAC,QAAQ,CAAA;AAC/B,MAAM,cAAA,GAAiB,CAAC,MAA4B,KAAA;AACnD,EAAA,OAAO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AAA,GAAA,MAAA,CAAO,CAAC,CAAA;AACnB,QAAG,EAAA,CAAA,CAAA,UAAA,EAAa,CAAC,CAAA,CAAA,CAAG,CAAI,GAAA,GAAA;AAAA,OACxB,CAAA;AAAA;AACF;AAGD,EAAA,KAAA,CAAM,2BAA2B,EAAE,CAAA;AAEnC,EAAO,OAAA,EAAA;AAER;AAGA,MAAM,oBAAuB,GAAA,CAAC,MAA4B,EAAA,YAAA,GAAwB,IAAiB,KAAA;AAClG,EAAI,IAAA,CAAC,UAAW,MAAO,CAAA,IAAA,CAAK,MAAM,CAAE,CAAA,MAAA,KAAW,GAAW,OAAA,EAAA;AAC1D,EAAO,OAAA,CAAA,EAAG,YAAe,GAAA,GAAA,GAAM,EAAE,CAAA,EAAG,OAAO,OAAQ,CAAA,MAAM,CAAE,CAAA,GAAA,CAAI,CAAC,CAAC,KAAK,GAAG,CAAA,KAAM,CAAG,EAAA,GAAG,CAAI,CAAA,EAAA,MAAA,CAAO,GAAG,CAAC,CAAE,CAAA,CAAA,CAAE,IAAK,CAAA,GAAG,CAAC,CAAA,CAAA;AAClH","file":"query.js","sourcesContent":["\nimport type { Resource, ResourceType } from \"./resource\"\nimport { ErrorType, SdkError } from \"./error\"\nimport type { PositiveNumberRange, StringKey } from \"./types\"\nimport type { ResourceFields, ResourceSortFields, ResourceTypeLock } from \"./enum\"\n\nimport Debug from './debug'\nconst debug = Debug('query')\n\n\nconst arrayFilters = ['_any', '_all', '_in', '_not_in_or_null']\nconst isArrayFilter = (filter: string): boolean => {\n\treturn arrayFilters.some(f => filter.endsWith(f))\n}\n\nconst objectFilters = ['_jcont']\nconst isObjectFilter = (filter: string): boolean => {\n\treturn objectFilters.some(f => filter.endsWith(f))\n}\n\n\n// type QueryResType<T> = T extends { type: infer Type } ? Type : never\ntype QueryResType<T extends Resource> = T['type']\n\nexport type QueryInclude = string[]\n\ntype QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R]\ntype QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>\ntype QueryRecordFields = { [key in keyof ResourceFields]?: Array<(QueryResourceFields<key>)> }\nexport type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields\n\nexport interface QueryParamsRetrieve<R extends Resource = Resource> {\n\tinclude?: QueryInclude\n\tfields?: QueryFields<R>\n}\n\ntype QuerySortType = 'asc' | 'desc'\ntype QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>]\ntype QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>\ntype QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>\ntype QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>\nexport type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>\n\nexport type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>\n\nexport type QueryPageNumber = number\nexport type QueryPageSize = PositiveNumberRange<25>\n\nexport interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {\n\tsort?: QuerySort<R>\n\tfilters?: QueryFilter\n\tpageNumber?: QueryPageNumber\n\tpageSize?: QueryPageSize\n}\n\nexport type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>\n\n\n\nconst isParamsList = <R extends Resource>(params: any): params is QueryParamsList<R> => {\n\treturn params && (params.filters || params.pageNumber || params.pageSize || params.sort)\n}\n\n\ntype QueryStringParams = Record<string, string>\n\nconst generateQueryStringParams = <R extends Resource>(params: QueryParams<R> | undefined, res: string | ResourceType): QueryStringParams => {\n\n\tdebug('generate query string params: %O, %O', params, res)\n\n\tconst qp: QueryStringParams = {}\n\tif (!params) return qp\n\n\t// Include\n\tif (params.include) qp.include = params.include.join(',')\n\t// Fields\n\tif (params.fields) {\n\t\tif (Array.isArray(params.fields)) params.fields = { [(res as ResourceType).type || res]: params.fields }\n\t\tObject.entries(params.fields).forEach(([p, v]) => {\n\t\t\tqp[`fields[${p}]`] = v.join(',')\n\t\t})\n\t}\n\n\tif (isParamsList(params)) {\n\t\t// Sort\n\t\tif (params.sort) {\n\t\t\tif (Array.isArray(params.sort)) qp.sort = params.sort.join(',')\n\t\t\telse qp.sort = Object.entries(params.sort).map(([k, v]) => `${v === 'desc' ? '-' : ''}${k}`).join(',')\n\t\t}\n\t\t// Page\n\t\tif (params.pageNumber) qp['page[number]'] = String(params.pageNumber)\n\t\tif (params.pageSize) qp['page[size]'] = String(params.pageSize)\n\t\t// Filters\n\t\tif (params.filters) {\n\t\t\tObject.entries(params.filters).forEach(([p, v]) => {\n\t\t\t\tlet val\n\t\t\t\tif (Array.isArray(v)) {\n\t\t\t\t\tif (!isArrayFilter(p)) throw new SdkError({ message: `Incorrect filter [${p}]: Array value is supported only for the following filters: ${arrayFilters.join(', ')}`, type: ErrorType.REQUEST })\n\t\t\t\t\tval = v.join(',')\n\t\t\t\t}\n\t\t\t\telse if (typeof v === 'object') {\n\t\t\t\t\tif (!isObjectFilter(p)) throw new SdkError({ message: `Incorrect filter [${p}]: Object value is supported only for the following filters: ${objectFilters.join(', ')}`, type: ErrorType.REQUEST })\n\t\t\t\t\tval = JSON.stringify(v)\n\t\t\t\t}\n\t\t\t\telse val = String(v)\n\t\t\t\tqp[`filter[q][${p}]`] = val\n\t\t\t})\n\t\t}\n\t}\n\n\tdebug('query string params: %O', qp)\n\n\treturn qp\n\n}\n\n\nconst generateSearchString = (params?: QueryStringParams, questionMark: boolean = true): string => {\n\tif (!params || (Object.keys(params).length === 0)) return ''\n\treturn `${questionMark ? '?' : ''}${Object.entries(params).map(([key, val]) => `${key}=${String(val)}`).join('&')}`\n}\n\n\nexport { generateQueryStringParams, isParamsList, generateSearchString }\n"]}
package/lib/resource.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var ApiClient = require('./client');
4
4
  var jsonapi = require('./jsonapi');
5
5
  var query = require('./query');
6
+ var _enum = require('./enum');
6
7
  var config = require('./config');
7
8
  var error = require('./error');
8
9
  var Debug = require('./debug');
@@ -201,7 +202,17 @@ class ApiSingleton extends ApiResourceBase {
201
202
  return this.resources.singleton({ type: this.type() }, params, options, this.path());
202
203
  }
203
204
  }
205
+ const isResourceId = (resource) => {
206
+ return resource?.type && resource.id && _enum.resourceList.includes(resource.type);
207
+ };
208
+ const isResourceType = (resource) => {
209
+ return resource && typeof resource.type !== "undefined" && resource.type && _enum.resourceList.includes(resource.type);
210
+ };
204
211
 
205
212
  exports.ApiResource = ApiResource;
206
213
  exports.ApiResourceAdapter = ApiResourceAdapter;
207
214
  exports.ApiSingleton = ApiSingleton;
215
+ exports.isResourceId = isResourceId;
216
+ exports.isResourceType = isResourceType;
217
+ //# sourceMappingURL=resource.cjs.map
218
+ //# sourceMappingURL=resource.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource.ts"],"names":["Debug","config","SdkError","ApiClient","generateQueryStringParams","denormalize","normalize","isParamsList","resourceList"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,KAAA,GAAQA,uBAAM,UAAU,CAAA;AAoD9B,MAAM,qBAAoD,KAAS,CAAA;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAW,EAAA;AACtC,IAAM,KAAA,CAAA,GAAI,IAAQ,IAAA,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AAAA;AACb,EAEA,KAAuB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,MAAA,GAAS,IAAK,CAAA,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAClE,IAAsB,GAAA;AAAE,IAAA,OAAO,KAAK,MAAS,GAAA,IAAA,CAAK,IAAK,CAAA,MAAA,GAAS,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAC/E,IAAI,KAA8B,EAAA;AAAE,IAAA,OAAQ,KAAK,MAAW,IAAA,KAAA,IAAS,CAAM,GAAA,IAAA,CAAK,KAAK,CAAI,GAAA,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,CAAA,OAAA,CAAQ,QAAS,CAAA,IAAA,CAAK,WAAW,CAAA;AAAA;AAGlD;AAGA,MAAe,qBAAyC,eAAmB,CAAA;AAAA,EAE1E,MAAM,QAAS,CAAA,MAAA,EAAiC,OAAuC,EAAA;AACtF,IAAA,OAAO,IAAK,CAAA,SAAA,CAAU,SAAa,CAAA,EAAE,IAAM,EAAA,IAAA,CAAK,IAAK,EAAA,EAAK,EAAA,MAAA,EAAQ,OAAS,EAAA,IAAA,CAAK,MAAM,CAAA;AAAA;AAGxF;AAQa,MAAA,YAAA,GAAe,CAAC,QAA0C,KAAA;AACtE,EAAA,OAAQ,UAAU,IAAQ,IAAA,QAAA,CAAS,MAAOC,kBAAa,CAAA,QAAA,CAAS,SAAS,IAAwB,CAAA;AAClG;AAEa,MAAA,cAAA,GAAiB,CAAC,QAA4C,KAAA;AAC1E,EAAO,OAAA,QAAA,IAAa,OAAO,QAAA,CAAS,IAAS,KAAA,WAAA,IAAgB,SAAS,IAAQ,IAAAA,kBAAA,CAAa,QAAS,CAAA,QAAA,CAAS,IAAwB,CAAA;AACtI","file":"resource.cjs","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\n\n\nimport Debug from './debug'\nimport { ObjectType } from './types'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\treturn (ApiResourceAdapter.adapter = new ResourceAdapter(config))\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\t// if (typeof config.xyz !== 'undefined') this.#config.xyz = config.xyz\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t// #resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\t// this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn /* this.#resources || (this.#resources = */ApiResourceAdapter.get()//)\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import './client.cjs';
2
- export { lL as ApiResource, lK as ApiResourceAdapter, lM as ApiSingleton, m as ListMeta, L as ListResponse, M as Metadata, j as Resource, k as ResourceCreate, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig } from './api-CRmSToGa.cjs';
3
- import './interceptor-5MISI1yn.cjs';
2
+ export { lL as ApiResource, lK as ApiResourceAdapter, lM as ApiSingleton, m as ListMeta, L as ListResponse, M as Metadata, j as Resource, k as ResourceCreate, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig, lN as isResourceId, lO as isResourceType } from './api-DmIZO_Np.cjs';
4
3
  import './types.cjs';
4
+ import './interceptor-5MISI1yn.cjs';
package/lib/resource.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import './client.js';
2
- export { lL as ApiResource, lK as ApiResourceAdapter, lM as ApiSingleton, m as ListMeta, L as ListResponse, M as Metadata, j as Resource, k as ResourceCreate, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig } from './api-CUXmETkx.js';
3
- import './interceptor-5MISI1yn.js';
2
+ export { lL as ApiResource, lK as ApiResourceAdapter, lM as ApiSingleton, m as ListMeta, L as ListResponse, M as Metadata, j as Resource, k as ResourceCreate, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig, lN as isResourceId, lO as isResourceType } from './api-DDgIE2i8.js';
4
3
  import './types.js';
4
+ import './interceptor-5MISI1yn.js';
package/lib/resource.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import ApiClient from './client';
2
2
  import { denormalize, normalize } from './jsonapi';
3
3
  import { generateQueryStringParams, isParamsList } from './query';
4
+ import { resourceList } from './enum';
4
5
  import config from './config';
5
6
  import { SdkError } from './error';
6
7
  import Debug from './debug';
@@ -193,5 +194,13 @@ class ApiSingleton extends ApiResourceBase {
193
194
  return this.resources.singleton({ type: this.type() }, params, options, this.path());
194
195
  }
195
196
  }
197
+ const isResourceId = (resource) => {
198
+ return resource?.type && resource.id && resourceList.includes(resource.type);
199
+ };
200
+ const isResourceType = (resource) => {
201
+ return resource && typeof resource.type !== "undefined" && resource.type && resourceList.includes(resource.type);
202
+ };
196
203
 
197
- export { ApiResource, ApiResourceAdapter, ApiSingleton };
204
+ export { ApiResource, ApiResourceAdapter, ApiSingleton, isResourceId, isResourceType };
205
+ //# sourceMappingURL=resource.js.map
206
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource.ts"],"names":["config"],"mappings":";;;;;;;;AAYA,MAAM,KAAA,GAAQ,MAAM,UAAU,CAAA;AAoD9B,MAAM,qBAAoD,KAAS,CAAA;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAW,EAAA;AACtC,IAAM,KAAA,CAAA,GAAI,IAAQ,IAAA,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AAAA;AACb,EAEA,KAAuB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,MAAA,GAAS,IAAK,CAAA,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAClE,IAAsB,GAAA;AAAE,IAAA,OAAO,KAAK,MAAS,GAAA,IAAA,CAAK,IAAK,CAAA,MAAA,GAAS,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAC/E,IAAI,KAA8B,EAAA;AAAE,IAAA,OAAQ,KAAK,MAAW,IAAA,KAAA,IAAS,CAAM,GAAA,IAAA,CAAK,KA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,CAAA,IAAA,CAAK,WAAW,CAAA;AAAA;AAGlD;AAGA,MAAe,qBAAyC,eAAmB,CAAA;AAAA,EAE1E,MAAM,QAAS,CAAA,MAAA,EAAiC,OAAuC,EAAA;AACtF,IAAA,OAAO,IAAK,CAAA,SAAA,CAAU,SAAa,CAAA,EAAE,IAAM,EAAA,IAAA,CAAK,IAAK,EAAA,EAAK,EAAA,MAAA,EAAQ,OAAS,EAAA,IAAA,CAAK,MAAM,CAAA;AAAA;AAGxF;AAQa,MAAA,YAAA,GAAe,CAAC,QAA0C,KAAA;AACtE,EAAA,OAAQ,UAAU,IAAQ,IAAA,QAAA,CAAS,MAAO,YAAa,CAAA,QAAA,CAAS,SAAS,IAAwB,CAAA;AAClG;AAEa,MAAA,cAAA,GAAiB,CAAC,QAA4C,KAAA;AAC1E,EAAO,OAAA,QAAA,IAAa,OAAO,QAAA,CAAS,IAAS,KAAA,WAAA,IAAgB,SAAS,IAAQ,IAAA,YAAA,CAAa,QAAS,CAAA,QAAA,CAAS,IAAwB,CAAA;AACtI","file":"resource.js","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\n\n\nimport Debug from './debug'\nimport { ObjectType } from './types'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\treturn (ApiResourceAdapter.adapter = new ResourceAdapter(config))\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\t// if (typeof config.xyz !== 'undefined') this.#config.xyz = config.xyz\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t// #resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\t// this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn /* this.#resources || (this.#resources = */ApiResourceAdapter.get()//)\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n"]}
@@ -52,5 +52,7 @@ const instance = new Addresses();
52
52
  var addresses_default = instance;
53
53
 
54
54
  module.exports = addresses_default;
55
+ //# sourceMappingURL=addresses.cjs.map
55
56
 
56
57
  module.exports = exports.default;
58
+ //# sourceMappingURL=addresses.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/addresses.ts"],"names":["ApiResource"],"mappings":";;;;AAgVA,MAAM,kBAAkBA,oBAAqB,CAAA;AAAA,EAE5C,OAAgB,IAAoB,GAAA,WAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,SAAA,CAAU,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACjG,EAEA,MAAM,QAAA,CAAS,SAA6B,EAAA,MAAA,EAAwC,OAA8C,EAAA;AACjI,IAAM,MAAA,UAAA,GAAc,UAAsB,EAAM,IAAA,SAAA;AAChD,IAAO,OAAA,IAAA,CAAK,SAAU,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,SAAU,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjK,EAEA,MAAM,YAAA,CAAa,EAAsB,EAAA,YAAA,EAAsB,QAAuC,OAA6C,EAAA;AAClJ,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACpK,EAGA,UAAU,QAAoC,EAAA;AAC7C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,SAAU,CAAA,IAAA;AAAA;AACtD,EAGA,aAAa,EAA4C,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAA6B,EAAA;AAClD,IAAO,OAAA,KAAA,CAAM,qBAAkC,CAAA,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAoB,GAAA;AACnB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,iBAAQ,GAAA","file":"addresses.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Geocoder, GeocoderType } from './geocoders'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype AddressType = 'addresses'\ntype AddressRel = ResourceRel & { type: AddressType }\ntype GeocoderRel = ResourceRel & { type: GeocoderType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type AddressSort = Pick<Address, 'id' | 'city' | 'state_code' | 'country_code'> & ResourceSort\n// export type AddressFilter = Pick<Address, 'id' | 'business' | 'first_name' | 'last_name' | 'company' | 'line_1' | 'line_2' | 'city' | 'zip_code' | 'state_code' | 'country_code' | 'phone' | 'email' | 'notes' | 'lat' | 'lng' | 'billing_info'> & ResourceFilter\n\n\ninterface Address extends Resource {\n\t\n\treadonly type: AddressType\n\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Company name (business) of first name and last name (personal).\n\t * @example ```\"John Smith\"```\n\t */\n\tfull_name?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1: string\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity: string\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code: string\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code: string\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone: string\n\t/** \n\t * Compact description of the address location, without the full name.\n\t * @example ```\"2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228\"```\n\t */\n\tfull_address?: string | null\n\t/** \n\t * Compact description of the address location, including the full name.\n\t * @example ```\"John Smith, 2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Indicates if the latitude and logitude are present, either geocoded or manually updated.\n\t * @example ```true```\n\t */\n\tis_localized?: boolean | null\n\t/** \n\t * Indicates if the address has been successfully geocoded.\n\t * @example ```true```\n\t */\n\tis_geocoded?: boolean | null\n\t/** \n\t * The geocoder provider name (either Google or Bing).\n\t * @example ```\"google\"```\n\t */\n\tprovider_name?: string | null\n\t/** \n\t * The map url of the geocoded address (if geocoded).\n\t * @example ```\"https://www.google.com/maps/search/?api=1&query=40.6971494,-74.2598672\"```\n\t */\n\tmap_url?: string | null\n\t/** \n\t * The static map image url of the geocoded address (if geocoded).\n\t * @example ```\"https://maps.googleapis.com/maps/api/staticmap?center=40.6971494,-74.2598672&size=640x320&zoom=15\"```\n\t */\n\tstatic_map_url?: string | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\n\tgeocoder?: Geocoder | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface AddressCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1: string\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity: string\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code: string\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code: string\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone: string\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\n\tgeocoder?: GeocoderRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface AddressUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1?: string | null\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity?: string | null\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code?: string | null\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code?: string | null\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone?: string | null\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tgeocoder?: GeocoderRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Addresses extends ApiResource<Address> {\n\n\tstatic readonly TYPE: AddressType = 'addresses' as const\n\n\tasync create(resource: AddressCreate, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.create<AddressCreate, Address>({ ...resource, type: Addresses.TYPE }, params, options)\n\t}\n\n\tasync update(resource: AddressUpdate, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ ...resource, type: Addresses.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Addresses.TYPE } : id, options)\n\t}\n\n\tasync geocoder(addressId: string | Address, params?: QueryParamsRetrieve<Geocoder>, options?: ResourcesConfig): Promise<Geocoder> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Geocoder>({ type: 'geocoders' }, `addresses/${_addressId}/geocoder`, params, options) as unknown as Geocoder\n\t}\n\n\tasync events(addressId: string | Address, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `addresses/${_addressId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(addressId: string | Address, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `addresses/${_addressId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(addressId: string | Address, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `addresses/${_addressId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _add_tags(id: string | Address, triggerValue: string, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ id: (typeof id === 'string')? id: id.id, type: Addresses.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Address, triggerValue: string, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ id: (typeof id === 'string')? id: id.id, type: Addresses.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisAddress(resource: any): resource is Address {\n\t\treturn resource.type && (resource.type === Addresses.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): AddressRel {\n\t\treturn super.relationshipOneToOne<AddressRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): AddressRel[] {\n\t\treturn super.relationshipOneToMany<AddressRel>(...ids)\n\t}\n\n\n\ttype(): AddressType {\n\t\treturn Addresses.TYPE\n\t}\n\n}\n\n\nconst instance = new Addresses()\nexport default instance\n\nexport type { Address, AddressCreate, AddressUpdate, AddressType }\n"]}
@@ -1,4 +1,4 @@
1
- export { bO as Address, bP as AddressCreate, bR as AddressSort, lN as AddressType, bQ as AddressUpdate, E as default } from '../api-CRmSToGa.cjs';
1
+ export { bO as Address, bP as AddressCreate, bR as AddressSort, lP as AddressType, bQ as AddressUpdate, E as default } from '../api-DmIZO_Np.cjs';
2
2
  import '../client.cjs';
3
3
  import '../interceptor-5MISI1yn.cjs';
4
4
  import '../types.cjs';
@@ -1,4 +1,4 @@
1
- export { bO as Address, bP as AddressCreate, bR as AddressSort, lN as AddressType, bQ as AddressUpdate, E as default } from '../api-CUXmETkx.js';
1
+ export { bO as Address, bP as AddressCreate, bR as AddressSort, lP as AddressType, bQ as AddressUpdate, E as default } from '../api-DDgIE2i8.js';
2
2
  import '../client.js';
3
3
  import '../interceptor-5MISI1yn.js';
4
4
  import '../types.js';
@@ -50,3 +50,5 @@ const instance = new Addresses();
50
50
  var addresses_default = instance;
51
51
 
52
52
  export { addresses_default as default };
53
+ //# sourceMappingURL=addresses.js.map
54
+ //# sourceMappingURL=addresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/addresses.ts"],"names":[],"mappings":";;AAgVA,MAAM,kBAAkB,WAAqB,CAAA;AAAA,EAE5C,OAAgB,IAAoB,GAAA,WAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAU,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC5G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,SAAA,CAAU,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACjG,EAEA,MAAM,QAAA,CAAS,SAA6B,EAAA,MAAA,EA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,SAAU,CAAA,MAAA,CAA+B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACjK,EAEA,MAAM,YAAA,CAAa,EAAsB,EAAA,YAAA,EAAsB,QAAuC,OAA6C,EAAA;AAClJ,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,SAAU,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACpK,EAGA,UAAU,QAAoC,EAAA;AAC7C,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,SAAU,CAAA,IAAA;AAAA;AACtD,EAGA,aAAa,EAA4C,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA;AACjD,EAEA,sBAAsB,GAA6B,EAAA;AAClD,IAAO,OAAA,KAAA,CAAM,qBAAkC,CAAA,GAAG,GAAG,CAAA;AAAA;AACtD,EAGA,IAAoB,GAAA;AACnB,IAAA,OAAO,SAAU,CAAA,IAAA;AAAA;AAGnB;AAGA,MAAM,QAAA,GAAW,IAAI,SAAU,EAAA;AAC/B,IAAO,iBAAQ,GAAA","file":"addresses.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Geocoder, GeocoderType } from './geocoders'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\n\n\ntype AddressType = 'addresses'\ntype AddressRel = ResourceRel & { type: AddressType }\ntype GeocoderRel = ResourceRel & { type: GeocoderType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type AddressSort = Pick<Address, 'id' | 'city' | 'state_code' | 'country_code'> & ResourceSort\n// export type AddressFilter = Pick<Address, 'id' | 'business' | 'first_name' | 'last_name' | 'company' | 'line_1' | 'line_2' | 'city' | 'zip_code' | 'state_code' | 'country_code' | 'phone' | 'email' | 'notes' | 'lat' | 'lng' | 'billing_info'> & ResourceFilter\n\n\ninterface Address extends Resource {\n\t\n\treadonly type: AddressType\n\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Company name (business) of first name and last name (personal).\n\t * @example ```\"John Smith\"```\n\t */\n\tfull_name?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1: string\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity: string\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code: string\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code: string\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone: string\n\t/** \n\t * Compact description of the address location, without the full name.\n\t * @example ```\"2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228\"```\n\t */\n\tfull_address?: string | null\n\t/** \n\t * Compact description of the address location, including the full name.\n\t * @example ```\"John Smith, 2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228\"```\n\t */\n\tname?: string | null\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Indicates if the latitude and logitude are present, either geocoded or manually updated.\n\t * @example ```true```\n\t */\n\tis_localized?: boolean | null\n\t/** \n\t * Indicates if the address has been successfully geocoded.\n\t * @example ```true```\n\t */\n\tis_geocoded?: boolean | null\n\t/** \n\t * The geocoder provider name (either Google or Bing).\n\t * @example ```\"google\"```\n\t */\n\tprovider_name?: string | null\n\t/** \n\t * The map url of the geocoded address (if geocoded).\n\t * @example ```\"https://www.google.com/maps/search/?api=1&query=40.6971494,-74.2598672\"```\n\t */\n\tmap_url?: string | null\n\t/** \n\t * The static map image url of the geocoded address (if geocoded).\n\t * @example ```\"https://maps.googleapis.com/maps/api/staticmap?center=40.6971494,-74.2598672&size=640x320&zoom=15\"```\n\t */\n\tstatic_map_url?: string | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\n\tgeocoder?: Geocoder | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface AddressCreate extends ResourceCreate {\n\t\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1: string\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity: string\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code: string\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code: string\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone: string\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\n\tgeocoder?: GeocoderRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface AddressUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * Indicates if it's a business or a personal address.\n\t */\n\tbusiness?: boolean | null\n\t/** \n\t * Address first name (personal).\n\t * @example ```\"John\"```\n\t */\n\tfirst_name?: string | null\n\t/** \n\t * Address last name (personal).\n\t * @example ```\"Smith\"```\n\t */\n\tlast_name?: string | null\n\t/** \n\t * Address company name (business).\n\t * @example ```\"The Red Brand Inc.\"```\n\t */\n\tcompany?: string | null\n\t/** \n\t * Address line 1, i.e. Street address, PO Box.\n\t * @example ```\"2883 Geraldine Lane\"```\n\t */\n\tline_1?: string | null\n\t/** \n\t * Address line 2, i.e. Apartment, Suite, Building.\n\t * @example ```\"Apt.23\"```\n\t */\n\tline_2?: string | null\n\t/** \n\t * Address city.\n\t * @example ```\"New York\"```\n\t */\n\tcity?: string | null\n\t/** \n\t * ZIP or postal code.\n\t * @example ```\"10013\"```\n\t */\n\tzip_code?: string | null\n\t/** \n\t * State, province or region code.\n\t * @example ```\"NY\"```\n\t */\n\tstate_code?: string | null\n\t/** \n\t * The international 2-letter country code as defined by the ISO 3166-1 standard.\n\t * @example ```\"US\"```\n\t */\n\tcountry_code?: string | null\n\t/** \n\t * Phone number (including extension).\n\t * @example ```\"(212) 646-338-1228\"```\n\t */\n\tphone?: string | null\n\t/** \n\t * Email address.\n\t * @example ```\"john@example.com\"```\n\t */\n\temail?: string | null\n\t/** \n\t * A free notes attached to the address. When used as a shipping address, this can be useful to let the customers add specific delivery instructions.\n\t * @example ```\"Please ring the bell twice\"```\n\t */\n\tnotes?: string | null\n\t/** \n\t * The address geocoded latitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```40.6971494```\n\t */\n\tlat?: number | null\n\t/** \n\t * The address geocoded longitude. This is automatically generated when creating a shipping/billing address for an order and a valid geocoder is attached to the order's market.\n\t * @example ```-74.2598672```\n\t */\n\tlng?: number | null\n\t/** \n\t * Customer's billing information (i.e. VAT number, codice fiscale).\n\t * @example ```\"VAT ID IT02382940977\"```\n\t */\n\tbilling_info?: string | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tgeocoder?: GeocoderRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Addresses extends ApiResource<Address> {\n\n\tstatic readonly TYPE: AddressType = 'addresses' as const\n\n\tasync create(resource: AddressCreate, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.create<AddressCreate, Address>({ ...resource, type: Addresses.TYPE }, params, options)\n\t}\n\n\tasync update(resource: AddressUpdate, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ ...resource, type: Addresses.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Addresses.TYPE } : id, options)\n\t}\n\n\tasync geocoder(addressId: string | Address, params?: QueryParamsRetrieve<Geocoder>, options?: ResourcesConfig): Promise<Geocoder> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Geocoder>({ type: 'geocoders' }, `addresses/${_addressId}/geocoder`, params, options) as unknown as Geocoder\n\t}\n\n\tasync events(addressId: string | Address, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `addresses/${_addressId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(addressId: string | Address, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `addresses/${_addressId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(addressId: string | Address, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _addressId = (addressId as Address).id || addressId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `addresses/${_addressId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync _add_tags(id: string | Address, triggerValue: string, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ id: (typeof id === 'string')? id: id.id, type: Addresses.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Address, triggerValue: string, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address> {\n\t\treturn this.resources.update<AddressUpdate, Address>({ id: (typeof id === 'string')? id: id.id, type: Addresses.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisAddress(resource: any): resource is Address {\n\t\treturn resource.type && (resource.type === Addresses.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): AddressRel {\n\t\treturn super.relationshipOneToOne<AddressRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): AddressRel[] {\n\t\treturn super.relationshipOneToMany<AddressRel>(...ids)\n\t}\n\n\n\ttype(): AddressType {\n\t\treturn Addresses.TYPE\n\t}\n\n}\n\n\nconst instance = new Addresses()\nexport default instance\n\nexport type { Address, AddressCreate, AddressUpdate, AddressType }\n"]}
@@ -34,5 +34,7 @@ const instance = new Adjustments();
34
34
  var adjustments_default = instance;
35
35
 
36
36
  module.exports = adjustments_default;
37
+ //# sourceMappingURL=adjustments.cjs.map
37
38
 
38
39
  module.exports = exports.default;
40
+ //# sourceMappingURL=adjustments.cjs.map