@medusajs/types 1.12.0-snapshot-20240607093839 → 1.12.0-snapshot-20240701122250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. package/dist/api-key/service.d.ts +24 -24
  2. package/dist/api-key/service.d.ts.map +1 -1
  3. package/dist/auth/service.d.ts +18 -18
  4. package/dist/auth/service.d.ts.map +1 -1
  5. package/dist/bundles.d.ts +2 -1
  6. package/dist/bundles.d.ts.map +1 -1
  7. package/dist/bundles.js +3 -2
  8. package/dist/bundles.js.map +1 -1
  9. package/dist/cart/mutations.d.ts +8 -0
  10. package/dist/cart/mutations.d.ts.map +1 -1
  11. package/dist/cart/mutations.js.map +1 -1
  12. package/dist/cart/service.d.ts +30 -52
  13. package/dist/cart/service.d.ts.map +1 -1
  14. package/dist/common/common.d.ts +6 -1
  15. package/dist/common/common.d.ts.map +1 -1
  16. package/dist/currency/service.d.ts +9 -9
  17. package/dist/currency/service.d.ts.map +1 -1
  18. package/dist/customer/mutations.d.ts +27 -26
  19. package/dist/customer/mutations.d.ts.map +1 -1
  20. package/dist/customer/service.d.ts +40 -43
  21. package/dist/customer/service.d.ts.map +1 -1
  22. package/dist/dal/repository-service.d.ts +2 -2
  23. package/dist/dal/repository-service.d.ts.map +1 -1
  24. package/dist/dml/index.d.ts +161 -0
  25. package/dist/dml/index.d.ts.map +1 -0
  26. package/dist/dml/index.js +5 -0
  27. package/dist/dml/index.js.map +1 -0
  28. package/dist/event-bus/common.d.ts +12 -20
  29. package/dist/event-bus/common.d.ts.map +1 -1
  30. package/dist/event-bus/event-bus-module.d.ts +4 -4
  31. package/dist/event-bus/event-bus-module.d.ts.map +1 -1
  32. package/dist/event-bus/event-bus.d.ts +2 -4
  33. package/dist/event-bus/event-bus.d.ts.map +1 -1
  34. package/dist/file/service.d.ts +12 -12
  35. package/dist/file/service.d.ts.map +1 -1
  36. package/dist/fulfillment/mutations/service-zone.d.ts +1 -1
  37. package/dist/fulfillment/mutations/service-zone.d.ts.map +1 -1
  38. package/dist/fulfillment/service.d.ts +27 -27
  39. package/dist/fulfillment/service.d.ts.map +1 -1
  40. package/dist/http/currency/admin/entities.d.ts +14 -0
  41. package/dist/http/currency/admin/entities.d.ts.map +1 -0
  42. package/dist/http/currency/admin/entities.js +3 -0
  43. package/dist/http/currency/admin/entities.js.map +1 -0
  44. package/dist/http/currency/admin/index.d.ts +2 -0
  45. package/dist/http/currency/admin/index.d.ts.map +1 -0
  46. package/dist/{inventory/bundle.js → http/currency/admin/index.js} +2 -3
  47. package/dist/http/currency/admin/index.js.map +1 -0
  48. package/dist/http/currency/index.d.ts +2 -0
  49. package/dist/http/currency/index.d.ts.map +1 -0
  50. package/dist/{region__legacy → http/currency}/index.js +1 -1
  51. package/dist/http/currency/index.js.map +1 -0
  52. package/dist/http/fulfillment-provider/admin/entities.d.ts +1 -5
  53. package/dist/http/fulfillment-provider/admin/entities.d.ts.map +1 -1
  54. package/dist/http/fulfillment-set/admin/entities.d.ts +3 -1
  55. package/dist/http/fulfillment-set/admin/entities.d.ts.map +1 -1
  56. package/dist/http/index.d.ts +5 -0
  57. package/dist/http/index.d.ts.map +1 -1
  58. package/dist/http/index.js +5 -0
  59. package/dist/http/index.js.map +1 -1
  60. package/dist/http/inventory/{inventory.d.ts → admin/entities.d.ts} +2 -10
  61. package/dist/http/inventory/admin/entities.d.ts.map +1 -0
  62. package/dist/http/inventory/admin/entities.js +3 -0
  63. package/dist/http/inventory/admin/entities.js.map +1 -0
  64. package/dist/http/inventory/admin/index.d.ts +5 -0
  65. package/dist/http/inventory/admin/index.d.ts.map +1 -0
  66. package/dist/http/inventory/admin/index.js +21 -0
  67. package/dist/http/inventory/admin/index.js.map +1 -0
  68. package/dist/http/inventory/admin/payloads.d.ts +19 -0
  69. package/dist/http/inventory/admin/payloads.d.ts.map +1 -0
  70. package/dist/http/inventory/admin/payloads.js +3 -0
  71. package/dist/http/inventory/admin/payloads.js.map +1 -0
  72. package/dist/http/inventory/admin/queries.d.ts +18 -0
  73. package/dist/http/inventory/admin/queries.d.ts.map +1 -0
  74. package/dist/http/{product/store.js → inventory/admin/queries.js} +1 -1
  75. package/dist/http/inventory/admin/queries.js.map +1 -0
  76. package/dist/http/inventory/admin/responses.d.ts +10 -0
  77. package/dist/http/inventory/admin/responses.d.ts.map +1 -0
  78. package/dist/http/inventory/admin/responses.js +3 -0
  79. package/dist/http/inventory/admin/responses.js.map +1 -0
  80. package/dist/http/inventory/index.d.ts +1 -2
  81. package/dist/http/inventory/index.d.ts.map +1 -1
  82. package/dist/http/inventory/index.js +1 -2
  83. package/dist/http/inventory/index.js.map +1 -1
  84. package/dist/http/inventory-level/admin/entities.d.ts +11 -0
  85. package/dist/http/inventory-level/admin/entities.d.ts.map +1 -0
  86. package/dist/http/inventory-level/admin/entities.js +3 -0
  87. package/dist/http/inventory-level/admin/entities.js.map +1 -0
  88. package/dist/http/inventory-level/admin/index.d.ts +5 -0
  89. package/dist/http/inventory-level/admin/index.d.ts.map +1 -0
  90. package/dist/http/inventory-level/admin/index.js +21 -0
  91. package/dist/http/inventory-level/admin/index.js.map +1 -0
  92. package/dist/http/inventory-level/admin/payloads.d.ts +15 -0
  93. package/dist/http/inventory-level/admin/payloads.d.ts.map +1 -0
  94. package/dist/http/inventory-level/admin/payloads.js +3 -0
  95. package/dist/http/inventory-level/admin/payloads.js.map +1 -0
  96. package/dist/http/inventory-level/admin/queries.d.ts +5 -0
  97. package/dist/http/inventory-level/admin/queries.d.ts.map +1 -0
  98. package/dist/http/{product/admin.js → inventory-level/admin/queries.js} +1 -1
  99. package/dist/http/inventory-level/admin/queries.js.map +1 -0
  100. package/dist/http/inventory-level/admin/responses.d.ts +9 -0
  101. package/dist/http/inventory-level/admin/responses.d.ts.map +1 -0
  102. package/dist/http/{inventory/inventory.js → inventory-level/admin/responses.js} +1 -1
  103. package/dist/http/inventory-level/admin/responses.js.map +1 -0
  104. package/dist/http/inventory-level/index.d.ts +2 -0
  105. package/dist/http/inventory-level/index.d.ts.map +1 -0
  106. package/dist/http/inventory-level/index.js +18 -0
  107. package/dist/http/inventory-level/index.js.map +1 -0
  108. package/dist/http/order/common.d.ts +2 -0
  109. package/dist/http/order/common.d.ts.map +1 -1
  110. package/dist/http/price-list/admin/entities.d.ts +21 -0
  111. package/dist/http/price-list/admin/entities.d.ts.map +1 -0
  112. package/dist/http/price-list/admin/entities.js +3 -0
  113. package/dist/http/price-list/admin/entities.js.map +1 -0
  114. package/dist/http/price-list/admin/index.d.ts +5 -0
  115. package/dist/http/price-list/admin/index.d.ts.map +1 -0
  116. package/dist/http/price-list/admin/index.js +21 -0
  117. package/dist/http/price-list/admin/index.js.map +1 -0
  118. package/dist/http/price-list/admin/payloads.d.ts +46 -0
  119. package/dist/http/price-list/admin/payloads.d.ts.map +1 -0
  120. package/dist/http/price-list/admin/payloads.js +3 -0
  121. package/dist/http/price-list/admin/payloads.js.map +1 -0
  122. package/dist/http/price-list/admin/queries.d.ts +14 -0
  123. package/dist/http/price-list/admin/queries.d.ts.map +1 -0
  124. package/dist/http/{product-category/store.js → price-list/admin/queries.js} +1 -1
  125. package/dist/http/price-list/admin/queries.js.map +1 -0
  126. package/dist/http/price-list/admin/responses.d.ts +12 -0
  127. package/dist/http/price-list/admin/responses.d.ts.map +1 -0
  128. package/dist/http/price-list/admin/responses.js +3 -0
  129. package/dist/http/price-list/admin/responses.js.map +1 -0
  130. package/dist/http/price-list/index.d.ts +2 -0
  131. package/dist/http/price-list/index.d.ts.map +1 -0
  132. package/dist/http/price-list/index.js +18 -0
  133. package/dist/http/price-list/index.js.map +1 -0
  134. package/dist/http/pricing/admin/{entitites.d.ts → entities.d.ts} +1 -1
  135. package/dist/http/pricing/admin/entities.d.ts.map +1 -0
  136. package/dist/http/pricing/admin/entities.js +3 -0
  137. package/dist/http/pricing/admin/entities.js.map +1 -0
  138. package/dist/http/pricing/admin/index.d.ts +1 -1
  139. package/dist/http/pricing/admin/index.d.ts.map +1 -1
  140. package/dist/http/pricing/admin/index.js +1 -1
  141. package/dist/http/pricing/admin/index.js.map +1 -1
  142. package/dist/http/product/admin/entitites.d.ts +26 -0
  143. package/dist/http/product/admin/entitites.d.ts.map +1 -0
  144. package/dist/http/product/admin/entitites.js.map +1 -0
  145. package/dist/http/product/admin/index.d.ts +5 -0
  146. package/dist/http/product/admin/index.d.ts.map +1 -0
  147. package/dist/http/product/admin/index.js +21 -0
  148. package/dist/http/product/admin/index.js.map +1 -0
  149. package/dist/http/product/admin/payloads.d.ts +152 -0
  150. package/dist/http/product/admin/payloads.d.ts.map +1 -0
  151. package/dist/http/product/admin/payloads.js +3 -0
  152. package/dist/http/product/admin/payloads.js.map +1 -0
  153. package/dist/http/product/admin/queries.d.ts +12 -0
  154. package/dist/http/product/admin/queries.d.ts.map +1 -0
  155. package/dist/http/product/admin/queries.js +3 -0
  156. package/dist/http/product/admin/queries.js.map +1 -0
  157. package/dist/http/product/admin/responses.d.ts +35 -0
  158. package/dist/http/product/admin/responses.d.ts.map +1 -0
  159. package/dist/http/product/admin/responses.js +3 -0
  160. package/dist/http/product/admin/responses.js.map +1 -0
  161. package/dist/http/product/common.d.ts +72 -106
  162. package/dist/http/product/common.d.ts.map +1 -1
  163. package/dist/http/product/store/entitites.d.ts +19 -0
  164. package/dist/http/product/store/entitites.d.ts.map +1 -0
  165. package/dist/http/product/store/entitites.js +3 -0
  166. package/dist/http/product/store/entitites.js.map +1 -0
  167. package/dist/http/product/store/index.d.ts +4 -0
  168. package/dist/http/product/store/index.d.ts.map +1 -0
  169. package/dist/http/product/store/index.js +20 -0
  170. package/dist/http/product/store/index.js.map +1 -0
  171. package/dist/http/product/store/queries.d.ts +13 -0
  172. package/dist/http/product/store/queries.d.ts.map +1 -0
  173. package/dist/http/product/store/queries.js +3 -0
  174. package/dist/http/product/store/queries.js.map +1 -0
  175. package/dist/http/product/store/responses.d.ts +9 -0
  176. package/dist/http/product/store/responses.d.ts.map +1 -0
  177. package/dist/http/product/store/responses.js +3 -0
  178. package/dist/http/product/store/responses.js.map +1 -0
  179. package/dist/http/product-category/admin/entities.d.ts +8 -0
  180. package/dist/http/product-category/admin/entities.d.ts.map +1 -0
  181. package/dist/http/product-category/admin/entities.js +3 -0
  182. package/dist/http/product-category/admin/entities.js.map +1 -0
  183. package/dist/http/product-category/admin/index.d.ts +5 -0
  184. package/dist/http/product-category/admin/index.d.ts.map +1 -0
  185. package/dist/http/product-category/admin/index.js +21 -0
  186. package/dist/http/product-category/admin/index.js.map +1 -0
  187. package/dist/http/product-category/admin/payloads.d.ts +25 -0
  188. package/dist/http/product-category/admin/payloads.d.ts.map +1 -0
  189. package/dist/http/product-category/admin/payloads.js +3 -0
  190. package/dist/http/product-category/admin/payloads.js.map +1 -0
  191. package/dist/http/product-category/admin/queries.d.ts +8 -0
  192. package/dist/http/product-category/admin/queries.d.ts.map +1 -0
  193. package/dist/http/product-category/{admin.js → admin/queries.js} +1 -1
  194. package/dist/http/product-category/admin/queries.js.map +1 -0
  195. package/dist/http/product-category/admin/responses.d.ts +12 -0
  196. package/dist/http/product-category/admin/responses.d.ts.map +1 -0
  197. package/dist/http/product-category/admin/responses.js +3 -0
  198. package/dist/http/product-category/admin/responses.js.map +1 -0
  199. package/dist/http/product-category/common.d.ts +31 -7
  200. package/dist/http/product-category/common.d.ts.map +1 -1
  201. package/dist/http/product-category/store/entities.d.ts +6 -0
  202. package/dist/http/product-category/store/entities.d.ts.map +1 -0
  203. package/dist/http/product-category/store/entities.js +3 -0
  204. package/dist/http/product-category/store/entities.js.map +1 -0
  205. package/dist/http/product-category/store/index.d.ts +4 -0
  206. package/dist/http/product-category/store/index.d.ts.map +1 -0
  207. package/dist/http/product-category/store/index.js +20 -0
  208. package/dist/http/product-category/store/index.js.map +1 -0
  209. package/dist/http/product-category/store/queries.d.ts +6 -0
  210. package/dist/http/product-category/store/queries.d.ts.map +1 -0
  211. package/dist/http/product-category/store/queries.js +3 -0
  212. package/dist/http/product-category/store/queries.js.map +1 -0
  213. package/dist/http/product-category/store/responses.d.ts +10 -0
  214. package/dist/http/product-category/store/responses.d.ts.map +1 -0
  215. package/dist/http/product-category/store/responses.js +3 -0
  216. package/dist/http/product-category/store/responses.js.map +1 -0
  217. package/dist/http/product-type/admin/entities.d.ts +4 -0
  218. package/dist/http/product-type/admin/entities.d.ts.map +1 -0
  219. package/dist/http/product-type/admin/entities.js +3 -0
  220. package/dist/http/product-type/admin/entities.js.map +1 -0
  221. package/dist/http/product-type/admin/index.d.ts +5 -0
  222. package/dist/http/product-type/admin/index.d.ts.map +1 -0
  223. package/dist/http/product-type/admin/index.js +21 -0
  224. package/dist/http/product-type/admin/index.js.map +1 -0
  225. package/dist/http/product-type/admin/payloads.d.ts +9 -0
  226. package/dist/http/product-type/admin/payloads.d.ts.map +1 -0
  227. package/dist/http/product-type/admin/payloads.js +3 -0
  228. package/dist/http/product-type/admin/payloads.js.map +1 -0
  229. package/dist/http/product-type/admin/queries.d.ts +13 -0
  230. package/dist/http/product-type/admin/queries.d.ts.map +1 -0
  231. package/dist/http/product-type/admin/queries.js +3 -0
  232. package/dist/http/product-type/admin/queries.js.map +1 -0
  233. package/dist/http/product-type/admin/responses.d.ts +12 -0
  234. package/dist/http/product-type/admin/responses.d.ts.map +1 -0
  235. package/dist/http/product-type/admin/responses.js +3 -0
  236. package/dist/http/product-type/admin/responses.js.map +1 -0
  237. package/dist/http/product-type/common.d.ts +9 -0
  238. package/dist/http/product-type/common.d.ts.map +1 -0
  239. package/dist/{inventory → http/product-type}/common.js.map +1 -1
  240. package/dist/http/product-type/index.d.ts +3 -0
  241. package/dist/http/product-type/index.d.ts.map +1 -0
  242. package/dist/http/product-type/index.js +19 -0
  243. package/dist/http/product-type/index.js.map +1 -0
  244. package/dist/http/product-type/store/entities.d.ts +4 -0
  245. package/dist/http/product-type/store/entities.d.ts.map +1 -0
  246. package/dist/http/product-type/store/entities.js +3 -0
  247. package/dist/http/product-type/store/entities.js.map +1 -0
  248. package/dist/http/product-type/store/index.d.ts +2 -0
  249. package/dist/http/product-type/store/index.d.ts.map +1 -0
  250. package/dist/http/product-type/store/index.js +18 -0
  251. package/dist/http/product-type/store/index.js.map +1 -0
  252. package/dist/http/promotion/admin/rule-attribute-options.d.ts +5 -0
  253. package/dist/http/promotion/admin/rule-attribute-options.d.ts.map +1 -1
  254. package/dist/http/sales-channel/admin/queries.d.ts +2 -4
  255. package/dist/http/sales-channel/admin/queries.d.ts.map +1 -1
  256. package/dist/http/shipping-option/admin/entities.d.ts +9 -1
  257. package/dist/http/shipping-option/admin/entities.d.ts.map +1 -1
  258. package/dist/http/shipping-option/admin/payloads.d.ts +8 -9
  259. package/dist/http/shipping-option/admin/payloads.d.ts.map +1 -1
  260. package/dist/http/stock-locations/admin/entities.d.ts +2 -1
  261. package/dist/http/stock-locations/admin/entities.d.ts.map +1 -1
  262. package/dist/http/store/admin/entities.d.ts +23 -0
  263. package/dist/http/store/admin/entities.d.ts.map +1 -0
  264. package/dist/http/store/admin/entities.js +3 -0
  265. package/dist/http/store/admin/entities.js.map +1 -0
  266. package/dist/http/store/admin/index.d.ts +5 -0
  267. package/dist/http/store/admin/index.d.ts.map +1 -0
  268. package/dist/http/store/admin/index.js +21 -0
  269. package/dist/http/store/admin/index.js.map +1 -0
  270. package/dist/http/store/admin/payloads.d.ts +14 -0
  271. package/dist/http/store/admin/payloads.d.ts.map +1 -0
  272. package/dist/http/store/admin/payloads.js +3 -0
  273. package/dist/http/store/admin/payloads.js.map +1 -0
  274. package/dist/http/store/admin/queries.d.ts +10 -0
  275. package/dist/http/store/admin/queries.d.ts.map +1 -0
  276. package/dist/http/store/admin/queries.js +3 -0
  277. package/dist/http/store/admin/queries.js.map +1 -0
  278. package/dist/http/store/admin/responses.d.ts +10 -0
  279. package/dist/http/store/admin/responses.d.ts.map +1 -0
  280. package/dist/http/store/admin/responses.js +3 -0
  281. package/dist/http/store/admin/responses.js.map +1 -0
  282. package/dist/http/store/index.d.ts +2 -0
  283. package/dist/http/store/index.d.ts.map +1 -0
  284. package/dist/http/store/index.js +18 -0
  285. package/dist/http/store/index.js.map +1 -0
  286. package/dist/index.d.ts +1 -1
  287. package/dist/index.d.ts.map +1 -1
  288. package/dist/index.js +1 -1
  289. package/dist/index.js.map +1 -1
  290. package/dist/inventory/common/reservation-item.d.ts +1 -1
  291. package/dist/inventory/index.d.ts +1 -2
  292. package/dist/inventory/index.d.ts.map +1 -1
  293. package/dist/inventory/index.js +1 -15
  294. package/dist/inventory/index.js.map +1 -1
  295. package/dist/inventory/mutations/reservation-item.d.ts +7 -7
  296. package/dist/inventory/mutations/reservation-item.d.ts.map +1 -1
  297. package/dist/inventory/service.d.ts +671 -640
  298. package/dist/inventory/service.d.ts.map +1 -1
  299. package/dist/joiner/index.d.ts +5 -2
  300. package/dist/joiner/index.d.ts.map +1 -1
  301. package/dist/modules-sdk/index.d.ts +12 -12
  302. package/dist/modules-sdk/index.d.ts.map +1 -1
  303. package/dist/modules-sdk/index.js +1 -1
  304. package/dist/modules-sdk/index.js.map +1 -1
  305. package/dist/modules-sdk/{internal-module-service.d.ts → medusa-internal-service.d.ts} +19 -18
  306. package/dist/modules-sdk/medusa-internal-service.d.ts.map +1 -0
  307. package/dist/{http/inventory/inventory-level.js → modules-sdk/medusa-internal-service.js} +1 -1
  308. package/dist/modules-sdk/medusa-internal-service.js.map +1 -0
  309. package/dist/notification/service.d.ts +15 -15
  310. package/dist/notification/service.d.ts.map +1 -1
  311. package/dist/order/common.d.ts +50 -1
  312. package/dist/order/common.d.ts.map +1 -1
  313. package/dist/order/mutations.d.ts +68 -17
  314. package/dist/order/mutations.d.ts.map +1 -1
  315. package/dist/order/service.d.ts +41 -30
  316. package/dist/order/service.d.ts.map +1 -1
  317. package/dist/pricing/common/index.d.ts +0 -2
  318. package/dist/pricing/common/index.d.ts.map +1 -1
  319. package/dist/pricing/common/index.js +0 -2
  320. package/dist/pricing/common/index.js.map +1 -1
  321. package/dist/pricing/common/money-amount.d.ts +2 -2
  322. package/dist/pricing/common/money-amount.d.ts.map +1 -1
  323. package/dist/pricing/common/price-list.d.ts +25 -125
  324. package/dist/pricing/common/price-list.d.ts.map +1 -1
  325. package/dist/pricing/common/price-rule.d.ts +8 -16
  326. package/dist/pricing/common/price-rule.d.ts.map +1 -1
  327. package/dist/pricing/common/price-set.d.ts +6 -55
  328. package/dist/pricing/common/price-set.d.ts.map +1 -1
  329. package/dist/pricing/service.d.ts +31 -290
  330. package/dist/pricing/service.d.ts.map +1 -1
  331. package/dist/pricing/workflows.d.ts +5 -5
  332. package/dist/pricing/workflows.d.ts.map +1 -1
  333. package/dist/product/common.d.ts +99 -79
  334. package/dist/product/common.d.ts.map +1 -1
  335. package/dist/product/service.d.ts +322 -203
  336. package/dist/product/service.d.ts.map +1 -1
  337. package/dist/promotion/common/application-method.d.ts +1 -1
  338. package/dist/promotion/common/application-method.d.ts.map +1 -1
  339. package/dist/promotion/mutations.d.ts +6 -6
  340. package/dist/promotion/mutations.d.ts.map +1 -1
  341. package/dist/promotion/service.d.ts +29 -29
  342. package/dist/promotion/service.d.ts.map +1 -1
  343. package/dist/region/common.d.ts.map +1 -1
  344. package/dist/region/mutations.d.ts +4 -3
  345. package/dist/region/mutations.d.ts.map +1 -1
  346. package/dist/region/service.d.ts +31 -31
  347. package/dist/region/service.d.ts.map +1 -1
  348. package/dist/sales-channel/mutations.d.ts +4 -3
  349. package/dist/sales-channel/mutations.d.ts.map +1 -1
  350. package/dist/sales-channel/service.d.ts +28 -28
  351. package/dist/sales-channel/service.d.ts.map +1 -1
  352. package/dist/shared-context.d.ts +2 -3
  353. package/dist/shared-context.d.ts.map +1 -1
  354. package/dist/stock-location/common.d.ts +12 -17
  355. package/dist/stock-location/common.d.ts.map +1 -1
  356. package/dist/stock-location/index.d.ts +0 -1
  357. package/dist/stock-location/index.d.ts.map +1 -1
  358. package/dist/stock-location/index.js +0 -1
  359. package/dist/stock-location/index.js.map +1 -1
  360. package/dist/stock-location/service.d.ts +193 -180
  361. package/dist/stock-location/service.d.ts.map +1 -1
  362. package/dist/store/common/store.d.ts +31 -5
  363. package/dist/store/common/store.d.ts.map +1 -1
  364. package/dist/store/mutations/store.d.ts +14 -40
  365. package/dist/store/mutations/store.d.ts.map +1 -1
  366. package/dist/store/service.d.ts +32 -37
  367. package/dist/store/service.d.ts.map +1 -1
  368. package/dist/tax/mutations.d.ts +7 -6
  369. package/dist/tax/mutations.d.ts.map +1 -1
  370. package/dist/tax/service.d.ts +35 -35
  371. package/dist/tax/service.d.ts.map +1 -1
  372. package/dist/user/service.d.ts +22 -22
  373. package/dist/user/service.d.ts.map +1 -1
  374. package/dist/workflow/fulfillment/service-zones.d.ts +1 -1
  375. package/dist/workflow/fulfillment/service-zones.d.ts.map +1 -1
  376. package/dist/workflow/order/create-fulfillment.d.ts +2 -2
  377. package/dist/workflow/order/create-fulfillment.d.ts.map +1 -1
  378. package/dist/workflow/order/create-return-order.d.ts +8 -7
  379. package/dist/workflow/order/create-return-order.d.ts.map +1 -1
  380. package/dist/workflow/order/create-shipment.d.ts +2 -1
  381. package/dist/workflow/order/create-shipment.d.ts.map +1 -1
  382. package/dist/workflow/order/index.d.ts +1 -0
  383. package/dist/workflow/order/index.d.ts.map +1 -1
  384. package/dist/workflow/order/index.js +1 -0
  385. package/dist/workflow/order/index.js.map +1 -1
  386. package/dist/workflow/order/receive-return.d.ts +17 -0
  387. package/dist/workflow/order/receive-return.d.ts.map +1 -0
  388. package/dist/workflow/order/receive-return.js +3 -0
  389. package/dist/workflow/order/receive-return.js.map +1 -0
  390. package/dist/workflow/price-list/create-price-list.d.ts +1 -2
  391. package/dist/workflow/price-list/create-price-list.d.ts.map +1 -1
  392. package/dist/workflow/product-category/index.d.ts +6 -6
  393. package/dist/workflow/product-category/index.d.ts.map +1 -1
  394. package/dist/workflow/reservation/create-reservations.d.ts +3 -3
  395. package/dist/workflow/reservation/create-reservations.d.ts.map +1 -1
  396. package/dist/workflow/reservation/update-reservations.d.ts +3 -3
  397. package/dist/workflow/reservation/update-reservations.d.ts.map +1 -1
  398. package/dist/workflows/products/mutations.d.ts +2 -2
  399. package/dist/workflows/products/mutations.d.ts.map +1 -1
  400. package/dist/workflows-sdk/service.d.ts +2 -2
  401. package/dist/workflows-sdk/service.d.ts.map +1 -1
  402. package/package.json +1 -2
  403. package/dist/http/inventory/inventory-level.d.ts +0 -20
  404. package/dist/http/inventory/inventory-level.d.ts.map +0 -1
  405. package/dist/http/inventory/inventory-level.js.map +0 -1
  406. package/dist/http/inventory/inventory.d.ts.map +0 -1
  407. package/dist/http/inventory/inventory.js.map +0 -1
  408. package/dist/http/pricing/admin/entitites.d.ts.map +0 -1
  409. package/dist/http/pricing/admin/entitites.js.map +0 -1
  410. package/dist/http/product/admin.d.ts +0 -99
  411. package/dist/http/product/admin.d.ts.map +0 -1
  412. package/dist/http/product/admin.js.map +0 -1
  413. package/dist/http/product/store.d.ts +0 -33
  414. package/dist/http/product/store.d.ts.map +0 -1
  415. package/dist/http/product/store.js.map +0 -1
  416. package/dist/http/product-category/admin.d.ts +0 -9
  417. package/dist/http/product-category/admin.d.ts.map +0 -1
  418. package/dist/http/product-category/admin.js.map +0 -1
  419. package/dist/http/product-category/store.d.ts +0 -9
  420. package/dist/http/product-category/store.d.ts.map +0 -1
  421. package/dist/http/product-category/store.js.map +0 -1
  422. package/dist/inventory/bundle.d.ts +0 -3
  423. package/dist/inventory/bundle.d.ts.map +0 -1
  424. package/dist/inventory/bundle.js.map +0 -1
  425. package/dist/inventory/common.d.ts +0 -495
  426. package/dist/inventory/common.d.ts.map +0 -1
  427. package/dist/inventory/service-next.d.ts +0 -937
  428. package/dist/inventory/service-next.d.ts.map +0 -1
  429. package/dist/inventory/service-next.js +0 -3
  430. package/dist/inventory/service-next.js.map +0 -1
  431. package/dist/modules-sdk/internal-module-service.d.ts.map +0 -1
  432. package/dist/modules-sdk/internal-module-service.js +0 -3
  433. package/dist/modules-sdk/internal-module-service.js.map +0 -1
  434. package/dist/modules-sdk/module-service.d.ts +0 -1
  435. package/dist/modules-sdk/module-service.d.ts.map +0 -1
  436. package/dist/modules-sdk/module-service.js +0 -1
  437. package/dist/modules-sdk/module-service.js.map +0 -1
  438. package/dist/pricing/common/price-set-rule-type.d.ts +0 -24
  439. package/dist/pricing/common/price-set-rule-type.d.ts.map +0 -1
  440. package/dist/pricing/common/price-set-rule-type.js +0 -3
  441. package/dist/pricing/common/price-set-rule-type.js.map +0 -1
  442. package/dist/pricing/common/rule-type.d.ts +0 -102
  443. package/dist/pricing/common/rule-type.d.ts.map +0 -1
  444. package/dist/pricing/common/rule-type.js +0 -3
  445. package/dist/pricing/common/rule-type.js.map +0 -1
  446. package/dist/region__legacy/common.d.ts +0 -44
  447. package/dist/region__legacy/common.d.ts.map +0 -1
  448. package/dist/region__legacy/common.js +0 -3
  449. package/dist/region__legacy/common.js.map +0 -1
  450. package/dist/region__legacy/index.d.ts +0 -2
  451. package/dist/region__legacy/index.d.ts.map +0 -1
  452. package/dist/region__legacy/index.js.map +0 -1
  453. package/dist/stock-location/service-next.d.ts +0 -279
  454. package/dist/stock-location/service-next.d.ts.map +0 -1
  455. package/dist/stock-location/service-next.js +0 -3
  456. package/dist/stock-location/service-next.js.map +0 -1
  457. /package/dist/http/{pricing → product}/admin/entitites.js +0 -0
  458. /package/dist/{inventory → http/product-type}/common.js +0 -0
