@medusajs/order 0.1.3 → 1.0.0-rc-20241003153304

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. package/dist/index.d.ts +6 -8
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +4 -26
  4. package/dist/index.js.map +1 -1
  5. package/dist/joiner-config.d.ts +2 -5
  6. package/dist/joiner-config.d.ts.map +1 -0
  7. package/dist/joiner-config.js +21 -28
  8. package/dist/joiner-config.js.map +1 -1
  9. package/dist/migrations/Migration20240219102530.d.ts +1 -0
  10. package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240219102530.js +53 -19
  12. package/dist/migrations/Migration20240219102530.js.map +1 -1
  13. package/dist/migrations/Migration20240604100512.d.ts +5 -0
  14. package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240604100512.js +371 -0
  16. package/dist/migrations/Migration20240604100512.js.map +1 -0
  17. package/dist/migrations/Migration20240715102100.d.ts +5 -0
  18. package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
  19. package/dist/migrations/Migration20240715102100.js +15 -0
  20. package/dist/migrations/Migration20240715102100.js.map +1 -0
  21. package/dist/migrations/Migration20240715174100.d.ts +5 -0
  22. package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
  23. package/dist/migrations/Migration20240715174100.js +21 -0
  24. package/dist/migrations/Migration20240715174100.js.map +1 -0
  25. package/dist/migrations/Migration20240716081800.d.ts +5 -0
  26. package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
  27. package/dist/migrations/Migration20240716081800.js +67 -0
  28. package/dist/migrations/Migration20240716081800.js.map +1 -0
  29. package/dist/migrations/Migration20240801085921.d.ts +5 -0
  30. package/dist/migrations/Migration20240801085921.d.ts.map +1 -0
  31. package/dist/migrations/Migration20240801085921.js +30 -0
  32. package/dist/migrations/Migration20240801085921.js.map +1 -0
  33. package/dist/migrations/Migration20240821164505.d.ts +6 -0
  34. package/dist/migrations/Migration20240821164505.d.ts.map +1 -0
  35. package/dist/migrations/Migration20240821164505.js +26 -0
  36. package/dist/migrations/Migration20240821164505.js.map +1 -0
  37. package/dist/migrations/Migration20240821170920.d.ts +6 -0
  38. package/dist/migrations/Migration20240821170920.d.ts.map +1 -0
  39. package/dist/migrations/Migration20240821170920.js +18 -0
  40. package/dist/migrations/Migration20240821170920.js.map +1 -0
  41. package/dist/migrations/Migration20240827133639.d.ts +6 -0
  42. package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
  43. package/dist/migrations/Migration20240827133639.js +17 -0
  44. package/dist/migrations/Migration20240827133639.js.map +1 -0
  45. package/dist/migrations/Migration20240902195921.d.ts +6 -0
  46. package/dist/migrations/Migration20240902195921.d.ts.map +1 -0
  47. package/dist/migrations/Migration20240902195921.js +16 -0
  48. package/dist/migrations/Migration20240902195921.js.map +1 -0
  49. package/dist/migrations/Migration20240913092514.d.ts +6 -0
  50. package/dist/migrations/Migration20240913092514.d.ts.map +1 -0
  51. package/dist/migrations/Migration20240913092514.js +17 -0
  52. package/dist/migrations/Migration20240913092514.js.map +1 -0
  53. package/dist/models/address.d.ts +4 -3
  54. package/dist/models/address.d.ts.map +1 -0
  55. package/dist/models/address.js +22 -22
  56. package/dist/models/address.js.map +1 -1
  57. package/dist/models/adjustment-line.d.ts +5 -3
  58. package/dist/models/adjustment-line.d.ts.map +1 -0
  59. package/dist/models/adjustment-line.js +6 -1
  60. package/dist/models/adjustment-line.js.map +1 -1
  61. package/dist/models/claim-item-image.d.ts +19 -0
  62. package/dist/models/claim-item-image.d.ts.map +1 -0
  63. package/dist/models/claim-item-image.js +109 -0
  64. package/dist/models/claim-item-image.js.map +1 -0
  65. package/dist/models/claim-item.d.ts +29 -0
  66. package/dist/models/claim-item.d.ts.map +1 -0
  67. package/dist/models/claim-item.js +157 -0
  68. package/dist/models/claim-item.js.map +1 -0
  69. package/dist/models/claim.d.ts +37 -0
  70. package/dist/models/claim.d.ts.map +1 -0
  71. package/dist/models/claim.js +201 -0
  72. package/dist/models/claim.js.map +1 -0
  73. package/dist/models/exchange-item.d.ts +24 -0
  74. package/dist/models/exchange-item.d.ts.map +1 -0
  75. package/dist/models/exchange-item.js +138 -0
  76. package/dist/models/exchange-item.js.map +1 -0
  77. package/dist/models/exchange.d.ts +35 -0
  78. package/dist/models/exchange.d.ts.map +1 -0
  79. package/dist/models/exchange.js +194 -0
  80. package/dist/models/exchange.js.map +1 -0
  81. package/dist/models/index.d.ts +18 -9
  82. package/dist/models/index.d.ts.map +1 -0
  83. package/dist/models/index.js +26 -10
  84. package/dist/models/index.js.map +1 -1
  85. package/dist/models/line-item-adjustment.d.ts +5 -3
  86. package/dist/models/line-item-adjustment.d.ts.map +1 -0
  87. package/dist/models/line-item-adjustment.js +12 -12
  88. package/dist/models/line-item-adjustment.js.map +1 -1
  89. package/dist/models/line-item-tax-line.d.ts +5 -3
  90. package/dist/models/line-item-tax-line.d.ts.map +1 -0
  91. package/dist/models/line-item-tax-line.js +12 -12
  92. package/dist/models/line-item-tax-line.js.map +1 -1
  93. package/dist/models/line-item.d.ts +11 -8
  94. package/dist/models/line-item.d.ts.map +1 -0
  95. package/dist/models/line-item.js +58 -39
  96. package/dist/models/line-item.js.map +1 -1
  97. package/dist/models/order-change-action.d.ts +17 -6
  98. package/dist/models/order-change-action.d.ts.map +1 -0
  99. package/dist/models/order-change-action.js +110 -8
  100. package/dist/models/order-change-action.js.map +1 -1
  101. package/dist/models/order-change.d.ts +18 -6
  102. package/dist/models/order-change.d.ts.map +1 -0
  103. package/dist/models/order-change.js +108 -6
  104. package/dist/models/order-change.js.map +1 -1
  105. package/dist/models/order-item.d.ts +10 -7
  106. package/dist/models/order-item.d.ts.map +1 -0
  107. package/dist/models/order-item.js +29 -19
  108. package/dist/models/order-item.js.map +1 -1
  109. package/dist/models/order-shipping-method.d.ts +17 -7
  110. package/dist/models/order-shipping-method.d.ts.map +1 -0
  111. package/dist/models/order-shipping-method.js +113 -33
  112. package/dist/models/order-shipping-method.js.map +1 -1
  113. package/dist/models/order-summary.d.ts +7 -8
  114. package/dist/models/order-summary.d.ts.map +1 -0
  115. package/dist/models/order-summary.js +14 -10
  116. package/dist/models/order-summary.js.map +1 -1
  117. package/dist/models/order.d.ts +13 -11
  118. package/dist/models/order.d.ts.map +1 -0
  119. package/dist/models/order.js +12 -2
  120. package/dist/models/order.js.map +1 -1
  121. package/dist/models/return-item.d.ts +31 -0
  122. package/dist/models/return-item.d.ts.map +1 -0
  123. package/dist/models/return-item.js +180 -0
  124. package/dist/models/return-item.js.map +1 -0
  125. package/dist/models/return-reason.d.ts +22 -0
  126. package/dist/models/return-reason.d.ts.map +1 -0
  127. package/dist/models/return-reason.js +122 -0
  128. package/dist/models/return-reason.js.map +1 -0
  129. package/dist/models/return.d.ts +41 -0
  130. package/dist/models/return.d.ts.map +1 -0
  131. package/dist/models/return.js +227 -0
  132. package/dist/models/return.js.map +1 -0
  133. package/dist/models/shipping-method-adjustment.d.ts +5 -3
  134. package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
  135. package/dist/models/shipping-method-adjustment.js +12 -12
  136. package/dist/models/shipping-method-adjustment.js.map +1 -1
  137. package/dist/models/shipping-method-tax-line.d.ts +5 -3
  138. package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
  139. package/dist/models/shipping-method-tax-line.js +12 -12
  140. package/dist/models/shipping-method-tax-line.js.map +1 -1
  141. package/dist/models/shipping-method.d.ts +10 -7
  142. package/dist/models/shipping-method.d.ts.map +1 -0
  143. package/dist/models/shipping-method.js +42 -24
  144. package/dist/models/shipping-method.js.map +1 -1
  145. package/dist/models/tax-line.d.ts +4 -2
  146. package/dist/models/tax-line.d.ts.map +1 -0
  147. package/dist/models/tax-line.js +8 -1
  148. package/dist/models/tax-line.js.map +1 -1
  149. package/dist/models/transaction.d.ts +18 -6
  150. package/dist/models/transaction.d.ts.map +1 -0
  151. package/dist/models/transaction.js +133 -24
  152. package/dist/models/transaction.js.map +1 -1
  153. package/dist/repositories/claim.d.ts +9 -0
  154. package/dist/repositories/claim.d.ts.map +1 -0
  155. package/dist/repositories/claim.js +11 -0
  156. package/dist/repositories/claim.js.map +1 -0
  157. package/dist/repositories/exchange.d.ts +9 -0
  158. package/dist/repositories/exchange.d.ts.map +1 -0
  159. package/dist/repositories/exchange.js +11 -0
  160. package/dist/repositories/exchange.js.map +1 -0
  161. package/dist/repositories/index.d.ts +5 -2
  162. package/dist/repositories/index.d.ts.map +1 -0
  163. package/dist/repositories/index.js +8 -17
  164. package/dist/repositories/index.js.map +1 -1
  165. package/dist/repositories/order.d.ts +2 -4
  166. package/dist/repositories/order.d.ts.map +1 -0
  167. package/dist/repositories/order.js +3 -86
  168. package/dist/repositories/order.js.map +1 -1
  169. package/dist/repositories/return.d.ts +9 -0
  170. package/dist/repositories/return.d.ts.map +1 -0
  171. package/dist/repositories/return.js +11 -0
  172. package/dist/repositories/return.js.map +1 -0
  173. package/dist/schema/index.d.ts +3 -0
  174. package/dist/schema/index.d.ts.map +1 -0
  175. package/dist/schema/index.js +556 -0
  176. package/dist/schema/index.js.map +1 -0
  177. package/dist/services/actions/cancel-claim.d.ts +3 -0
  178. package/dist/services/actions/cancel-claim.d.ts.map +1 -0
  179. package/dist/services/actions/cancel-claim.js +85 -0
  180. package/dist/services/actions/cancel-claim.js.map +1 -0
  181. package/dist/services/actions/cancel-exchange.d.ts +3 -0
  182. package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
  183. package/dist/services/actions/cancel-exchange.js +71 -0
  184. package/dist/services/actions/cancel-exchange.js.map +1 -0
  185. package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
  186. package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
  187. package/dist/services/actions/cancel-fulfillment.js +31 -0
  188. package/dist/services/actions/cancel-fulfillment.js.map +1 -0
  189. package/dist/services/actions/cancel-return.d.ts +3 -0
  190. package/dist/services/actions/cancel-return.d.ts.map +1 -0
  191. package/dist/services/actions/cancel-return.js +69 -0
  192. package/dist/services/actions/cancel-return.js.map +1 -0
  193. package/dist/services/actions/create-claim.d.ts +3 -0
  194. package/dist/services/actions/create-claim.d.ts.map +1 -0
  195. package/dist/services/actions/create-claim.js +225 -0
  196. package/dist/services/actions/create-claim.js.map +1 -0
  197. package/dist/services/actions/create-exchange.d.ts +3 -0
  198. package/dist/services/actions/create-exchange.d.ts.map +1 -0
  199. package/dist/services/actions/create-exchange.js +191 -0
  200. package/dist/services/actions/create-exchange.js.map +1 -0
  201. package/dist/services/actions/create-return.d.ts +3 -0
  202. package/dist/services/actions/create-return.d.ts.map +1 -0
  203. package/dist/services/actions/create-return.js +100 -0
  204. package/dist/services/actions/create-return.js.map +1 -0
  205. package/dist/services/actions/index.d.ts +12 -0
  206. package/dist/services/actions/index.d.ts.map +1 -0
  207. package/dist/services/actions/index.js +28 -0
  208. package/dist/services/actions/index.js.map +1 -0
  209. package/dist/services/actions/receive-return.d.ts +3 -0
  210. package/dist/services/actions/receive-return.d.ts.map +1 -0
  211. package/dist/services/actions/receive-return.js +71 -0
  212. package/dist/services/actions/receive-return.js.map +1 -0
  213. package/dist/services/actions/register-delivery.d.ts +3 -0
  214. package/dist/services/actions/register-delivery.d.ts.map +1 -0
  215. package/dist/services/actions/register-delivery.js +29 -0
  216. package/dist/services/actions/register-delivery.js.map +1 -0
  217. package/dist/services/actions/register-fulfillment.d.ts +3 -0
  218. package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
  219. package/dist/services/actions/register-fulfillment.js +29 -0
  220. package/dist/services/actions/register-fulfillment.js.map +1 -0
  221. package/dist/services/actions/register-shipment.d.ts +3 -0
  222. package/dist/services/actions/register-shipment.d.ts.map +1 -0
  223. package/dist/services/actions/register-shipment.js +37 -0
  224. package/dist/services/actions/register-shipment.js.map +1 -0
  225. package/dist/services/index.d.ts +1 -1
  226. package/dist/services/index.d.ts.map +1 -0
  227. package/dist/services/index.js +1 -3
  228. package/dist/services/index.js.map +1 -1
  229. package/dist/services/order-module-service.d.ts +191 -109
  230. package/dist/services/order-module-service.d.ts.map +1 -0
  231. package/dist/services/order-module-service.js +1165 -425
  232. package/dist/services/order-module-service.js.map +1 -1
  233. package/dist/services/order-service.d.ts +6 -5
  234. package/dist/services/order-service.d.ts.map +1 -0
  235. package/dist/services/order-service.js +2 -2
  236. package/dist/services/order-service.js.map +1 -1
  237. package/dist/tsconfig.tsbuildinfo +1 -0
  238. package/dist/types/address.d.ts +2 -1
  239. package/dist/types/address.d.ts.map +1 -0
  240. package/dist/types/index.d.ts +5 -2
  241. package/dist/types/index.d.ts.map +1 -0
  242. package/dist/types/index.js +2 -0
  243. package/dist/types/index.js.map +1 -1
  244. package/dist/types/line-item-adjustment.d.ts +2 -1
  245. package/dist/types/line-item-adjustment.d.ts.map +1 -0
  246. package/dist/types/line-item-tax-line.d.ts +1 -0
  247. package/dist/types/line-item-tax-line.d.ts.map +1 -0
  248. package/dist/types/line-item.d.ts +2 -1
  249. package/dist/types/line-item.d.ts.map +1 -0
  250. package/dist/types/order-change.d.ts +4 -0
  251. package/dist/types/order-change.d.ts.map +1 -0
  252. package/dist/types/order-change.js +3 -0
  253. package/dist/types/order-change.js.map +1 -0
  254. package/dist/types/order-detail.d.ts +3 -2
  255. package/dist/types/order-detail.d.ts.map +1 -0
  256. package/dist/types/order.d.ts +4 -3
  257. package/dist/types/order.d.ts.map +1 -0
  258. package/dist/types/return-reason.d.ts +5 -0
  259. package/dist/types/return-reason.d.ts.map +1 -0
  260. package/dist/types/return-reason.js +3 -0
  261. package/dist/types/return-reason.js.map +1 -0
  262. package/dist/types/shipping-method-adjustment.d.ts +2 -1
  263. package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
  264. package/dist/types/shipping-method-tax-line.d.ts +1 -0
  265. package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
  266. package/dist/types/shipping-method.d.ts +5 -1
  267. package/dist/types/shipping-method.d.ts.map +1 -0
  268. package/dist/types/tax-line.d.ts +2 -1
  269. package/dist/types/tax-line.d.ts.map +1 -0
  270. package/dist/types/transaction.d.ts +2 -1
  271. package/dist/types/transaction.d.ts.map +1 -0
  272. package/dist/types/utils/index.d.ts +41 -23
  273. package/dist/types/utils/index.d.ts.map +1 -0
  274. package/dist/types/utils/index.js +0 -1
  275. package/dist/types/utils/index.js.map +1 -1
  276. package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
  277. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
  278. package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
  279. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
  280. package/dist/utils/actions/cancel-return.d.ts +1 -0
  281. package/dist/utils/actions/cancel-return.d.ts.map +1 -0
  282. package/dist/utils/actions/cancel-return.js +9 -16
  283. package/dist/utils/actions/cancel-return.js.map +1 -1
  284. package/dist/utils/actions/deliver-item.d.ts +2 -0
  285. package/dist/utils/actions/deliver-item.d.ts.map +1 -0
  286. package/dist/utils/actions/deliver-item.js +38 -0
  287. package/dist/utils/actions/deliver-item.js.map +1 -0
  288. package/dist/utils/actions/fulfill-item.d.ts +1 -0
  289. package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
  290. package/dist/utils/actions/fulfill-item.js +8 -12
  291. package/dist/utils/actions/fulfill-item.js.map +1 -1
  292. package/dist/utils/actions/index.d.ts +7 -1
  293. package/dist/utils/actions/index.d.ts.map +1 -0
  294. package/dist/utils/actions/index.js +6 -1
  295. package/dist/utils/actions/index.js.map +1 -1
  296. package/dist/utils/actions/item-add.d.ts +1 -0
  297. package/dist/utils/actions/item-add.d.ts.map +1 -0
  298. package/dist/utils/actions/item-add.js +17 -26
  299. package/dist/utils/actions/item-add.js.map +1 -1
  300. package/dist/utils/actions/item-remove.d.ts +1 -0
  301. package/dist/utils/actions/item-remove.d.ts.map +1 -0
  302. package/dist/utils/actions/item-remove.js +10 -30
  303. package/dist/utils/actions/item-remove.js.map +1 -1
  304. package/dist/utils/actions/item-update.d.ts +2 -0
  305. package/dist/utils/actions/item-update.d.ts.map +1 -0
  306. package/dist/utils/actions/item-update.js +37 -0
  307. package/dist/utils/actions/item-update.js.map +1 -0
  308. package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
  309. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
  310. package/dist/utils/actions/receive-damaged-return-item.js +11 -37
  311. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  312. package/dist/utils/actions/receive-return-item.d.ts +1 -0
  313. package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
  314. package/dist/utils/actions/receive-return-item.js +9 -38
  315. package/dist/utils/actions/receive-return-item.js.map +1 -1
  316. package/dist/utils/actions/reinstate-item.d.ts +2 -0
  317. package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
  318. package/dist/utils/actions/reinstate-item.js +32 -0
  319. package/dist/utils/actions/reinstate-item.js.map +1 -0
  320. package/dist/utils/actions/return-item.d.ts +1 -0
  321. package/dist/utils/actions/return-item.d.ts.map +1 -0
  322. package/dist/utils/actions/return-item.js +10 -15
  323. package/dist/utils/actions/return-item.js.map +1 -1
  324. package/dist/utils/actions/ship-item.d.ts +1 -0
  325. package/dist/utils/actions/ship-item.d.ts.map +1 -0
  326. package/dist/utils/actions/ship-item.js +8 -12
  327. package/dist/utils/actions/ship-item.js.map +1 -1
  328. package/dist/utils/actions/shipping-add.d.ts +1 -0
  329. package/dist/utils/actions/shipping-add.d.ts.map +1 -0
  330. package/dist/utils/actions/shipping-add.js +18 -18
  331. package/dist/utils/actions/shipping-add.js.map +1 -1
  332. package/dist/utils/actions/shipping-remove.d.ts +2 -0
  333. package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
  334. package/dist/utils/actions/shipping-remove.js +22 -0
  335. package/dist/utils/actions/shipping-remove.js.map +1 -0
  336. package/dist/utils/actions/write-off-item.d.ts +1 -0
  337. package/dist/utils/actions/write-off-item.d.ts.map +1 -0
  338. package/dist/utils/actions/write-off-item.js +8 -12
  339. package/dist/utils/actions/write-off-item.js.map +1 -1
  340. package/dist/utils/apply-order-changes.d.ts +18 -0
  341. package/dist/utils/apply-order-changes.d.ts.map +1 -0
  342. package/dist/utils/apply-order-changes.js +98 -0
  343. package/dist/utils/apply-order-changes.js.map +1 -0
  344. package/dist/utils/base-repository-find.d.ts +3 -0
  345. package/dist/utils/base-repository-find.d.ts.map +1 -0
  346. package/dist/utils/base-repository-find.js +154 -0
  347. package/dist/utils/base-repository-find.js.map +1 -0
  348. package/dist/utils/calculate-order-change.d.ts +12 -6
  349. package/dist/utils/calculate-order-change.d.ts.map +1 -0
  350. package/dist/utils/calculate-order-change.js +56 -187
  351. package/dist/utils/calculate-order-change.js.map +1 -1
  352. package/dist/utils/index.d.ts +4 -1
  353. package/dist/utils/index.d.ts.map +1 -0
  354. package/dist/utils/index.js +3 -1
  355. package/dist/utils/index.js.map +1 -1
  356. package/dist/utils/set-action-reference.d.ts +2 -0
  357. package/dist/utils/set-action-reference.d.ts.map +1 -0
  358. package/dist/utils/set-action-reference.js +10 -0
  359. package/dist/utils/set-action-reference.js.map +1 -0
  360. package/dist/utils/transform-order.d.ts +5 -4
  361. package/dist/utils/transform-order.d.ts.map +1 -0
  362. package/dist/utils/transform-order.js +138 -21
  363. package/dist/utils/transform-order.js.map +1 -1
  364. package/package.json +25 -26
  365. package/dist/module-definition.d.ts +0 -2
  366. package/dist/module-definition.js +0 -59
  367. package/dist/module-definition.js.map +0 -1
  368. package/dist/scripts/bin/run-seed.d.ts +0 -3
  369. package/dist/scripts/bin/run-seed.js +0 -49
  370. package/dist/scripts/bin/run-seed.js.map +0 -1
  371. package/dist/services/order-change-service.d.ts +0 -15
  372. package/dist/services/order-change-service.js +0 -96
  373. package/dist/services/order-change-service.js.map +0 -1
  374. package/dist/utils/action-key.d.ts +0 -13
  375. package/dist/utils/action-key.js +0 -18
  376. package/dist/utils/action-key.js.map +0 -1
  377. package/dist/utils/actions/cancel.d.ts +0 -1
  378. package/dist/utils/actions/cancel.js +0 -8
  379. package/dist/utils/actions/cancel.js.map +0 -1