@@ -1,601 +1,637 @@
1
- import { BulkUpdateInventoryLevelInput, CreateInventoryItemInput, CreateInventoryLevelInput, CreateReservationItemInput, FilterableInventoryItemProps, FilterableInventoryLevelProps, FilterableReservationItemProps, InventoryItemDTO, InventoryLevelDTO, ReservationItemDTO, UpdateInventoryLevelInput, UpdateReservationItemInput } from "./common";
1
+ import { RestoreReturn, SoftDeleteReturn } from "../dal";
2
2
  import { FindConfig } from "../common";
3
3
  import { IModuleService } from "../modules-sdk";
4
- import { SharedContext } from "../shared-context";
4
+ import { Context } from "../shared-context";
5
+ import { FilterableInventoryItemProps, FilterableInventoryLevelProps, FilterableReservationItemProps, InventoryItemDTO, InventoryLevelDTO, ReservationItemDTO } from "./common";
6
+ import { BulkUpdateInventoryLevelInput, CreateInventoryItemInput, CreateInventoryLevelInput, CreateReservationItemInput, UpdateInventoryItemInput, UpdateReservationItemInput } from "./mutations";
5
7
  /**
6
- * The main service interface for the inventory module.
8
+ * The main service interface for the Inventory Module.
7
9
  */