@@ -1 +1 @@
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,EAAE,IAAI,CAAC,eAAe,EAAE;KAC9B,CAAA;AACH,CAAC"}
@@ -1,3 +1,6 @@
1
- export * from "./action-key";
2
1
  export * from "./actions";
2
+ export * from "./apply-order-changes";
3
3
  export * from "./calculate-order-change";
4
+ export * from "./set-action-reference";
5
+ export * from "./transform-order";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./action-key"), exports);
18
17
  __exportStar(require("./actions"), exports);
18
+ __exportStar(require("./apply-order-changes"), exports);
19
19
  __exportStar(require("./calculate-order-change"), exports);
20
+ __exportStar(require("./set-action-reference"), exports);
21
+ __exportStar(require("./transform-order"), exports);
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,4CAAyB;AACzB,2DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,wDAAqC;AACrC,2DAAwC;AACxC,yDAAsC;AACtC,oDAAiC"}
@@ -0,0 +1,2 @@
1
+ export declare function setActionReference(existing: any, action: any, options: any): void;
2
+ //# sourceMappingURL=set-action-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-action-reference.d.ts","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,MAAM,KAAA,EAAE,OAAO,KAAA,QAK3D"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setActionReference = setActionReference;
4
+ function setActionReference(existing, action, options) {
5
+ if (options?.addActionReferenceToObject) {
6
+ existing.actions ??= [];
7
+ existing.actions.push(action);
8
+ }
9
+ }
10
+ //# sourceMappingURL=set-action-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-action-reference.js","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":";;AAAA,gDAKC;AALD,SAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IAC1D,IAAI,OAAO,EAAE,0BAA0B,EAAE,CAAC;QACxC,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAA;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC"}
@@ -1,5 +1,6 @@
1
- import { OrderTypes } from "@medusajs/types";
2
- export declare function formatOrder(order: any, options: {
1
+ export declare function formatOrder<T = any>(order: any, options: {
2
+ entity: any;
3
3
  includeTotals?: boolean;
4
- }): OrderTypes.OrderDTO | OrderTypes.OrderDTO[];
5
- export declare function mapRepositoryToOrderModel(config: any): any;
4
+ }): T;
5
+ export declare function mapRepositoryToOrderModel(config: any, isRelatedEntity?: boolean): any;
6
+ //# sourceMappingURL=transform-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-order.d.ts","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":"AAUA,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EACjC,KAAK,KAAA,EACL,OAAO,EAAE;IACP,MAAM,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GACA,CAAC,CAkFH;AAwFD,wBAAgB,yBAAyB,CAAC,MAAM,KAAA,EAAE,eAAe,UAAQ,OAwExE"}
@@ -1,12 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapRepositoryToOrderModel = exports.formatOrder = void 0;
4
- const utils_1 = require("@medusajs/utils");
3
+ exports.formatOrder = formatOrder;
4
+ exports.mapRepositoryToOrderModel = mapRepositoryToOrderModel;
5
+ const utils_1 = require("@medusajs/framework/utils");
6
+ // Reshape the order object to match the OrderDTO
7
+ // This function is used to format the order object before returning to the main module methods
5
8
  function formatOrder(order, options) {
6
9
  const isArray = Array.isArray(order);
7
10
  const orders = [...(isArray ? order : [order])];
8
11
  orders.map((order) => {
9
- order.items = order.items?.map((orderItem) => {
12
+ let mainOrder = order;
13
+ const isRelatedEntity = options?.entity?.name !== "Order";
14
+ // If the entity is a related entity, the original order is located in the order property
15
+ if (isRelatedEntity) {
16
+ if (!order.order) {
17
+ return order;
18
+ }
19
+ mainOrder = order.order;
20
+ }
21
+ mainOrder.items = mainOrder.items?.map((orderItem) => {
22
+ const isFormatted = (0, utils_1.isDefined)(orderItem.detail?.fulfilled_quantity);
23
+ if (isFormatted) {
24
+ return orderItem;
25
+ }
10
26
  const detail = { ...orderItem };
11
27
  delete detail.order;
12
28
  delete detail.item;
@@ -17,26 +33,108 @@ function formatOrder(order, options) {
17
33
  detail,
18
34
  };
19
35
  });
20
- order.shipping_methods = order.shipping_methods?.map((shippingMethod) => {
21
- const sm = { ...shippingMethod.shipping_method };
22
- delete shippingMethod.shipping_method;
23
- return {
24
- ...sm,
25
- order_id: shippingMethod.order_id,
26
- detail: {
27
- ...shippingMethod,
28
- },
29
- };
30
- });
31
- order.summary = order.summary?.[0]?.totals;
32
- return options?.includeTotals
33
- ? (0, utils_1.createRawPropertiesFromBigNumber)((0, utils_1.decorateCartTotals)(order))
34
- : order;
36
+ if (isRelatedEntity) {
37
+ if (order.return) {
38
+ formatOrderReturn(order.return, mainOrder);
39
+ }
40
+ const entityName = options.entity.name;
41
+ if (entityName === "OrderClaim") {
42
+ formatClaim(order);
43
+ }
44
+ else if (entityName === "OrderExchange") {
45
+ formatExchange(order);
46
+ }
47
+ else if (entityName === "Return") {
48
+ formatReturn(order);
49
+ }
50
+ }
51
+ if (order.shipping_methods) {
52
+ order.shipping_methods = order.shipping_methods?.map((shippingMethod) => {
53
+ if (shippingMethod.detail) {
54
+ return shippingMethod;
55
+ }
56
+ const sm = { ...shippingMethod.shipping_method };
57
+ delete shippingMethod.shipping_method;
58
+ cleanNestedRelations(shippingMethod);
59
+ return {
60
+ ...sm,
61
+ order_id: shippingMethod.order_id,
62
+ detail: {
63
+ ...shippingMethod,
64
+ },
65
+ };
66
+ });
67
+ }
68
+ if (mainOrder.summary) {
69
+ mainOrder.summary = mainOrder.summary?.[0]?.totals;
70
+ }
71
+ return (0, utils_1.createRawPropertiesFromBigNumber)(options?.includeTotals ? (0, utils_1.decorateCartTotals)(order) : order);
35
72
  });
36
73
  return isArray ? orders : orders[0];
37
74
  }
38
- exports.formatOrder = formatOrder;
39
- function mapRepositoryToOrderModel(config) {
75
+ function cleanNestedRelations(obj) {
76
+ if (!(0, utils_1.isObject)(obj)) {
77
+ return;
78
+ }
79
+ const obj_ = obj;
80
+ delete obj_.order;
81
+ delete obj_.return;
82
+ delete obj_.claim;
83
+ delete obj_.exchange;
84
+ }
85
+ function formatOrderReturn(orderReturn, mainOrder) {
86
+ orderReturn.items?.forEach((orderItem) => {
87
+ const item = mainOrder.items?.find((item) => item.id === orderItem.item_id);
88
+ orderItem.detail = item?.detail;
89
+ });
90
+ }
91
+ function formatClaim(claim) {
92
+ if (claim.additional_items) {
93
+ claim.additional_items = claim.additional_items.filter((item) => item.is_additional_item);
94
+ claim.additional_items.forEach((orderItem) => {
95
+ const item = claim.order.items?.find((item) => item.id === orderItem.item_id);
96
+ cleanNestedRelations(item);
97
+ orderItem.detail = item?.detail;
98
+ });
99
+ }
100
+ if (!claim.claim_items) {
101
+ return;
102
+ }
103
+ claim.claim_items = claim.claim_items.filter((item) => !item.is_additional_item);
104
+ claim.claim_items.forEach((orderItem) => {
105
+ const item = claim.order.items?.find((item) => item.id === orderItem.item_id);
106
+ cleanNestedRelations(item);
107
+ orderItem.detail = item?.detail;
108
+ });
109
+ }
110
+ function formatExchange(exchange) {
111
+ if (!exchange.additional_items) {
112
+ return;
113
+ }
114
+ exchange.additional_items.forEach((orderItem) => {
115
+ const item = exchange.order.items?.find((item) => item.id === orderItem.item_id);
116
+ cleanNestedRelations(item);
117
+ orderItem.detail = item?.detail;
118
+ });
119
+ }
120
+ function formatReturn(returnOrder) {
121
+ if (!returnOrder.items) {
122
+ return;
123
+ }
124
+ returnOrder.items.forEach((orderItem) => {
125
+ const item = returnOrder.order.items?.find((item) => item.id === orderItem.item_id);
126
+ cleanNestedRelations(item);
127
+ orderItem.detail = item?.detail;
128
+ });
129
+ }
130
+ // Map the public order model to the repository model format
131
+ // As the public responses have a different shape than the repository responses, this function is used to map the public properties to the internal db entities
132
+ // e.g "items" is the relation between "line-item" and "order" + "version", The line item itself is in "items.item"
133
+ // This helper maps to the correct repository to query the DB, and the function "formatOrder" remap the response to the public shape
134
+ function mapRepositoryToOrderModel(config, isRelatedEntity = false) {
135
+ if (isRelatedEntity) {
136
+ return mapRepositoryToRelatedEntity(config);
137
+ }
40
138
  const conf = { ...config };
41
139
  function replace(obj, type) {
42
140
  if (!(0, utils_1.isDefined)(obj[type])) {
@@ -93,5 +191,24 @@ function mapRepositoryToOrderModel(config) {
93
191
  }
94
192
  return conf;
95
193
  }
96
- exports.mapRepositoryToOrderModel = mapRepositoryToOrderModel;
194
+ // This function has the same purpose as "mapRepositoryToOrderModel" but for returns, claims and exchanges
195
+ function mapRepositoryToRelatedEntity(config) {
196
+ const conf = { ...config };
197
+ function replace(obj, type) {
198
+ if (!(0, utils_1.isDefined)(obj[type])) {
199
+ return;
200
+ }
201
+ return (0, utils_1.deduplicate)(obj[type].sort().map((rel) => {
202
+ if (rel.includes("shipping_methods") &&
203
+ !rel.includes("shipping_methods.shipping_method")) {
204
+ obj.populate.push("shipping_methods.shipping_method");
205
+ return rel.replace("shipping_methods", "shipping_methods.shipping_method");
206
+ }
207
+ return rel;
208
+ }));
209
+ }
210
+ conf.options.fields = replace(config.options, "fields");
211
+ conf.options.populate = replace(config.options, "populate");
212
+ return conf;
213
+ }
97
214
  //# sourceMappingURL=transform-order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform-order.js","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":";;;AACA,2CAKwB;AAExB,SAAgB,WAAW,CACzB,KAAK,EACL,OAEC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAE/C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACnB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YAC3C,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,EAAE,CAAA;YAC/B,OAAO,MAAM,CAAC,KAAK,CAAA;YACnB,OAAO,MAAM,CAAC,IAAI,CAAA;YAElB,OAAO;gBACL,GAAG,SAAS,CAAC,IAAI;gBACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,MAAM;aACP,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;YACtE,MAAM,EAAE,GAAG,EAAE,GAA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AC,IAAA,iBAAS,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC1B,OAAM;QACR,CAAC;QAED,OAAO,IAAA,mBAAW,EAChB,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAC3B,IACE,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC;gBAChC,CAAC,GAAG,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EACjD,CAAC;gBACD,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;gBAErD,OAAO,GAAG,CAAC,OAAO,CAChB,kBAAkB,EAClB,kCAAkC,CACnC,CAAA;YACH,CAAC;YACD,OAAO,GAAG,CAAA;QACZ,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACvD,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAE3D,OAAO,IAAI,CAAA;AACb,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@medusajs/order",
3
- "version": "0.1.3",
3
+ "version": "1.0.0-rc-20241003153304",
4
4
  "description": "Medusa Order module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
- "dist"
8
+ "dist",
9
+ "!dist/**/__tests__",
10
+ "!dist/**/__mocks__",
11
+ "!dist/**/__fixtures__"
9
12
  ],
10
13
  "engines": {
11
- "node": ">=16"
12
- },
13
- "bin": {
14
- "medusa-order-seed": "dist/scripts/bin/run-seed.js"
14
+ "node": ">=20"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
@@ -26,36 +26,35 @@
26
26
  "scripts": {
27
27
  "watch": "tsc --build --watch",
28
28
  "watch:test": "tsc --build tsconfig.spec.json --watch",
29
- "prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json",
30
- "build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
29
+ "resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
30
+ "build": "rimraf dist && tsc --build && npm run resolve:aliases",
31
31
  "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
32
32
  "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
33
- "migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
34
- "migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial",
35
- "migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create",
36
- "migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:up",
37
- "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
33
+ "migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:generate",
34
+ "migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial",
35
+ "migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create",
36
+ "migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up",
37
+ "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear"
38
38
  },
39
39
  "devDependencies": {
40
+ "@medusajs/framework": "1.0.0-rc-20241003153304",
40
41
  "@mikro-orm/cli": "5.9.7",
41
- "cross-env": "^5.2.1",
42
- "jest": "^29.6.3",
43
- "medusa-test-utils": "^1.1.45",
42
+ "@mikro-orm/core": "5.9.7",
43
+ "@mikro-orm/migrations": "5.9.7",
44
+ "@mikro-orm/postgresql": "5.9.7",
45
+ "@swc/core": "^1.7.28",
46
+ "@swc/jest": "^0.2.36",
47
+ "jest": "^29.7.0",
48
+ "medusa-test-utils": "2.0.0-rc-20241003153304",
44
49
  "rimraf": "^3.0.2",
45
- "ts-jest": "^29.1.1",
46
- "ts-node": "^10.9.1",
47
50
  "tsc-alias": "^1.8.6",
48
- "typescript": "^5.1.6"
51
+ "typescript": "^5.6.2"
49
52
  },
50
- "dependencies": {
51
- "@medusajs/modules-sdk": "^1.12.12",
52
- "@medusajs/types": "^1.11.17",
53
- "@medusajs/utils": "^1.11.10",
53
+ "peerDependencies": {
54
+ "@medusajs/framework": "1.0.0-rc-20241003153304",
54
55
  "@mikro-orm/core": "5.9.7",
55
56
  "@mikro-orm/migrations": "5.9.7",
56
57
  "@mikro-orm/postgresql": "5.9.7",
57
- "awilix": "^8.0.0",
58
- "dotenv": "^16.4.5",
59
- "knex": "2.4.2"
58
+ "awilix": "^8.0.1"
60
59
  }
61
60
  }
@@ -1,2 +0,0 @@
1
- import { ModuleExports } from "@medusajs/types";
2
- export declare const moduleDefinition: ModuleExports;
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.moduleDefinition = void 0;
27
- const modules_sdk_1 = require("@medusajs/modules-sdk");
28
- const utils_1 = require("@medusajs/utils");
29
- const Models = __importStar(require("./models"));
30
- const ModuleModels = __importStar(require("./models"));
31
- const ModuleRepositories = __importStar(require("./repositories"));
32
- const ModuleServices = __importStar(require("./services"));
33
- const _services_1 = require("./services");
34
- const migrationScriptOptions = {
35
- moduleName: modules_sdk_1.Modules.ORDER,
36
- models: Models,
37
- pathToMigrations: __dirname + "/migrations",
38
- };
39
- const runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
40
- const revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
41
- const containerLoader = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
42
- moduleModels: ModuleModels,
43
- moduleRepositories: ModuleRepositories,
44
- moduleServices: ModuleServices,
45
- });
46
- const connectionLoader = utils_1.ModulesSdkUtils.mikroOrmConnectionLoaderFactory({
47
- moduleName: modules_sdk_1.Modules.ORDER,
48
- moduleModels: Object.values(Models),
49
- migrationsPath: __dirname + "/migrations",
50
- });
51
- const service = _services_1.OrderModuleService;
52
- const loaders = [containerLoader, connectionLoader];
53
- exports.moduleDefinition = {
54
- service,
55
- loaders,
56
- revertMigration,
57
- runMigrations,
58
- };
59
- //# sourceMappingURL=module-definition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module-definition.js","sourceRoot":"","sources":["../src/module-definition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAE/C,2CAAiD;AACjD,gDAAiC;AACjC,sDAAuC;AACvC,kEAAmD;AACnD,0DAA2C;AAC3C,yCAA8C;AAE9C,MAAM,sBAAsB,GAAG;IAC7B,UAAU,EAAE,qBAAO,CAAC,KAAK;IACzB,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,SAAS,GAAG,aAAa;CAC5C,CAAA;AAED,MAAM,aAAa,GAAG,uBAAe,CAAC,oBAAoB,CACxD,sBAAsB,CACvB,CAAA;AAED,MAAM,eAAe,GAAG,uBAAe,CAAC,0BAA0B,CAChE,sBAAsB,CACvB,CAAA;AAED,MAAM,eAAe,GAAG,uBAAe,CAAC,4BAA4B,CAAC;IACnE,YAAY,EAAE,YAAY;IAC1B,kBAAkB,EAAE,kBAAkB;IACtC,cAAc,EAAE,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,uBAAe,CAAC,+BAA+B,CAAC;IACvE,UAAU,EAAE,qBAAO,CAAC,KAAK;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACnC,cAAc,EAAE,SAAS,GAAG,aAAa;CAC1C,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,8BAAkB,CAAA;AAClC,MAAM,OAAO,GAAG,CAAC,eAAe,EAAE,gBAAgB,CAAQ,CAAA;AAE7C,QAAA,gBAAgB,GAAkB;IAC7C,OAAO;IACP,OAAO;IACP,eAAe;IACf,aAAa;CACd,CAAA"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- declare const _default: Promise<void>;
3
- export default _default;
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- const modules_sdk_1 = require("@medusajs/modules-sdk");
28
- const utils_1 = require("@medusajs/utils");
29
- const Models = __importStar(require("../../models"));
30
- const os_1 = require("os");
31
- const args = process.argv;
32
- const path = args.pop();
33
- exports.default = (async () => {
34
- const { config } = await Promise.resolve().then(() => __importStar(require("dotenv")));
35
- config();
36
- if (!path) {
37
- throw new Error(`filePath is required.${os_1.EOL}Example: medusa-order-seed <filePath>`);
38
- }
39
- const run = utils_1.ModulesSdkUtils.buildSeedScript({
40
- moduleName: modules_sdk_1.Modules.ORDER,
41
- models: Models,
42
- pathToMigrations: __dirname + "/../../migrations",
43
- seedHandler: async ({ manager, data }) => {
44
- // TODO: Add seed logic
45
- },
46
- });
47
- await run({ path });
48
- })();
49
- //# sourceMappingURL=run-seed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-seed.js","sourceRoot":"","sources":["../../../src/scripts/bin/run-seed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uDAA+C;AAC/C,2CAAiD;AACjD,gDAAiC;AACjC,2BAAwB;AAExB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACzB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAY,CAAA;AAEjC,kBAAe,CAAC,KAAK,IAAI,EAAE;IACzB,MAAM,EAAE,MAAM,EAAE,GAAG,wDAAa,QAAQ,GAAC,CAAA;IACzC,MAAM,EAAE,CAAA;IACR,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAG,uCAAuC,CACnE,CAAA;KACF;IAED,MAAM,GAAG,GAAG,uBAAe,CAAC,eAAe,CAAC;QAC1C,UAAU,EAAE,qBAAO,CAAC,KAAK;QACzB,MAAM,EAAE,MAAM;QACd,gBAAgB,EAAE,SAAS,GAAG,mBAAmB;QACjD,WAAW,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,uBAAuB;QACzB,CAAC;KACF,CAAC,CAAA;IACF,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AACrB,CAAC,CAAC,EAAE,CAAA"}
@@ -1,15 +0,0 @@
1
- import { Context, DAL, FindConfig, OrderTypes, RepositoryService } from "@medusajs/types";
2
- import { OrderChange } from "../models";
3
- type InjectedDependencies = {
4
- orderChangeRepository: DAL.RepositoryService;
5
- };
6
- declare const OrderChangeService_base: new <TEntity_1 extends object = any>(container: InjectedDependencies) => import("@medusajs/types").InternalModuleService<TEntity_1, InjectedDependencies>;
7
- export default class OrderChangeService<TEntity extends OrderChange = OrderChange> extends OrderChangeService_base<TEntity> {
8
- protected readonly orderChangeRepository_: RepositoryService<TEntity>;
9
- constructor(container: InjectedDependencies);
10
- listCurrentOrderChange<TEntityMethod = OrderTypes.OrderDTO>(orderId: string | string[], config?: FindConfig<TEntityMethod>, sharedContext?: Context): Promise<TEntity[]>;
11
- isActive(orderChange: OrderChange): boolean;
12
- create(data: Partial<TEntity>[], sharedContext?: Context): Promise<TEntity[]>;
13
- create(data: Partial<TEntity>, sharedContext?: Context): Promise<TEntity>;
14
- }
15
- export {};