8
10
  export interface IInventoryService extends IModuleService {
9
11
  /**
10
- * This method is used to retrieve a paginated list of inventory items along with the total count of available inventory items satisfying the provided filters.
12
+ * This method retrieves a paginated list of inventory items based on optional filters and configuration.
13
+ *
11
14
  * @param {FilterableInventoryItemProps} selector - The filters to apply on the retrieved inventory items.
12
- * @param {FindConfig<InventoryItemDTO>} config -
13
- * The configurations determining how the inventory items are retrieved. Its properties, such as `select` or `relations`, accept the
15
+ * @param {FindConfig<InventoryItemDTO>} config - The configurations determining how the inventory item is retrieved. Its properties, such as `select` or `relations`, accept the
14
16
  * attributes or relations associated with a inventory item.
15
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
16
- * @return {Promise<[InventoryItemDTO[], number]>} The list of inventory items along with the total count.
17
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
18
+ * @returns {Promise<InventoryItemDTO[]>} The list of inventory items.
17
19
  *
18
20
  * @example
19
21
  * To retrieve a list of inventory items using their IDs:
20
22
  *
21
23
  * ```ts
22
- * import {
23
- * initialize as initializeInventoryModule,
24
- * } from "@medusajs/inventory"
25
- *
26
- * async function retrieveInventoryItems (ids: string[]) {
27
- * const inventoryModule = await initializeInventoryModule({})
24
+ * const inventoryItems = await inventoryModuleService.listInventoryItems({
25
+ * id: ["iitem_123", "iitem_321"],
26
+ * })
27
+ * ```
28
28
  *
29
- * const [inventoryItems, count] = await inventoryModule.listInventoryItems({
30
- * id: ids
31
- * })
29
+ * To specify relations that should be retrieved within the inventory items:
32
30
  *
33
- * // do something with the inventory items or return them
34
- * }
31
+ * ```ts
32
+ * const inventoryItems = await inventoryModuleService.listInventoryItems(
33
+ * {
34
+ * id: ["iitem_123", "iitem_321"],
35
+ * },
36
+ * {
37
+ * relations: ["location_levels"],
38
+ * }
39
+ * )
35
40
  * ```
36
41
  *
37
- * To specify relations that should be retrieved within the inventory items:
42
+ * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
38
43
  *
39
44
  * ```ts
40
- * import {
41
- * initialize as initializeInventoryModule,
42
- * } from "@medusajs/inventory"
45
+ * const inventoryItems = await inventoryModuleService.listInventoryItems(
46
+ * {
47
+ * id: ["iitem_123", "iitem_321"],
48
+ * },
49
+ * {
50
+ * relations: ["location_levels"],
51
+ * take: 20,
52
+ * skip: 2,
53
+ * }
54
+ * )
55
+ * ```
56
+ */
57
+ listInventoryItems(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: Context): Promise<InventoryItemDTO[]>;
58
+ /**
59
+ * This method retrieves a paginated list of inventory items along with the total count of available inventory items satisfying the provided filters.
43
60
  *
44
- * async function retrieveInventoryItems (ids: string[]) {
45
- * const inventoryModule = await initializeInventoryModule({})
61
+ * @param {FilterableInventoryItemProps} selector - The filters to apply on the retrieved inventory items.
62
+ * @param {FindConfig<InventoryItemDTO>} config - The configurations determining how the inventory item is retrieved. Its properties, such as `select` or `relations`, accept the
63
+ * attributes or relations associated with a inventory item.
64
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
65
+ * @returns {Promise<[InventoryItemDTO[], number]>} The list of inventory items along with their total count.
46
66
  *
47
- * const [inventoryItems, count] = await inventoryModule.listInventoryItems({
48
- * id: ids
49
- * }, {
50
- * relations: ["inventory_level"]
51
- * })
67
+ * @example
68
+ * To retrieve a list of inventory items using their IDs:
52
69
  *
53
- * // do something with the inventory items or return them
54
- * }
70
+ * ```ts
71
+ * const [inventoryItems, count] =
72
+ * await inventoryModuleService.listAndCountInventoryItems({
73
+ * id: ["iitem_123", "iitem_321"],
74
+ * })
55
75
  * ```
56
76
  *
57
- * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
77
+ * To specify relations that should be retrieved within the inventory items:
58
78
  *
59
79
  * ```ts
60
- * import {
61
- * initialize as initializeInventoryModule,
62
- * } from "@medusajs/inventory"
63
- *
64
- * async function retrieveInventoryItems (ids: string[], skip: number, take: number) {
65
- * const inventoryModule = await initializeInventoryModule({})
80
+ * const [inventoryItems, count] =
81
+ * await inventoryModuleService.listAndCountInventoryItems(
82
+ * {
83
+ * id: ["iitem_123", "iitem_321"],
84
+ * },
85
+ * {
86
+ * relations: ["location_levels"],
87
+ * }
88
+ * )
89
+ * ```
66
90
  *
67
- * const [inventoryItems, count] = await inventoryModule.listInventoryItems({
68
- * id: ids
69
- * }, {
70
- * relations: ["inventory_level"],
71
- * skip,
72
- * take
73
- * })
91
+ * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
74
92
  *
75
- * // do something with the inventory items or return them
76
- * }
93
+ * ```ts
94
+ * const [inventoryItems, count] =
95
+ * await inventoryModuleService.listAndCountInventoryItems(
96
+ * {
97
+ * id: ["iitem_123", "iitem_321"],
98
+ * },
99
+ * {
100
+ * relations: ["location_levels"],
101
+ * take: 20,
102
+ * skip: 2,
103
+ * }
104
+ * )
77
105
  * ```
78
106
  */
79
- listInventoryItems(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: SharedContext): Promise<[InventoryItemDTO[], number]>;
107
+ listAndCountInventoryItems(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: Context): Promise<[InventoryItemDTO[], number]>;
80
108
  /**
81
- * This method is used to retrieve a paginated list of reservation items along with the total count of available reservation items satisfying the provided filters.
109
+ * This method retrieves a paginated list of reservation items based on optional filters and configuration.
110
+ *
82
111
  * @param {FilterableReservationItemProps} selector - The filters to apply on the retrieved reservation items.
83
- * @param {FindConfig<ReservationItemDTO>} config -
84
- * The configurations determining how the reservation items are retrieved. Its properties, such as `select` or `relations`, accept the
112
+ * @param {FindConfig<ReservationItemDTO>} config - The configurations determining how the reservation item is retrieved. Its properties, such as `select` or `relations`, accept the
85
113
  * attributes or relations associated with a reservation item.
86
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
87
- * @return {Promise<[ReservationItemDTO[], number]>} The list of reservation items along with the total count.
114
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
115
+ * @returns {Promise<ReservationItemDTO[]>} The list of reservation items.
88
116
  *
89
117
  * @example
90
118
  * To retrieve a list of reservation items using their IDs:
91
119
  *
92
120
  * ```ts
93
- * import {
94
- * initialize as initializeInventoryModule,
95
- * } from "@medusajs/inventory"
96
- *
97
- * async function retrieveReservationItems (ids: string[]) {
98
- * const inventoryModule = await initializeInventoryModule({})
99
- *
100
- * const [reservationItems, count] = await inventoryModule.listReservationItems({
101
- * id: ids
121
+ * const reservationItems =
122
+ * await inventoryModuleService.listReservationItems({
123
+ * id: ["resitem_123", "resitem_321"],
102
124
  * })
103
- *
104
- * // do something with the reservation items or return them
105
- * }
106
125
  * ```
107
126
  *
108
127
  * To specify relations that should be retrieved within the reservation items:
109
128
  *
110
129
  * ```ts
111
- * import {
112
- * initialize as initializeInventoryModule,
113
- * } from "@medusajs/inventory"
114
- *
115
- * async function retrieveReservationItems (ids: string[]) {
116
- * const inventoryModule = await initializeInventoryModule({})
117
- *
118
- * const [reservationItems, count] = await inventoryModule.listReservationItems({
119
- * id: ids
120
- * }, {
121
- * relations: ["inventory_item"]
122
- * })
123
- *
124
- * // do something with the reservation items or return them
125
- * }
130
+ * const reservationItems =
131
+ * await inventoryModuleService.listReservationItems(
132
+ * {
133
+ * id: ["resitem_123", "resitem_321"],
134
+ * },
135
+ * {
136
+ * relations: ["inventory_item"],
137
+ * }
138
+ * )
126
139
  * ```
127
140
  *
128
141
  * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
129
142
  *
130
143
  * ```ts
131
- * import {
132
- * initialize as initializeInventoryModule,
133
- * } from "@medusajs/inventory"
144
+ * const reservationItems =
145
+ * await inventoryModuleService.listReservationItems(
146
+ * {
147
+ * id: ["resitem_123", "resitem_321"],
148
+ * },
149
+ * {
150
+ * relations: ["inventory_item"],
151
+ * take: 20,
152
+ * skip: 2,
153
+ * }
154
+ * )
155
+ * ```
156
+ */
157
+ listReservationItems(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: Context): Promise<ReservationItemDTO[]>;
158
+ /**
159
+ * This method retrieves a paginated list of reservation items along with the total count of available reservation items satisfying the provided filters.
134
160
  *
135
- * async function retrieveReservationItems (ids: string[], skip: number, take: number) {
136
- * const inventoryModule = await initializeInventoryModule({})
161
+ * @param {FilterableReservationItemProps} selector - The filters to apply on the retrieved reservation items.
162
+ * @param {FindConfig<ReservationItemDTO>} config - The configurations determining how the reservation item is retrieved. Its properties, such as `select` or `relations`, accept the
163
+ * attributes or relations associated with a reservation item.
164
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
165
+ * @returns {Promise<[ReservationItemDTO[], number]>} The list of reservation items along with their total count.
137
166
  *
138
- * const [reservationItems, count] = await inventoryModule.listReservationItems({
139
- * id: ids
140
- * }, {
141
- * relations: ["inventory_item"],
142
- * skip,
143
- * take
167
+ * @example
168
+ * To retrieve a list of reservation items using their IDs:
169
+ *
170
+ * ```ts
171
+ * const [reservationItems, count] =
172
+ * await inventoryModuleService.listAndCountReservationItems({
173
+ * id: ["resitem_123", "resitem_321"],
144
174
  * })
175
+ * ```
145
176
  *
146
- * // do something with the reservation items or return them
147
- * }
177
+ * To specify relations that should be retrieved within the reservation items:
178
+ *
179
+ * ```ts
180
+ * const [reservationItems, count] =
181
+ * await inventoryModuleService.listAndCountReservationItems(
182
+ * {
183
+ * id: ["resitem_123", "resitem_321"],
184
+ * },
185
+ * {
186
+ * relations: ["inventory_item"],
187
+ * }
188
+ * )
189
+ * ```
190
+ *
191
+ * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
192
+ *
193
+ * ```ts
194
+ * const [reservationItems, count] =
195
+ * await inventoryModuleService.listAndCountReservationItems(
196
+ * {
197
+ * id: ["resitem_123", "resitem_321"],
198
+ * },
199
+ * {
200
+ * relations: ["inventory_item"],
201
+ * take: 20,
202
+ * skip: 2,
203
+ * }
204
+ * )
148
205
  * ```
149
206
  */
150
- listReservationItems(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: SharedContext): Promise<[ReservationItemDTO[], number]>;
207
+ listAndCountReservationItems(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: Context): Promise<[ReservationItemDTO[], number]>;
151
208
  /**
152
- * This method is used to retrieve a paginated list of inventory levels along with the total count of available inventory levels satisfying the provided filters.
209
+ * This method retrieves a paginated list of inventory levels based on optional filters and configuration.
210
+ *
153
211
  * @param {FilterableInventoryLevelProps} selector - The filters to apply on the retrieved inventory levels.
154
- * @param {FindConfig<InventoryLevelDTO>} config -
155
- * The configurations determining how the inventory levels are retrieved. Its properties, such as `select` or `relations`, accept the
212
+ * @param {FindConfig<InventoryLevelDTO>} config - The configurations determining how the inventory level is retrieved. Its properties, such as `select` or `relations`, accept the
156
213
  * attributes or relations associated with a inventory level.
157
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
158
- * @return {Promise<[InventoryLevelDTO[], number]>} The list of inventory levels along with the total count.
214
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
215
+ * @returns {Promise<InventoryLevelDTO[]>} The list of inventory levels.
159
216
  *
160
217
  * @example
161
- * To retrieve a list of inventory levels using their IDs:
218
+ * To retrieve a list of inventory levels using the IDs of their associated inventory items:
162
219
  *
163
220
  * ```ts
164
- * import {
165
- * initialize as initializeInventoryModule,
166
- * } from "@medusajs/inventory"
167
- *
168
- * async function retrieveInventoryLevels (inventoryItemIds: string[]) {
169
- * const inventoryModule = await initializeInventoryModule({})
170
- *
171
- * const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
172
- * inventory_item_id: inventoryItemIds
221
+ * const inventoryLevels =
222
+ * await inventoryModuleService.listInventoryLevels({
223
+ * inventory_item_id: ["iitem_123", "iitem_321"],
173
224
  * })
174
- *
175
- * // do something with the inventory levels or return them
176
- * }
177
225
  * ```
178
226
  *
179
227
  * To specify relations that should be retrieved within the inventory levels:
180
228
  *
181
229
  * ```ts
182
- * import {
183
- * initialize as initializeInventoryModule,
184
- * } from "@medusajs/inventory"
230
+ * const inventoryLevels =
231
+ * await inventoryModuleService.listInventoryLevels(
232
+ * {
233
+ * inventory_item_id: ["iitem_123", "iitem_321"],
234
+ * },
235
+ * {
236
+ * relations: ["inventory_item"],
237
+ * }
238
+ * )
239
+ * ```
185
240
  *
186
- * async function retrieveInventoryLevels (inventoryItemIds: string[]) {
187
- * const inventoryModule = await initializeInventoryModule({})
241
+ * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
188
242
  *
189
- * const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
190
- * inventory_item_id: inventoryItemIds
191
- * }, {
192
- * relations: ["inventory_item"]
193
- * })
243
+ * ```ts
244
+ * const inventoryLevels =
245
+ * await inventoryModuleService.listInventoryLevels(
246
+ * {
247
+ * inventory_item_id: ["iitem_123", "iitem_321"],
248
+ * },
249
+ * {
250
+ * relations: ["inventory_item"],
251
+ * take: 20,
252
+ * skip: 2,
253
+ * }
254
+ * )
255
+ * ```
256
+ */
257
+ listInventoryLevels(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: Context): Promise<InventoryLevelDTO[]>;
258
+ /**
259
+ * This method retrieves a paginated list of inventory levels along with the total count of available inventory levels satisfying the provided filters.
194
260
  *
195
- * // do something with the inventory levels or return them
196
- * }
261
+ * @param {FilterableInventoryLevelProps} selector - The filters to apply on the retrieved inventory levels.
262
+ * @param {FindConfig<InventoryLevelDTO>} config - The configurations determining how the inventory level is retrieved. Its properties, such as `select` or `relations`, accept the
263
+ * attributes or relations associated with a inventory level.
264
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
265
+ * @returns {Promise<[InventoryLevelDTO[], number]>} The list of inventory levels along with their total count.
266
+ *
267
+ * @example
268
+ * To retrieve a list of inventory levels using the IDs of their associated inventory items:
269
+ *
270
+ * ```ts
271
+ * const [inventoryLevels, count] =
272
+ * await inventoryModuleService.listAndCountInventoryLevels(
273
+ * {
274
+ * inventory_item_id: ["iitem_123", "iitem_321"],
275
+ * },
276
+ * {
277
+ * relations: ["inventory_item"],
278
+ * take: 20,
279
+ * skip: 2,
280
+ * }
281
+ * )
197
282
  * ```
198
283
  *
199
- * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
284
+ * To specify relations that should be retrieved within the inventory levels:
200
285
  *
201
286
  * ```ts
202
- * import {
203
- * initialize as initializeInventoryModule,
204
- * } from "@medusajs/inventory"
287
+ * const [inventoryLevels, count] =
288
+ * await inventoryModuleService.listAndCountInventoryLevels(
289
+ * {
290
+ * inventory_item_id: ["iitem_123", "iitem_321"],
291
+ * },
292
+ * {
293
+ * relations: ["inventory_item"],
294
+ * }
295
+ * )
296
+ * ```
205
297
  *
206
- * async function retrieveInventoryLevels (inventoryItemIds: string[], skip: number, take: number) {
207
- * const inventoryModule = await initializeInventoryModule({})
298
+ * By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
208
299
  *
209
- * const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
210
- * inventory_item_id: inventoryItemIds
211
- * }, {
212
- * relations: ["inventory_item"],
213
- * skip,
214
- * take
300
+ * ```ts
301
+ * const [inventoryLevels, count] =
302
+ * await inventoryModuleService.listAndCountInventoryLevels({
303
+ * inventory_item_id: ["iitem_123", "iitem_321"],
215
304
  * })
216
- *
217
- * // do something with the inventory levels or return them
218
- * }
219
305
  * ```
220
306
  */
221
- listInventoryLevels(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: SharedContext): Promise<[InventoryLevelDTO[], number]>;
307
+ listAndCountInventoryLevels(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: Context): Promise<[InventoryLevelDTO[], number]>;
222
308
  /**
223
- * This method is used to retrieve an inventory item by its ID
309
+ * This method retrieves an inventory item by its ID.
224
310
  *
225
- * @param {string} inventoryItemId - The ID of the inventory item to retrieve.
226
- * @param {FindConfig<InventoryItemDTO>} config -
227
- * The configurations determining how the inventory item is retrieved. Its properties, such as `select` or `relations`, accept the
311
+ * @param {string} inventoryItemId - The inventory item's ID.
312
+ * @param {FindConfig<InventoryItemDTO>} config - The configurations determining how the inventory item is retrieved. Its properties, such as `select` or `relations`, accept the
228
313
  * attributes or relations associated with a inventory item.
229
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
314
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
230
315
  * @returns {Promise<InventoryItemDTO>} The retrieved inventory item.
231
316
  *
232
317
  * @example
233
318
  * A simple example that retrieves a inventory item by its ID:
234
319
  *
235
320
  * ```ts
236
- * import {
237
- * initialize as initializeInventoryModule,
238
- * } from "@medusajs/inventory"
239
- *
240
- * async function retrieveInventoryItem (id: string) {
241
- * const inventoryModule = await initializeInventoryModule({})
242
- *
243
- * const inventoryItem = await inventoryModule.retrieveInventoryItem(id)
244
- *
245
- * // do something with the inventory item or return it
246
- * }
321
+ * const inventoryItem =
322
+ * await inventoryModuleService.retrieveInventoryItem("iitem_123")
247
323
  * ```
248
324
  *
249
325
  * To specify relations that should be retrieved:
250
326
  *
251
327
  * ```ts
252
- * import {
253
- * initialize as initializeInventoryModule,
254
- * } from "@medusajs/inventory"
255
- *
256
- * async function retrieveInventoryItem (id: string) {
257
- * const inventoryModule = await initializeInventoryModule({})
258
- *
259
- * const inventoryItem = await inventoryModule.retrieveInventoryItem(id, {
260
- * relations: ["inventory_level"]
261
- * })
262
- *
263
- * // do something with the inventory item or return it
264
- * }
328
+ * const inventoryItem = await inventoryModuleService.retrieveInventoryItem(
329
+ * "iitem_123",
330
+ * {
331
+ * relations: ["location_levels"],
332
+ * }
333
+ * )
265
334
  * ```
266
335
  */
267
- retrieveInventoryItem(inventoryItemId: string, config?: FindConfig<InventoryItemDTO>, context?: SharedContext): Promise<InventoryItemDTO>;
336
+ retrieveInventoryItem(inventoryItemId: string, config?: FindConfig<InventoryItemDTO>, context?: Context): Promise<InventoryItemDTO>;
268
337
  /**
269
- * This method is used to retrieve an inventory level for an inventory item and a location.
338
+ * This method retrieves an inventory level based on its associated inventory item and location.
270
339
  *
271
- * @param {string} inventoryItemId - The ID of the inventory item.
272
- * @param {string} locationId - The ID of the location.
273
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
340
+ * @param {string} inventoryItemId - The inventory item's ID.
341
+ * @param {string} locationId - The location's ID.
342
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
274
343
  * @returns {Promise<InventoryLevelDTO>} The retrieved inventory level.
275
344
  *
276
345
  * @example
277
- * import {
278
- * initialize as initializeInventoryModule,
279
- * } from "@medusajs/inventory"
280
- *
281
- * async function retrieveInventoryLevel (
282
- * inventoryItemId: string,
283
- * locationId: string
284
- * ) {
285
- * const inventoryModule = await initializeInventoryModule({})
286
- *
287
- * const inventoryLevel = await inventoryModule.retrieveInventoryLevel(
288
- * inventoryItemId,
289
- * locationId
346
+ * const inventoryLevel =
347
+ * await inventoryModuleService.retrieveInventoryLevelByItemAndLocation(
348
+ * "iitem_123",
349
+ * "loc_123"
290
350
  * )
291
- *
292
- * // do something with the inventory level or return it
293
- * }
294
351
  */
295
- retrieveInventoryLevel(inventoryItemId: string, locationId: string, context?: SharedContext): Promise<InventoryLevelDTO>;
352
+ retrieveInventoryLevelByItemAndLocation(inventoryItemId: string, locationId: string, context?: Context): Promise<InventoryLevelDTO>;
296
353
  /**
297
- * This method is used to retrieve a reservation item by its ID.
354
+ * This method retrieves an inventory level by its ID.
298
355
  *
299
- * @param {string} reservationId - The ID of the reservation item.
300
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
301
- * @returns {Promise<ReservationItemDTO>} The retrieved reservation item.
356
+ * @param {string} inventoryLevelId - The inventory level's ID.
357
+ * @param {FindConfig<InventoryLevelDTO>} config - The configurations determining how the inventory level is retrieved. Its properties, such as `select` or `relations`, accept the
358
+ * attributes or relations associated with a inventory level.
359
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
360
+ * @returns {Promise<InventoryLevelDTO>} The retrieved inventory level.
302
361
  *
303
362
  * @example
304
- * import {
305
- * initialize as initializeInventoryModule,
306
- * } from "@medusajs/inventory"
363
+ * A simple example that retrieves a inventory level by its ID:
307
364
  *
308
- * async function retrieveReservationItem (id: string) {
309
- * const inventoryModule = await initializeInventoryModule({})
365
+ * ```ts
366
+ * const inventoryLevel =
367
+ * await inventoryModuleService.retrieveInventoryLevel(
368
+ * "iitem_123"
369
+ * )
370
+ * ```
310
371
  *
311
- * const reservationItem = await inventoryModule.retrieveReservationItem(id)
372
+ * To specify relations that should be retrieved:
312
373
  *
313
- * // do something with the reservation item or return it
314
- * }
374
+ * ```ts
375
+ * const inventoryLevel =
376
+ * await inventoryModuleService.retrieveInventoryLevel(
377
+ * "iitem_123",
378
+ * {
379
+ * relations: ["inventory_item"],
380
+ * }
381
+ * )
382
+ * ```
315
383
  */
316
- retrieveReservationItem(reservationId: string, context?: SharedContext): Promise<ReservationItemDTO>;
384
+ retrieveInventoryLevel(inventoryLevelId: string, config?: FindConfig<InventoryLevelDTO>, context?: Context): Promise<InventoryLevelDTO>;
317
385
  /**
318
- * This method is used to create a reservation item.
386
+ * This method retrieves a reservation item by its ID.
319
387
  *
320
- * @param {CreateReservationItemInput} input - The details of the reservation item to create.
321
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
322
- * @returns {Promise<ReservationItemDTO>} The created reservation item's details.
388
+ * @param {string} reservationId - The reservation's ID.
389
+ * @param {FindConfig<ReservationItemDTO>} config - The configurations determining how the reservation item is retrieved. Its properties, such as `select` or `relations`, accept the
390
+ * attributes or relations associated with a reservation item.
391
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
392
+ * @returns {Promise<ReservationItemDTO>} The retrieved reservation item.
323
393
  *
324
394
  * @example
325
- * import {
326
- * initialize as initializeInventoryModule,
327
- * } from "@medusajs/inventory"
395
+ * A simple example that retrieves a reservation item by its ID:
328
396
  *
329
- * async function createReservationItem (item: {
330
- * inventory_item_id: string,
331
- * location_id: string,
332
- * quantity: number
333
- * }) {
334
- * const inventoryModule = await initializeInventoryModule({})
335
- *
336
- * const reservationItem = await inventoryModule.createReservationItems(
337
- * item
397
+ * ```ts
398
+ * const reservationItem =
399
+ * await inventoryModuleService.retrieveReservationItem(
400
+ * "resitem"
338
401
  * )
402
+ * ```
339
403
  *
340
- * // do something with the reservation item or return them
341
- * }
404
+ * To specify relations that should be retrieved:
405
+ *
406
+ * ```ts
407
+ * const reservationItem =
408
+ * await inventoryModuleService.retrieveReservationItem(
409
+ * "resitem",
410
+ * {
411
+ * relations: ["inventory_item"],
412
+ * }
413
+ * )
414
+ * ```
342
415
  */
343
- createReservationItem(input: CreateReservationItemInput, context?: SharedContext): Promise<ReservationItemDTO>;
416
+ retrieveReservationItem(reservationId: string, config?: FindConfig<ReservationItemDTO>, context?: Context): Promise<ReservationItemDTO>;
344
417
  /**
345
- * This method is used to create reservation items.
418
+ * This method creates reservation items.
346
419
  *
347
- * @param {CreateReservationItemInput[]} input - The details of the reservation items to create.
348
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
349
- * @returns { Promise<ReservationItemDTO[]>} The created reservation items' details.
420
+ * @param {CreateReservationItemInput[]} input - The details of the reservation items to be created.
421
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
422
+ * @returns {Promise<ReservationItemDTO[]>} The created reservation items.
350
423
  *
351
424
  * @example
352
- * import {
353
- * initialize as initializeInventoryModule,
354
- * } from "@medusajs/inventory"
355
- *
356
- * async function createReservationItems (items: {
357
- * inventory_item_id: string,
358
- * location_id: string,
359
- * quantity: number
360
- * }[]) {
361
- * const inventoryModule = await initializeInventoryModule({})
362
- *
363
- * const reservationItems = await inventoryModule.createReservationItems(
364
- * items
365
- * )
366
- *
367
- * // do something with the reservation items or return them
368
- * }
425
+ * const reservationItems =
426
+ * await inventoryModuleService.createReservationItems([
427
+ * {
428
+ * inventory_item_id: "iitem_123",
429
+ * location_id: "loc_123",
430
+ * quantity: 10,
431
+ * },
432
+ * ])
369
433
  */
370
- createReservationItems(input: CreateReservationItemInput[], context?: SharedContext): Promise<ReservationItemDTO[]>;
434
+ createReservationItems(input: CreateReservationItemInput[], context?: Context): Promise<ReservationItemDTO[]>;
371
435
  /**
372
- * This method is used to create an inventory item.
436
+ * This method creates a reservation item.
373
437
  *
374
- * @param {CreateInventoryItemInput} input - The details of the inventory item to create.
375
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
376
- * @returns {Promise<InventoryItemDTO>} The created inventory item's details.
438
+ * @param {CreateReservationItemInput} input - The details of the reservation item to be created.
439
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
440
+ * @returns {Promise<ReservationItemDTO>} The created reservation item.
377
441
  *
378
442
  * @example
379
- * import {
380
- * initialize as initializeInventoryModule,
381
- * } from "@medusajs/inventory"
382
- *
383
- * async function createInventoryItem (item: {
384
- * sku: string,
385
- * requires_shipping: boolean
386
- * }) {
387
- * const inventoryModule = await initializeInventoryModule({})
388
- *
389
- * const inventoryItem = await inventoryModule.createInventoryItem(
390
- * item
391
- * )
392
- *
393
- * // do something with the inventory item or return it
394
- * }
443
+ * const reservationItem =
444
+ * await inventoryModuleService.createReservationItems({
445
+ * inventory_item_id: "iitem_123",
446
+ * location_id: "loc_123",
447
+ * quantity: 10,
448
+ * })
395
449
  */
396
- createInventoryItem(input: CreateInventoryItemInput, context?: SharedContext): Promise<InventoryItemDTO>;
450
+ createReservationItems(input: CreateReservationItemInput, context?: Context): Promise<ReservationItemDTO>;
397
451
  /**
398
- * This method is used to create inventory items.
452
+ * This method creates inventory items.
399
453
  *
400
- * @param {CreateInventoryItemInput[]} input - The details of the inventory items to create.
401
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
402
- * @returns {Promise<InventoryItemDTO[]>} The created inventory items' details.
454
+ * @param {CreateInventoryItemInput[]} input - The details of the inventory items to be created.
455
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
456
+ * @returns {Promise<InventoryItemDTO[]>} The created inventory items.
403
457
  *
404
458
  * @example
405
- * import {
406
- * initialize as initializeInventoryModule,
407
- * } from "@medusajs/inventory"
408
- *
409
- * async function createInventoryItems (items: {
410
- * sku: string,
411
- * requires_shipping: boolean
412
- * }[]) {
413
- * const inventoryModule = await initializeInventoryModule({})
414
- *
415
- * const inventoryItems = await inventoryModule.createInventoryItems(
416
- * items
417
- * )
418
- *
419
- * // do something with the inventory items or return them
420
- * }
459
+ * const inventoryItems = await inventoryModuleService.createInventoryItems([
460
+ * {
461
+ * sku: "SHIRT",
462
+ * },
463
+ * ])
421
464
  */
422
- createInventoryItems(input: CreateInventoryItemInput[], context?: SharedContext): Promise<InventoryItemDTO[]>;
465
+ createInventoryItems(input: CreateInventoryItemInput[], context?: Context): Promise<InventoryItemDTO[]>;
423
466
  /**
424
- * This method is used to create inventory level.
467
+ * This method creates an inventory item.
425
468
  *
426
- * @param {CreateInventoryLevelInput} data - The details of the inventory level to create.
427
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
428
- * @returns {Promise<InventoryLevelDTO>} The created inventory level's details.
469
+ * @param {CreateInventoryItemInput} input - The details of the inventory item to be created.
470
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
471
+ * @returns {Promise<InventoryItemDTO>} The created inventory item.
429
472
  *
430
473
  * @example
431
- * import {
432
- * initialize as initializeInventoryModule,
433
- * } from "@medusajs/inventory"
434
- *
435
- * async function createInventoryLevel (item: {
436
- * inventory_item_id: string
437
- * location_id: string
438
- * stocked_quantity: number
439
- * }) {
440
- * const inventoryModule = await initializeInventoryModule({})
441
- *
442
- * const inventoryLevel = await inventoryModule.createInventoryLevel(
443
- * item
444
- * )
445
- *
446
- * // do something with the inventory level or return it
447
- * }
474
+ * const inventoryItem = await inventoryModuleService.createInventoryItems({
475
+ * sku: "SHIRT",
476
+ * })
448
477
  */
449
- createInventoryLevel(data: CreateInventoryLevelInput, context?: SharedContext): Promise<InventoryLevelDTO>;
478
+ createInventoryItems(input: CreateInventoryItemInput, context?: Context): Promise<InventoryItemDTO>;
450
479
  /**
451
- * This method is used to create inventory levels.
480
+ * This method creates inventory levels.
452
481
  *
453
- * @param {CreateInventoryLevelInput[]} data - The details of the inventory levels to create.
454
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
455
- * @returns {Promise<InventoryLevelDTO[]>} The created inventory levels' details.
482
+ * @param {CreateInventoryLevelInput[]} data - The details of the inventory levels to be created.
483
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
484
+ * @returns {Promise<InventoryLevelDTO[]>} The created inventory levels.
456
485
  *
457
486
  * @example
458
- * import {
459
- * initialize as initializeInventoryModule,
460
- * } from "@medusajs/inventory"
461
- *
462
- * async function createInventoryLevels (items: {
463
- * inventory_item_id: string
464
- * location_id: string
465
- * stocked_quantity: number
466
- * }[]) {
467
- * const inventoryModule = await initializeInventoryModule({})
468
- *
469
- * const inventoryLevels = await inventoryModule.createInventoryLevels(
470
- * items
471
- * )
472
- *
473
- * // do something with the inventory levels or return them
474
- * }
487
+ * const inventoryLevels =
488
+ * await inventoryModuleService.createInventoryLevels([
489
+ * {
490
+ * inventory_item_id: "iitem_123",
491
+ * location_id: "loc_123",
492
+ * stocked_quantity: 10,
493
+ * },
494
+ * {
495
+ * inventory_item_id: "iitem_321",
496
+ * location_id: "loc_321",
497
+ * stocked_quantity: 20,
498
+ * reserved_quantity: 10,
499
+ * },
500
+ * ])
475
501
  */
476
- createInventoryLevels(data: CreateInventoryLevelInput[], context?: SharedContext): Promise<InventoryLevelDTO[]>;
502
+ createInventoryLevels(data: CreateInventoryLevelInput[], context?: Context): Promise<InventoryLevelDTO[]>;
477
503
  /**
478
- * This method is used to update inventory levels. Each inventory level is identified by the IDs of its associated inventory item and location.
504
+ * This method creates an inventory level.
479
505
  *
480
- * @param {BulkUpdateInventoryLevelInput} updates - The attributes to update in each inventory level.
481
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
482
- * @returns {Promise<InventoryLevelDTO[]>} The updated inventory levels' details.
506
+ * @param {CreateInventoryLevelInput} data - The details of the inventory level to be created.
507
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
508
+ * @returns {Promise<InventoryLevelDTO>} The created inventory level.
483
509
  *
484
510
  * @example
485
- * import {
486
- * initialize as initializeInventoryModule,
487
- * } from "@medusajs/inventory"
488
- *
489
- * async function updateInventoryLevels (items: {
490
- * inventory_item_id: string,
491
- * location_id: string,
492
- * stocked_quantity: number
493
- * }[]) {
494
- * const inventoryModule = await initializeInventoryModule({})
495
- *
496
- * const inventoryLevels = await inventoryModule.updateInventoryLevels(
497
- * items
498
- * )
499
- *
500
- * // do something with the inventory levels or return them
501
- * }
511
+ * const inventoryLevels =
512
+ * await inventoryModuleService.createInventoryLevels({
513
+ * inventory_item_id: "iitem_123",
514
+ * location_id: "loc_123",
515
+ * stocked_quantity: 10,
516
+ * })
502
517
  */
503
- updateInventoryLevels(updates: BulkUpdateInventoryLevelInput[], context?: SharedContext): Promise<InventoryLevelDTO[]>;
518
+ createInventoryLevels(data: CreateInventoryLevelInput, context?: Context): Promise<InventoryLevelDTO>;
504
519
  /**
505
- * This method is used to update an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
520
+ * This method updates existing inventory levels.
506
521
  *
507
- * @param {string} inventoryItemId - The ID of the inventory item.
508
- * @param {string} locationId - The ID of the location.
509
- * @param {UpdateInventoryLevelInput} update - The attributes to update in the location level.
510
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
511
- * @returns {Promise<InventoryLevelDTO>} The updated inventory level's details.
522
+ * @param {BulkUpdateInventoryLevelInput[]} updates - The list of The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
523
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
524
+ * @returns {Promise<InventoryLevelDTO[]>} The updated inventory levels.
512
525
  *
513
526
  * @example
514
- * import {
515
- * initialize as initializeInventoryModule,
516
- * } from "@medusajs/inventory"
517
- *
518
- * async function updateInventoryLevel (
519
- * inventoryItemId: string,
520
- * locationId: string,
521
- * stockedQuantity: number
522
- * ) {
523
- * const inventoryModule = await initializeInventoryModule({})
524
- *
525
- * const inventoryLevel = await inventoryModule.updateInventoryLevels(
526
- * inventoryItemId,
527
- * locationId,
527
+ * const inventoryLevels =
528
+ * await inventoryModuleService.updateInventoryLevels([
528
529
  * {
529
- * stocked_quantity: stockedQuantity
530
- * }
531
- * )
532
- *
533
- * // do something with the inventory level or return it
534
- * }
530
+ * inventory_item_id: "iitem_123",
531
+ * location_id: "loc_123",
532
+ * id: "ilev_123",
533
+ * stocked_quantity: 20,
534
+ * },
535
+ * ])
535
536
  */
536
- updateInventoryLevel(inventoryItemId: string, locationId: string, update: UpdateInventoryLevelInput, context?: SharedContext): Promise<InventoryLevelDTO>;
537
+ updateInventoryLevels(updates: BulkUpdateInventoryLevelInput[], context?: Context): Promise<InventoryLevelDTO[]>;
537
538
  /**
538
- * This method is used to update an inventory item.
539
+ * This method updates an existing inventory level.
539
540
  *
540
- * @param {string} inventoryItemId - The ID of the inventory item.
541
- * @param {Partial<CreateInventoryItemInput>} input - The attributes to update in the inventory item.
542
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
543
- * @returns {Promise<InventoryItemDTO>} The updated inventory item's details.
541
+ * @param {BulkUpdateInventoryLevelInput} updates - The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
542
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
543
+ * @returns {Promise<InventoryLevelDTO>} The updated inventory level.
544
544
  *
545
545
  * @example
546
- * import {
547
- * initialize as initializeInventoryModule,
548
- * } from "@medusajs/inventory"
546
+ * const inventoryLevel =
547
+ * await inventoryModuleService.updateInventoryLevels({
548
+ * inventory_item_id: "iitem_123",
549
+ * location_id: "loc_123",
550
+ * stocked_quantity: 20,
551
+ * })
552
+ */
553
+ updateInventoryLevels(updates: BulkUpdateInventoryLevelInput, context?: Context): Promise<InventoryLevelDTO>;
554
+ /**
555
+ * This method updates an existing inventory item.
549
556
  *
550
- * async function updateInventoryItem (
551
- * inventoryItemId: string,
552
- * sku: string
553
- * ) {
554
- * const inventoryModule = await initializeInventoryModule({})
557
+ * @param {UpdateInventoryItemInput} input - The attributes to update in the inventory item.
558
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
559
+ * @returns {Promise<InventoryItemDTO>} The updated inventory item.
555
560
  *
556
- * const inventoryItem = await inventoryModule.updateInventoryItem(
557
- * inventoryItemId,
558
- * {
559
- * sku
560
- * }
561
- * )
561
+ * @example
562
+ * const inventoryItem = await inventoryModuleService.updateInventoryItems({
563
+ * id: "iitem_123",
564
+ * title: "Medusa Shirt Inventory",
565
+ * })
566
+ */
567
+ updateInventoryItems(input: UpdateInventoryItemInput, context?: Context): Promise<InventoryItemDTO>;
568
+ /**
569
+ * This method updates existing inventory items.
562
570
  *
563
- * // do something with the inventory item or return it
564
- * }
571
+ * @param {UpdateInventoryItemInput[]} input - The attributes to update in the inventory items.
572
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
573
+ * @returns {Promise<InventoryItemDTO[]>} The updated inventory items.
574
+ *
575
+ * @example
576
+ * const inventoryItems = await inventoryModuleService.updateInventoryItems([
577
+ * {
578
+ * id: "iitem_123",
579
+ * title: "Medusa Shirt Inventory",
580
+ * },
581
+ * {
582
+ * id: "iitem_321",
583
+ * description: "The inventory of Medusa pants",
584
+ * },
585
+ * ])
565
586
  */
566
- updateInventoryItem(inventoryItemId: string, input: Partial<CreateInventoryItemInput>, context?: SharedContext): Promise<InventoryItemDTO>;
587
+ updateInventoryItems(input: UpdateInventoryItemInput[], context?: Context): Promise<InventoryItemDTO[]>;
567
588
  /**
568
- * This method is used to update a reservation item.
589
+ * This method updates an existing reservation item.
569
590
  *
570
- * @param {string} reservationItemId - The ID of the reservation item.
571
- * @param {UpdateReservationItemInput} input - The attributes to update in the reservation item.
572
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
591
+ * @param {UpdateReservationItemInput} input - The attributes to update in a reservation item.
592
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
573
593
  * @returns {Promise<ReservationItemDTO>} The updated reservation item.
574
594
  *
575
595
  * @example
576
- * import {
577
- * initialize as initializeInventoryModule,
578
- * } from "@medusajs/inventory"
596
+ * const reservationItem =
597
+ * await inventoryModuleService.updateReservationItems({
598
+ * id: "resitem_123",
599
+ * quantity: 10,
600
+ * })
601
+ */
602
+ updateReservationItems(input: UpdateReservationItemInput, context?: Context): Promise<ReservationItemDTO>;
603
+ /**
604
+ * This method updates existing reservation items.
579
605
  *
580
- * async function updateReservationItem (
581
- * reservationItemId: string,
582
- * quantity: number
583
- * ) {
584
- * const inventoryModule = await initializeInventoryModule({})
606
+ * @param {UpdateReservationItemInput[]} input - The attributes to update in the reservation items.
607
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
608
+ * @returns {Promise<ReservationItemDTO[]>} The updated reservation items.
585
609
  *
586
- * const reservationItem = await inventoryModule.updateReservationItem(
587
- * reservationItemId,
610
+ * @example
611
+ * const reservationItems =
612
+ * await inventoryModuleService.updateReservationItems([
588
613
  * {
589
- * quantity
590
- * }
591
- * )
614
+ * id: "resitem_123",
615
+ * quantity: 10,
616
+ * },
617
+ * ])
618
+ */
619
+ updateReservationItems(input: UpdateReservationItemInput[], context?: Context): Promise<ReservationItemDTO[]>;
620
+ /**
621
+ * This method deletes a reservation item by its associated line item.
592
622
  *
593
- * // do something with the reservation item or return it
594
- * }
623
+ * @param {string | string[]} lineItemId - The line item's ID.
624
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
625
+ * @returns {Promise<void>} Resolves when the reservation item is deleted.
626
+ *
627
+ * @example
628
+ * await inventoryModuleService.deleteReservationItemByLocationId(
629
+ * "cali_123"
630
+ * )
595
631
  */
596
- updateReservationItem(reservationItemId: string, input: UpdateReservationItemInput, context?: SharedContext): Promise<ReservationItemDTO>;
632
+ deleteReservationItemsByLineItem(lineItemId: string | string[], context?: Context): Promise<void>;
597
633
  /**
598
- * This method is used to delete the reservation items associated with a line item or multiple line items.
634
+ * This method is used to restore the reservation items associated with a line item or multiple line items that were deleted.
599
635
  *
600
636
  * @param {string | string[]} lineItemId - The ID(s) of the line item(s).
601
637
  * @param {SharedContext} context - A context used to share re9sources, such as transaction manager, between the application and the module.
@@ -606,302 +642,297 @@ export interface IInventoryService extends IModuleService {
606
642
  * initialize as initializeInventoryModule,
607
643
  * } from "@medusajs/inventory"
608
644
  *
609
- * async function deleteReservationItemsByLineItem (
645
+ * async function restoreReservationItemsByLineItem (
610
646
  * lineItemIds: string[]
611
647
  * ) {
612
648
  * const inventoryModule = await initializeInventoryModule({})
613
649
  *
614
- * await inventoryModule.deleteReservationItemsByLineItem(
650
+ * await inventoryModule.restoreReservationItemsByLineItem(
615
651
  * lineItemIds
616
652
  * )
617
653
  * }
618
654
  */
619
- deleteReservationItemsByLineItem(lineItemId: string | string[], context?: SharedContext): Promise<void>;
655
+ restoreReservationItemsByLineItem(lineItemId: string | string[], context?: Context): Promise<void>;
620
656
  /**
621
- * This method is used to delete a reservation item or multiple reservation items by their IDs.
657
+ * This method deletes reservation items by their IDs.
622
658
  *
623
- * @param {string | string[]} reservationItemId - The ID(s) of the reservation item(s) to delete.
624
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
625
- * @returns {Promise<void>} Resolves when the reservation item(s) are successfully deleted.
659
+ * @param {string | string[]} reservationItemId - The reservation items' IDs.
660
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
661
+ * @returns {Promise<void>} Resolves when the reservation item is deleted.
626
662
  *
627
663
  * @example
628
- * import {
629
- * initialize as initializeInventoryModule,
630
- * } from "@medusajs/inventory"
631
- *
632
- * async function deleteReservationItems (
633
- * reservationItemIds: string[]
634
- * ) {
635
- * const inventoryModule = await initializeInventoryModule({})
636
- *
637
- * await inventoryModule.deleteReservationItem(
638
- * reservationItemIds
639
- * )
640
- * }
664
+ * await inventoryModuleService.deleteReservationItems(
665
+ * "resitem_123"
666
+ * )
641
667
  */
642
- deleteReservationItem(reservationItemId: string | string[], context?: SharedContext): Promise<void>;
668
+ deleteReservationItems(reservationItemId: string | string[], context?: Context): Promise<void>;
643
669
  /**
644
- * This method is used to delete an inventory item or multiple inventory items. The inventory items are only soft deleted and can be restored using the
645
- * {@link restoreInventoryItem} method.
670
+ * This method soft deletes reservations by their IDs.
646
671
  *
647
- * @param {string | string[]} inventoryItemId - The ID(s) of the inventory item(s) to delete.
648
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
649
- * @returns {Promise<void>} Resolves when the inventory item(s) are successfully deleted.
672
+ * @param {string[]} inventoryLevelIds - The reservations' IDs.
673
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
674
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
675
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
676
+ * If there are no related records, the promise resolves to `void`.
650
677
  *
651
678
  * @example
652
- * import {
653
- * initialize as initializeInventoryModule,
654
- * } from "@medusajs/inventory"
679
+ * await inventoryModuleService.softDeleteReservationItems([
680
+ * "ilev_123",
681
+ * ])
682
+ */
683
+ softDeleteReservationItems<TReturnableLinkableKeys extends string = string>(ReservationItemIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
684
+ /**
685
+ * This method restores soft deleted reservations by their IDs.
655
686
  *
656
- * async function deleteInventoryItem (
657
- * inventoryItems: string[]
658
- * ) {
659
- * const inventoryModule = await initializeInventoryModule({})
687
+ * @param {string[]} ReservationItemIds - The reservations' IDs.
688
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the reservation. You can pass to its `returnLinkableKeys`
689
+ * property any of the reservation's relation attribute names, such as `{type relation name}`.
690
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
691
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
692
+ * If there are no related records restored, the promise resolves to `void`.
660
693
  *
661
- * await inventoryModule.deleteInventoryItem(
662
- * inventoryItems
663
- * )
664
- * }
694
+ * @example
695
+ * await inventoryModuleService.restoreReservationItems([
696
+ * "ilev_123",
697
+ * ])
665
698
  */
666
- deleteInventoryItem(inventoryItemId: string | string[], context?: SharedContext): Promise<void>;
699
+ restoreReservationItems<TReturnableLinkableKeys extends string = string>(ReservationItemIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
667
700
  /**
668
- * This method is used to restore an inventory item or multiple inventory items that were previously deleted using the {@link deleteInventoryItem} method.
701
+ * This method deletes inventory items by their IDs.
669
702
  *
670
- * @param {string | string[]} inventoryItemId - The ID(s) of the inventory item(s) to restore.
671
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
672
- * @returns {Promise<void>} Resolves when the inventory item(s) are successfully restored.
703
+ * @param {string | string[]} inventoryItemId - The inventory item's ID.
704
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
705
+ * @returns {Promise<void>} Resolves when the inventory items are deleted.
673
706
  *
674
707
  * @example
675
- * import {
676
- * initialize as initializeInventoryModule,
677
- * } from "@medusajs/inventory"
708
+ * await inventoryModuleService.deleteInventoryItems("iitem_123")
709
+ */
710
+ deleteInventoryItems(inventoryItemId: string | string[], context?: Context): Promise<void>;
711
+ /**
712
+ * This method soft deletes inventory items by their IDs.
678
713
  *
679
- * async function restoreInventoryItem (
680
- * inventoryItems: string[]
681
- * ) {
682
- * const inventoryModule = await initializeInventoryModule({})
714
+ * @param {string[]} inventoryItemIds - The inventory items' IDs.
715
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
716
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
717
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated location levels.
718
+ * The object's keys are the ID attribute names of the inventory service next entity's relations, such as `location_level_id`, and its value is an array of strings, each being the ID of a record associated
719
+ * with the inventory item through this relation, such as the IDs of associated location levels.
683
720
  *
684
- * await inventoryModule.restoreInventoryItem(
685
- * inventoryItems
686
- * )
687
- * }
721
+ * If there are no related records, the promise resolves to `void`.
722
+ *
723
+ * @example
724
+ * await inventoryModuleService.softDeleteInventoryItems(
725
+ * ["iitem_123", "iitem_321"],
726
+ * {
727
+ * returnLinkableKeys: ["location_level"],
728
+ * }
729
+ * )
688
730
  */
689
- restoreInventoryItem(inventoryItemId: string | string[], context?: SharedContext): Promise<void>;
731
+ softDeleteInventoryItems<TReturnableLinkableKeys extends string = string>(inventoryItemIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
690
732
  /**
691
- * This method deletes the inventory item level(s) for the ID(s) of associated location(s).
733
+ * This method restores soft deleted inventory items by their IDs.
692
734
  *
693
- * @param {string | string[]} locationId - The ID(s) of the associated location(s).
694
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
695
- * @returns {Promise<void>} Resolves when the inventory item level(s) are successfully restored.
735
+ * @param {string[]} inventoryItemIds - The inventory items' IDs.
736
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the inventory items. You can pass to its `returnLinkableKeys`
737
+ * property any of the inventory item's relation attribute names, such as `location_levels`.
738
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
739
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored, such as the ID of associated location levels.
740
+ * The object's keys are the ID attribute names of the inventory item entity's relations, such as `location_level_id`,
741
+ * and its value is an array of strings, each being the ID of the record associated with the inventory item through this relation,
742
+ * such as the IDs of associated location levels.
743
+ *
744
+ * If there are no related records restored, the promise resolves to `void`.
696
745
  *
697
746
  * @example
698
- * import {
699
- * initialize as initializeInventoryModule,
700
- * } from "@medusajs/inventory"
747
+ * await inventoryModuleService.restoreInventoryItems(
748
+ * ["iitem_123", "iitem_321"],
749
+ * {
750
+ * returnLinkableKeys: ["location_level"],
751
+ * }
752
+ * )
753
+ */
754
+ restoreInventoryItems<TReturnableLinkableKeys extends string = string>(inventoryItemIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
755
+ /**
756
+ * This method soft deletes inventory item's level by the associated location.
701
757
  *
702
- * async function deleteInventoryItemLevelByLocationId (
703
- * locationIds: string[]
704
- * ) {
705
- * const inventoryModule = await initializeInventoryModule({})
758
+ * @param {string | string[]} locationId - The locations' IDs.
759
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
760
+ * @returns {Promise<[object[], Record<string, unknown[]>]>} An array, where the first item is an array includes the soft-deleted inventory levels,
761
+ * and the second is an object that includes the IDs of related records that were soft-deleted.
706
762
  *
707
- * await inventoryModule.deleteInventoryItemLevelByLocationId(
708
- * locationIds
709
- * )
710
- * }
763
+ * @example
764
+ * await inventoryModuleService.deleteInventoryItemLevelByLocationId(
765
+ * "loc_123"
766
+ * )
711
767
  */
712
- deleteInventoryItemLevelByLocationId(locationId: string | string[], context?: SharedContext): Promise<void>;
768
+ deleteInventoryItemLevelByLocationId(locationId: string | string[], context?: Context): Promise<[object[], Record<string, unknown[]>]>;
713
769
  /**
714
- * This method deletes reservation item(s) by the ID(s) of associated location(s).
770
+ * This method deletes reservation items by their associated location.
715
771
  *
716
- * @param {string | string[]} locationId - The ID(s) of the associated location(s).
717
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
718
- * @returns {Promise<void>} Resolves when the reservation item(s) are successfully restored.
772
+ * @param {string | string[]} locationId - The location's ID.
773
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
774
+ * @returns {Promise<void>} Resolves when then reservation items are deleted successfully.
719
775
  *
720
776
  * @example
721
- * import {
722
- * initialize as initializeInventoryModule,
723
- * } from "@medusajs/inventory"
777
+ * await inventoryModuleService.deleteReservationItemByLocationId(
778
+ * "loc_123"
779
+ * )
780
+ */
781
+ deleteReservationItemByLocationId(locationId: string | string[], context?: Context): Promise<void>;
782
+ /**
783
+ * This method deletes an inventory level by its associated inventory item and location.
724
784
  *
725
- * async function deleteReservationItemByLocationId (
726
- * locationIds: string[]
727
- * ) {
728
- * const inventoryModule = await initializeInventoryModule({})
785
+ * @param {string} inventoryItemId - The inventory item's ID.
786
+ * @param {string} locationId - The location's ID.
787
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
788
+ * @returns {Promise<void>} Resolves when the inventory level is deleted successfully.
729
789
  *
730
- * await inventoryModule.deleteReservationItemByLocationId(
731
- * locationIds
732
- * )
733
- * }
790
+ * @example
791
+ * await inventoryModuleService.deleteInventoryLevel(
792
+ * "iitem_123",
793
+ * "loc_123"
794
+ * )
734
795
  */
735
- deleteReservationItemByLocationId(locationId: string | string[], context?: SharedContext): Promise<void>;
796
+ deleteInventoryLevel(inventoryItemId: string, locationId: string, context?: Context): Promise<void>;
736
797
  /**
737
- * This method is used to delete an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
798
+ * This method deletes inventory levels by their IDs.
738
799
  *
739
- * @param {string} inventoryItemId - The ID of the associated inventory item.
740
- * @param {string} locationId - The ID of the associated location.
741
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
742
- * @returns {Promise<void>} Resolves when the inventory level(s) are successfully restored.
800
+ * @param {string | string[]} inventoryLevelIds - The inventory levels' IDs.
801
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
802
+ * @returns {Promise<void>} Resolves when the inventory levels are deleted.
743
803
  *
744
804
  * @example
745
- * import {
746
- * initialize as initializeInventoryModule,
747
- * } from "@medusajs/inventory"
805
+ * await inventoryModuleService.deleteInventoryLevels("ilev_123")
806
+ */
807
+ deleteInventoryLevels(inventoryLevelIds: string | string[], context?: Context): Promise<void>;
808
+ /**
809
+ * This method soft deletes inventory levels by their IDs.
748
810
  *
749
- * async function deleteInventoryLevel (
750
- * inventoryItemId: string,
751
- * locationId: string
752
- * ) {
753
- * const inventoryModule = await initializeInventoryModule({})
811
+ * @param {string[]} inventoryLevelIds - The inventory levels' IDs.
812
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
813
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
814
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
815
+ * If there are no related records, the promise resolves to `void`.
754
816
  *
755
- * await inventoryModule.deleteInventoryLevel(
756
- * inventoryItemId,
757
- * locationId
758
- * )
759
- * }
817
+ * @example
818
+ * await inventoryModuleService.softDeleteInventoryLevels([
819
+ * "ilev_123",
820
+ * ])
760
821
  */
761
- deleteInventoryLevel(inventoryItemId: string, locationId: string, context?: SharedContext): Promise<void>;
822
+ softDeleteInventoryLevels<TReturnableLinkableKeys extends string = string>(inventoryLevelIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
762
823
  /**
763
- * This method is used to adjust the inventory level's stocked quantity. The inventory level is identified by the IDs of its associated inventory item and location.
824
+ * This method restores soft deleted inventory levels by their IDs.
764
825
  *
765
- * @param {string} inventoryItemId - The ID of the associated inventory item.
766
- * @param {string} locationId - The ID of the associated location.
767
- * @param {number} adjustment - A positive or negative number used to adjust the inventory level's stocked quantity.
768
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
769
- * @returns {Promise<InventoryLevelDTO>} The inventory level's details.
826
+ * @param {string[]} inventoryLevelIds - The inventory levels' IDs.
827
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the inventory level. You can pass to its `returnLinkableKeys`
828
+ * property any of the inventory level's relation attribute names, such as `{type relation name}`.
829
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
830
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
831
+ * If there are no related records restored, the promise resolves to `void`.
770
832
  *
771
833
  * @example
772
- * import {
773
- * initialize as initializeInventoryModule,
774
- * } from "@medusajs/inventory"
834
+ * await inventoryModuleService.restoreInventoryLevels([
835
+ * "ilev_123",
836
+ * ])
837
+ */
838
+ restoreInventoryLevels<TReturnableLinkableKeys extends string = string>(inventoryLevelIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
839
+ /**
840
+ * This method adjusts the inventory quantity of an item in a location.
775
841
  *
776
- * async function adjustInventory (
777
- * inventoryItemId: string,
778
- * locationId: string,
779
- * adjustment: number
780
- * ) {
781
- * const inventoryModule = await initializeInventoryModule({})
842
+ * @param {string} inventoryItemId - The inventory item's ID.
843
+ * @param {string} locationId - The location's ID.
844
+ * @param {number} adjustment - the adjustment to make to the quantity.
845
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
846
+ * @returns {Promise<InventoryLevelDTO>} The updated inventory level.
782
847
  *
783
- * const inventoryLevel = await inventoryModule.adjustInventory(
784
- * inventoryItemId,
785
- * locationId,
786
- * adjustment
848
+ * @example
849
+ * // add to the inventory quantity
850
+ * const inventoryLevel1 =
851
+ * await inventoryModuleService.adjustInventory(
852
+ * "iitem_123",
853
+ * "loc_123",
854
+ * 5
787
855
  * )
788
856
  *
789
- * // do something with the inventory level or return it.
790
- * }
857
+ * // subtract from the inventory quantity
858
+ * const inventoryLevel2 =
859
+ * await inventoryModuleService.adjustInventory(
860
+ * "iitem_123",
861
+ * "loc_123",
862
+ * -5
863
+ * )
791
864
  */
792
- adjustInventory(inventoryItemId: string, locationId: string, adjustment: number, context?: SharedContext): Promise<InventoryLevelDTO>;
865
+ adjustInventory(data: {
866
+ inventoryItemId: string;
867
+ locationId: string;
868
+ adjustment: number;
869
+ }[], context?: Context): Promise<InventoryLevelDTO[]>;
870
+ adjustInventory(inventoryItemId: string, locationId: string, adjustment: number, context?: Context): Promise<InventoryLevelDTO>;
793
871
  /**
794
- * This method is used to confirm whether the specified quantity of an inventory item is available in the specified locations.
872
+ * This method confirms that a quantity is available of an inventory item in the specified locations.
795
873
  *
796
- * @param {string} inventoryItemId - The ID of the inventory item to check its availability.
797
- * @param {string[]} locationIds - The IDs of the locations to check the quantity availability in.
798
- * @param {number} quantity - The quantity to check if available for the inventory item in the specified locations.
799
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
800
- * @returns {Promise<boolean>} Whether the specified quantity is available for the inventory item in the specified locations.
874
+ * @param {string} inventoryItemId - The inventory item's ID.
875
+ * @param {string[]} locationIds - The locations' IDs.
876
+ * @param {number} quantity - The quantity to confirm its availability.
877
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
878
+ * @returns {Promise<boolean>} Whether the quantity is available.
801
879
  *
802
880
  * @example
803
- * import {
804
- * initialize as initializeInventoryModule,
805
- * } from "@medusajs/inventory"
806
- *
807
- * async function confirmInventory (
808
- * inventoryItemId: string,
809
- * locationIds: string[],
810
- * quantity: number
811
- * ) {
812
- * const inventoryModule = await initializeInventoryModule({})
813
- *
814
- * return await inventoryModule.confirmInventory(
815
- * inventoryItemId,
816
- * locationIds,
817
- * quantity
881
+ * const isAvailable =
882
+ * await inventoryModuleService.confirmInventory(
883
+ * "iitem_123",
884
+ * ["loc_123", "loc_321"],
885
+ * 10
818
886
  * )
819
- * }
820
887
  */
821
- confirmInventory(inventoryItemId: string, locationIds: string[], quantity: number, context?: SharedContext): Promise<boolean>;
888
+ confirmInventory(inventoryItemId: string, locationIds: string[], quantity: number, context?: Context): Promise<boolean>;
822
889
  /**
823
- * This method is used to retrieve the available quantity of an inventory item within the specified locations.
890
+ * This method retrieves the available quantity of an inventory item in the specified locations.
824
891
  *
825
- * @param {string} inventoryItemId - The ID of the inventory item to retrieve its quantity.
826
- * @param {string[]} locationIds - The IDs of the locations to retrieve the available quantity from.
827
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
828
- * @returns {Promise<number>} The available quantity of the inventory item in the specified locations.
892
+ * @param {string} inventoryItemId - The inventory item's ID.
893
+ * @param {string[]} locationIds - The locations' IDs.
894
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
895
+ * @returns {Promise<number>} The available quantity of the item.
829
896
  *
830
897
  * @example
831
- * import {
832
- * initialize as initializeInventoryModule,
833
- * } from "@medusajs/inventory"
834
- *
835
- * async function retrieveAvailableQuantity (
836
- * inventoryItemId: string,
837
- * locationIds: string[],
838
- * ) {
839
- * const inventoryModule = await initializeInventoryModule({})
840
- *
841
- * const quantity = await inventoryModule.retrieveAvailableQuantity(
842
- * inventoryItemId,
843
- * locationIds,
898
+ * const availableQuantity =
899
+ * await inventoryModuleService.retrieveAvailableQuantity(
900
+ * "iitem_123",
901
+ * ["loc_123", "loc_321"]
844
902
  * )
845
- *
846
- * // do something with the quantity or return it
847
- * }
848
903
  */
849
- retrieveAvailableQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext): Promise<number>;
904
+ retrieveAvailableQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise<number>;
850
905
  /**
851
- * This method is used to retrieve the stocked quantity of an inventory item within the specified locations.
906
+ * This method retrieves the stocked quantity of an inventory item in the specified location.
852
907
  *
853
- * @param {string} inventoryItemId - The ID of the inventory item to retrieve its stocked quantity.
854
- * @param {string[]} locationIds - The IDs of the locations to retrieve the stocked quantity from.
855
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
856
- * @returns {Promise<number>} The stocked quantity of the inventory item in the specified locations.
908
+ * @param {string} inventoryItemId - The inventory item's ID.
909
+ * @param {string[]} locationIds - The locations' IDs.
910
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
911
+ * @returns {Promise<number>} The stocked quantity of the item.
857
912
  *
858
913
  * @example
859
- * import {
860
- * initialize as initializeInventoryModule,
861
- * } from "@medusajs/inventory"
862
- *
863
- * async function retrieveStockedQuantity (
864
- * inventoryItemId: string,
865
- * locationIds: string[],
866
- * ) {
867
- * const inventoryModule = await initializeInventoryModule({})
868
- *
869
- * const quantity = await inventoryModule.retrieveStockedQuantity(
870
- * inventoryItemId,
871
- * locationIds,
914
+ * const stockedQuantity =
915
+ * await inventoryModuleService.retrieveStockedQuantity(
916
+ * "iitem_123",
917
+ * ["loc_123", "loc_321"]
872
918
  * )
873
- *
874
- * // do something with the quantity or return it
875
- * }
876
919
  */
877
- retrieveStockedQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext): Promise<number>;
920
+ retrieveStockedQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise<number>;
878
921
  /**
879
- * This method is used to retrieve the reserved quantity of an inventory item within the specified locations.
922
+ * This method retrieves the reserved quantity of an inventory item in the specified location.
880
923
  *
881
- * @param {string} inventoryItemId - The ID of the inventory item to retrieve its reserved quantity.
882
- * @param {string[]} locationIds - The IDs of the locations to retrieve the reserved quantity from.
883
- * @param {SharedContext} context - A context used to share resources, such as transaction manager, between the application and the module.
884
- * @returns {Promise<number>} The reserved quantity of the inventory item in the specified locations.
924
+ * @param {string} inventoryItemId - The inventory item's ID.
925
+ * @param {string[]} locationIds - The locations' IDs.
926
+ * @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
927
+ * @returns {Promise<number>} The reserved quantity of the item.
885
928
  *
886
929
  * @example
887
- * import {
888
- * initialize as initializeInventoryModule,
889
- * } from "@medusajs/inventory"
890
- *
891
- * async function retrieveReservedQuantity (
892
- * inventoryItemId: string,
893
- * locationIds: string[],
894
- * ) {
895
- * const inventoryModule = await initializeInventoryModule({})
896
- *
897
- * const quantity = await inventoryModule.retrieveReservedQuantity(
898
- * inventoryItemId,
899
- * locationIds,
930
+ * const reservedQuantity =
931
+ * await inventoryModuleService.retrieveReservedQuantity(
932
+ * "iitem_123",
933
+ * ["loc_123", "loc_321"]
900
934
  * )
901
- *
902
- * // do something with the quantity or return it
903
- * }
904
935
  */
905
- retrieveReservedQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext): Promise<number>;
936
+ retrieveReservedQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise<number>;
906
937
  }
907
938
  //# sourceMappingURL=service.d.ts.map