@medusajs/order 0.1.3-snapshot-20240718073308 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. package/dist/index.d.ts +8 -6
  2. package/dist/index.js +26 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/joiner-config.d.ts +5 -0
  5. package/dist/joiner-config.js +36 -0
  6. package/dist/joiner-config.js.map +1 -0
  7. package/dist/migrations/Migration20240219102530.d.ts +0 -1
  8. package/dist/migrations/Migration20240219102530.js +4 -38
  9. package/dist/migrations/Migration20240219102530.js.map +1 -1
  10. package/dist/models/address.d.ts +1 -2
  11. package/dist/models/adjustment-line.d.ts +1 -3
  12. package/dist/models/adjustment-line.js +0 -5
  13. package/dist/models/adjustment-line.js.map +1 -1
  14. package/dist/models/index.d.ts +0 -9
  15. package/dist/models/index.js +1 -17
  16. package/dist/models/index.js.map +1 -1
  17. package/dist/models/line-item-adjustment.d.ts +1 -3
  18. package/dist/models/line-item-adjustment.js +3 -3
  19. package/dist/models/line-item-adjustment.js.map +1 -1
  20. package/dist/models/line-item-tax-line.d.ts +1 -3
  21. package/dist/models/line-item-tax-line.js +3 -3
  22. package/dist/models/line-item-tax-line.js.map +1 -1
  23. package/dist/models/line-item.d.ts +1 -3
  24. package/dist/models/line-item.js +4 -18
  25. package/dist/models/line-item.js.map +1 -1
  26. package/dist/models/order-change-action.d.ts +4 -15
  27. package/dist/models/order-change-action.js +7 -102
  28. package/dist/models/order-change-action.js.map +1 -1
  29. package/dist/models/order-change.d.ts +5 -17
  30. package/dist/models/order-change.js +4 -109
  31. package/dist/models/order-change.js.map +1 -1
  32. package/dist/models/order-item.d.ts +4 -5
  33. package/dist/models/order-item.js +13 -13
  34. package/dist/models/order-item.js.map +1 -1
  35. package/dist/models/order-shipping-method.d.ts +4 -14
  36. package/dist/models/order-shipping-method.js +13 -89
  37. package/dist/models/order-shipping-method.js.map +1 -1
  38. package/dist/models/order-summary.d.ts +2 -6
  39. package/dist/models/order-summary.js +6 -9
  40. package/dist/models/order-summary.js.map +1 -1
  41. package/dist/models/order.d.ts +4 -6
  42. package/dist/models/order.js +1 -11
  43. package/dist/models/order.js.map +1 -1
  44. package/dist/models/shipping-method-adjustment.d.ts +1 -3
  45. package/dist/models/shipping-method-adjustment.js +3 -3
  46. package/dist/models/shipping-method-adjustment.js.map +1 -1
  47. package/dist/models/shipping-method-tax-line.d.ts +1 -3
  48. package/dist/models/shipping-method-tax-line.js +3 -3
  49. package/dist/models/shipping-method-tax-line.js.map +1 -1
  50. package/dist/models/shipping-method.d.ts +0 -2
  51. package/dist/models/shipping-method.js +4 -17
  52. package/dist/models/shipping-method.js.map +1 -1
  53. package/dist/models/tax-line.d.ts +0 -2
  54. package/dist/models/tax-line.js +0 -7
  55. package/dist/models/tax-line.js.map +1 -1
  56. package/dist/models/transaction.d.ts +3 -15
  57. package/dist/models/transaction.js +4 -109
  58. package/dist/models/transaction.js.map +1 -1
  59. package/dist/module-definition.d.ts +2 -0
  60. package/dist/module-definition.js +59 -0
  61. package/dist/module-definition.js.map +1 -0
  62. package/dist/repositories/index.d.ts +1 -4
  63. package/dist/repositories/index.js +16 -7
  64. package/dist/repositories/index.js.map +1 -1
  65. package/dist/repositories/order.d.ts +3 -1
  66. package/dist/repositories/order.js +85 -2
  67. package/dist/repositories/order.js.map +1 -1
  68. package/dist/scripts/bin/run-seed.d.ts +3 -0
  69. package/dist/scripts/bin/run-seed.js +49 -0
  70. package/dist/scripts/bin/run-seed.js.map +1 -0
  71. package/dist/services/index.d.ts +1 -1
  72. package/dist/services/index.js +3 -1
  73. package/dist/services/index.js.map +1 -1
  74. package/dist/services/order-change-service.d.ts +15 -0
  75. package/dist/services/order-change-service.js +96 -0
  76. package/dist/services/order-change-service.js.map +1 -0
  77. package/dist/services/order-module-service.d.ts +67 -138
  78. package/dist/services/order-module-service.js +240 -990
  79. package/dist/services/order-module-service.js.map +1 -1
  80. package/dist/services/order-service.d.ts +4 -5
  81. package/dist/services/order-service.js +1 -1
  82. package/dist/services/order-service.js.map +1 -1
  83. package/dist/types/address.d.ts +0 -1
  84. package/dist/types/index.d.ts +1 -3
  85. package/dist/types/index.js +0 -1
  86. package/dist/types/index.js.map +1 -1
  87. package/dist/types/line-item-adjustment.d.ts +0 -1
  88. package/dist/types/line-item-tax-line.d.ts +0 -1
  89. package/dist/types/line-item.d.ts +0 -1
  90. package/dist/types/order-detail.d.ts +1 -2
  91. package/dist/types/order.d.ts +2 -3
  92. package/dist/types/shipping-method-adjustment.d.ts +0 -1
  93. package/dist/types/shipping-method-tax-line.d.ts +0 -1
  94. package/dist/types/shipping-method.d.ts +0 -4
  95. package/dist/types/tax-line.d.ts +0 -1
  96. package/dist/types/transaction.d.ts +0 -1
  97. package/dist/types/utils/index.d.ts +11 -43
  98. package/dist/types/utils/index.js.map +1 -1
  99. package/dist/utils/action-key.d.ts +13 -0
  100. package/dist/utils/action-key.js +18 -0
  101. package/dist/utils/action-key.js.map +1 -0
  102. package/dist/utils/actions/cancel-return.d.ts +0 -1
  103. package/dist/utils/actions/cancel-return.js +6 -7
  104. package/dist/utils/actions/cancel-return.js.map +1 -1
  105. package/dist/utils/actions/cancel.d.ts +0 -1
  106. package/dist/utils/actions/cancel.js +2 -2
  107. package/dist/utils/actions/cancel.js.map +1 -1
  108. package/dist/utils/actions/fulfill-item.d.ts +0 -1
  109. package/dist/utils/actions/fulfill-item.js +6 -7
  110. package/dist/utils/actions/fulfill-item.js.map +1 -1
  111. package/dist/utils/actions/index.d.ts +0 -4
  112. package/dist/utils/actions/index.js +0 -3
  113. package/dist/utils/actions/index.js.map +1 -1
  114. package/dist/utils/actions/item-add.d.ts +0 -1
  115. package/dist/utils/actions/item-add.js +14 -17
  116. package/dist/utils/actions/item-add.js.map +1 -1
  117. package/dist/utils/actions/item-remove.d.ts +0 -1
  118. package/dist/utils/actions/item-remove.js +10 -11
  119. package/dist/utils/actions/item-remove.js.map +1 -1
  120. package/dist/utils/actions/receive-damaged-return-item.d.ts +0 -1
  121. package/dist/utils/actions/receive-damaged-return-item.js +7 -8
  122. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  123. package/dist/utils/actions/receive-return-item.d.ts +0 -1
  124. package/dist/utils/actions/receive-return-item.js +7 -8
  125. package/dist/utils/actions/receive-return-item.js.map +1 -1
  126. package/dist/utils/actions/return-item.d.ts +0 -1
  127. package/dist/utils/actions/return-item.js +8 -9
  128. package/dist/utils/actions/return-item.js.map +1 -1
  129. package/dist/utils/actions/ship-item.d.ts +0 -1
  130. package/dist/utils/actions/ship-item.js +6 -7
  131. package/dist/utils/actions/ship-item.js.map +1 -1
  132. package/dist/utils/actions/shipping-add.d.ts +0 -1
  133. package/dist/utils/actions/shipping-add.js +7 -16
  134. package/dist/utils/actions/shipping-add.js.map +1 -1
  135. package/dist/utils/actions/write-off-item.d.ts +0 -1
  136. package/dist/utils/actions/write-off-item.js +6 -7
  137. package/dist/utils/actions/write-off-item.js.map +1 -1
  138. package/dist/utils/calculate-order-change.d.ts +2 -11
  139. package/dist/utils/calculate-order-change.js +70 -68
  140. package/dist/utils/calculate-order-change.js.map +1 -1
  141. package/dist/utils/index.d.ts +1 -4
  142. package/dist/utils/index.js +1 -3
  143. package/dist/utils/index.js.map +1 -1
  144. package/dist/utils/transform-order.d.ts +2 -4
  145. package/dist/utils/transform-order.js +17 -131
  146. package/dist/utils/transform-order.js.map +1 -1
  147. package/package.json +14 -8
  148. package/dist/index.d.ts.map +0 -1
  149. package/dist/migrations/Migration20240219102530.d.ts.map +0 -1
  150. package/dist/migrations/Migration20240604100512.d.ts +0 -5
  151. package/dist/migrations/Migration20240604100512.d.ts.map +0 -1
  152. package/dist/migrations/Migration20240604100512.js +0 -364
  153. package/dist/migrations/Migration20240604100512.js.map +0 -1
  154. package/dist/migrations/Migration20240715102100.d.ts +0 -5
  155. package/dist/migrations/Migration20240715102100.d.ts.map +0 -1
  156. package/dist/migrations/Migration20240715102100.js +0 -15
  157. package/dist/migrations/Migration20240715102100.js.map +0 -1
  158. package/dist/migrations/Migration20240715174100.d.ts +0 -5
  159. package/dist/migrations/Migration20240715174100.d.ts.map +0 -1
  160. package/dist/migrations/Migration20240715174100.js +0 -21
  161. package/dist/migrations/Migration20240715174100.js.map +0 -1
  162. package/dist/migrations/Migration20240716081800.d.ts +0 -5
  163. package/dist/migrations/Migration20240716081800.d.ts.map +0 -1
  164. package/dist/migrations/Migration20240716081800.js +0 -67
  165. package/dist/migrations/Migration20240716081800.js.map +0 -1
  166. package/dist/models/address.d.ts.map +0 -1
  167. package/dist/models/adjustment-line.d.ts.map +0 -1
  168. package/dist/models/claim-item-image.d.ts +0 -19
  169. package/dist/models/claim-item-image.d.ts.map +0 -1
  170. package/dist/models/claim-item-image.js +0 -109
  171. package/dist/models/claim-item-image.js.map +0 -1
  172. package/dist/models/claim-item.d.ts +0 -29
  173. package/dist/models/claim-item.d.ts.map +0 -1
  174. package/dist/models/claim-item.js +0 -156
  175. package/dist/models/claim-item.js.map +0 -1
  176. package/dist/models/claim.d.ts +0 -36
  177. package/dist/models/claim.d.ts.map +0 -1
  178. package/dist/models/claim.js +0 -195
  179. package/dist/models/claim.js.map +0 -1
  180. package/dist/models/exchange-item.d.ts +0 -24
  181. package/dist/models/exchange-item.d.ts.map +0 -1
  182. package/dist/models/exchange-item.js +0 -138
  183. package/dist/models/exchange-item.js.map +0 -1
  184. package/dist/models/exchange.d.ts +0 -34
  185. package/dist/models/exchange.d.ts.map +0 -1
  186. package/dist/models/exchange.js +0 -188
  187. package/dist/models/exchange.js.map +0 -1
  188. package/dist/models/index.d.ts.map +0 -1
  189. package/dist/models/line-item-adjustment.d.ts.map +0 -1
  190. package/dist/models/line-item-tax-line.d.ts.map +0 -1
  191. package/dist/models/line-item.d.ts.map +0 -1
  192. package/dist/models/order-change-action.d.ts.map +0 -1
  193. package/dist/models/order-change.d.ts.map +0 -1
  194. package/dist/models/order-item.d.ts.map +0 -1
  195. package/dist/models/order-shipping-method.d.ts.map +0 -1
  196. package/dist/models/order-summary.d.ts.map +0 -1
  197. package/dist/models/order.d.ts.map +0 -1
  198. package/dist/models/return-item.d.ts +0 -29
  199. package/dist/models/return-item.d.ts.map +0 -1
  200. package/dist/models/return-item.js +0 -170
  201. package/dist/models/return-item.js.map +0 -1
  202. package/dist/models/return-reason.d.ts +0 -21
  203. package/dist/models/return-reason.d.ts.map +0 -1
  204. package/dist/models/return-reason.js +0 -120
  205. package/dist/models/return-reason.js.map +0 -1
  206. package/dist/models/return.d.ts +0 -39
  207. package/dist/models/return.d.ts.map +0 -1
  208. package/dist/models/return.js +0 -216
  209. package/dist/models/return.js.map +0 -1
  210. package/dist/models/shipping-method-adjustment.d.ts.map +0 -1
  211. package/dist/models/shipping-method-tax-line.d.ts.map +0 -1
  212. package/dist/models/shipping-method.d.ts.map +0 -1
  213. package/dist/models/tax-line.d.ts.map +0 -1
  214. package/dist/models/transaction.d.ts.map +0 -1
  215. package/dist/repositories/claim.d.ts +0 -9
  216. package/dist/repositories/claim.d.ts.map +0 -1
  217. package/dist/repositories/claim.js +0 -11
  218. package/dist/repositories/claim.js.map +0 -1
  219. package/dist/repositories/exchange.d.ts +0 -9
  220. package/dist/repositories/exchange.d.ts.map +0 -1
  221. package/dist/repositories/exchange.js +0 -11
  222. package/dist/repositories/exchange.js.map +0 -1
  223. package/dist/repositories/index.d.ts.map +0 -1
  224. package/dist/repositories/order.d.ts.map +0 -1
  225. package/dist/repositories/return.d.ts +0 -9
  226. package/dist/repositories/return.d.ts.map +0 -1
  227. package/dist/repositories/return.js +0 -11
  228. package/dist/repositories/return.js.map +0 -1
  229. package/dist/services/actions/cancel-claim.d.ts +0 -3
  230. package/dist/services/actions/cancel-claim.d.ts.map +0 -1
  231. package/dist/services/actions/cancel-claim.js +0 -107
  232. package/dist/services/actions/cancel-claim.js.map +0 -1
  233. package/dist/services/actions/cancel-exchange.d.ts +0 -3
  234. package/dist/services/actions/cancel-exchange.d.ts.map +0 -1
  235. package/dist/services/actions/cancel-exchange.js +0 -92
  236. package/dist/services/actions/cancel-exchange.js.map +0 -1
  237. package/dist/services/actions/cancel-fulfillment.d.ts +0 -3
  238. package/dist/services/actions/cancel-fulfillment.d.ts.map +0 -1
  239. package/dist/services/actions/cancel-fulfillment.js +0 -32
  240. package/dist/services/actions/cancel-fulfillment.js.map +0 -1
  241. package/dist/services/actions/cancel-return.d.ts +0 -3
  242. package/dist/services/actions/cancel-return.d.ts.map +0 -1
  243. package/dist/services/actions/cancel-return.js +0 -72
  244. package/dist/services/actions/cancel-return.js.map +0 -1
  245. package/dist/services/actions/create-claim.d.ts +0 -3
  246. package/dist/services/actions/create-claim.d.ts.map +0 -1
  247. package/dist/services/actions/create-claim.js +0 -228
  248. package/dist/services/actions/create-claim.js.map +0 -1
  249. package/dist/services/actions/create-exchange.d.ts +0 -3
  250. package/dist/services/actions/create-exchange.d.ts.map +0 -1
  251. package/dist/services/actions/create-exchange.js +0 -193
  252. package/dist/services/actions/create-exchange.js.map +0 -1
  253. package/dist/services/actions/create-return.d.ts +0 -3
  254. package/dist/services/actions/create-return.d.ts.map +0 -1
  255. package/dist/services/actions/create-return.js +0 -102
  256. package/dist/services/actions/create-return.js.map +0 -1
  257. package/dist/services/actions/index.d.ts +0 -11
  258. package/dist/services/actions/index.d.ts.map +0 -1
  259. package/dist/services/actions/index.js +0 -27
  260. package/dist/services/actions/index.js.map +0 -1
  261. package/dist/services/actions/receive-return.d.ts +0 -3
  262. package/dist/services/actions/receive-return.d.ts.map +0 -1
  263. package/dist/services/actions/receive-return.js +0 -73
  264. package/dist/services/actions/receive-return.js.map +0 -1
  265. package/dist/services/actions/register-fulfillment.d.ts +0 -3
  266. package/dist/services/actions/register-fulfillment.d.ts.map +0 -1
  267. package/dist/services/actions/register-fulfillment.js +0 -30
  268. package/dist/services/actions/register-fulfillment.js.map +0 -1
  269. package/dist/services/actions/register-shipment.d.ts +0 -3
  270. package/dist/services/actions/register-shipment.d.ts.map +0 -1
  271. package/dist/services/actions/register-shipment.js +0 -38
  272. package/dist/services/actions/register-shipment.js.map +0 -1
  273. package/dist/services/index.d.ts.map +0 -1
  274. package/dist/services/order-module-service.d.ts.map +0 -1
  275. package/dist/services/order-service.d.ts.map +0 -1
  276. package/dist/types/address.d.ts.map +0 -1
  277. package/dist/types/index.d.ts.map +0 -1
  278. package/dist/types/line-item-adjustment.d.ts.map +0 -1
  279. package/dist/types/line-item-tax-line.d.ts.map +0 -1
  280. package/dist/types/line-item.d.ts.map +0 -1
  281. package/dist/types/order-change.d.ts +0 -6
  282. package/dist/types/order-change.d.ts.map +0 -1
  283. package/dist/types/order-change.js +0 -3
  284. package/dist/types/order-change.js.map +0 -1
  285. package/dist/types/order-detail.d.ts.map +0 -1
  286. package/dist/types/order.d.ts.map +0 -1
  287. package/dist/types/shipping-method-adjustment.d.ts.map +0 -1
  288. package/dist/types/shipping-method-tax-line.d.ts.map +0 -1
  289. package/dist/types/shipping-method.d.ts.map +0 -1
  290. package/dist/types/tax-line.d.ts.map +0 -1
  291. package/dist/types/transaction.d.ts.map +0 -1
  292. package/dist/types/utils/index.d.ts.map +0 -1
  293. package/dist/utils/actions/cancel-item-fulfillment.d.ts +0 -2
  294. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +0 -1
  295. package/dist/utils/actions/cancel-item-fulfillment.js +0 -39
  296. package/dist/utils/actions/cancel-item-fulfillment.js.map +0 -1
  297. package/dist/utils/actions/cancel-return.d.ts.map +0 -1
  298. package/dist/utils/actions/cancel.d.ts.map +0 -1
  299. package/dist/utils/actions/fulfill-item.d.ts.map +0 -1
  300. package/dist/utils/actions/index.d.ts.map +0 -1
  301. package/dist/utils/actions/item-add.d.ts.map +0 -1
  302. package/dist/utils/actions/item-remove.d.ts.map +0 -1
  303. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +0 -1
  304. package/dist/utils/actions/receive-return-item.d.ts.map +0 -1
  305. package/dist/utils/actions/reinstate-item.d.ts +0 -2
  306. package/dist/utils/actions/reinstate-item.d.ts.map +0 -1
  307. package/dist/utils/actions/reinstate-item.js +0 -37
  308. package/dist/utils/actions/reinstate-item.js.map +0 -1
  309. package/dist/utils/actions/return-item.d.ts.map +0 -1
  310. package/dist/utils/actions/ship-item.d.ts.map +0 -1
  311. package/dist/utils/actions/shipping-add.d.ts.map +0 -1
  312. package/dist/utils/actions/shipping-remove.d.ts +0 -2
  313. package/dist/utils/actions/shipping-remove.d.ts.map +0 -1
  314. package/dist/utils/actions/shipping-remove.js +0 -41
  315. package/dist/utils/actions/shipping-remove.js.map +0 -1
  316. package/dist/utils/actions/write-off-item.d.ts.map +0 -1
  317. package/dist/utils/apply-order-changes.d.ts +0 -18
  318. package/dist/utils/apply-order-changes.d.ts.map +0 -1
  319. package/dist/utils/apply-order-changes.js +0 -95
  320. package/dist/utils/apply-order-changes.js.map +0 -1
  321. package/dist/utils/base-repository-find.d.ts +0 -3
  322. package/dist/utils/base-repository-find.d.ts.map +0 -1
  323. package/dist/utils/base-repository-find.js +0 -142
  324. package/dist/utils/base-repository-find.js.map +0 -1
  325. package/dist/utils/calculate-order-change.d.ts.map +0 -1
  326. package/dist/utils/index.d.ts.map +0 -1
  327. package/dist/utils/set-action-reference.d.ts +0 -3
  328. package/dist/utils/set-action-reference.d.ts.map +0 -1
  329. package/dist/utils/set-action-reference.js +0 -17
  330. package/dist/utils/set-action-reference.js.map +0 -1
  331. package/dist/utils/transform-order.d.ts.map +0 -1
@@ -1,6 +0,0 @@
1
- import { OrderTypes } from "@medusajs/types";
2
- import { OrderChangeType } from "@medusajs/utils";
3
- export interface CreateOrderChangeDTO extends OrderTypes.CreateOrderChangeDTO {
4
- change_type?: OrderChangeType;
5
- }
6
- //# sourceMappingURL=order-change.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"order-change.d.ts","sourceRoot":"","sources":["../../src/types/order-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,oBAAqB,SAAQ,UAAU,CAAC,oBAAoB;IAC3E,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=order-change.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"order-change.js","sourceRoot":"","sources":["../../src/types/order-change.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"order-detail.d.ts","sourceRoot":"","sources":["../../src/types/order-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,kBAAkB,CAAC,EAAE,cAAc,CAAA;IACnC,yBAAyB,CAAC,EAAE,cAAc,CAAA;IAC1C,wBAAwB,CAAC,EAAE,cAAc,CAAA;IACzC,yBAAyB,CAAC,EAAE,cAAc,CAAA;IAC1C,oBAAoB,CAAC,EAAE,cAAc,CAAA;IAErC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,cAAc,CAAA;CACzB;AAED,MAAM,WAAW,kBACf,SAAQ,yBAAyB,EAC/B,OAAO,CAAC,kBAAkB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAA;CACX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/types/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-method-adjustment.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method-adjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,sCAAsC,CAAA;AAEnD,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,sCAAsC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-method-tax-line.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method-tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEzE,MAAM,WAAW,mCACf,SAAQ,qBAAqB;IAC7B,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,mCACf,SAAQ,qBAAqB;IAC7B,kBAAkB,EAAE,MAAM,CAAA;CAC3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-method.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAA;IACV,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tax-line.d.ts","sourceRoot":"","sources":["../../src/types/tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAA;AAEpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/types/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IAEV,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,WAAW,CAAC,EAAE,MAAM,CAAA;QAEpB,UAAU,EAAE,cAAc,CAAA;QAC1B,QAAQ,EAAE,cAAc,CAAA;QAExB,MAAM,EAAE;YACN,EAAE,CAAC,EAAE,MAAM,CAAA;YACX,QAAQ,EAAE,MAAM,CAAA;YAChB,SAAS,CAAC,EAAE,MAAM,CAAA;YAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,WAAW,CAAC,EAAE,MAAM,CAAA;YAEpB,OAAO,CAAC,EAAE,MAAM,CAAA;YAChB,QAAQ,EAAE,cAAc,CAAA;YACxB,gBAAgB,EAAE,cAAc,CAAA;YAChC,kBAAkB,EAAE,cAAc,CAAA;YAClC,yBAAyB,EAAE,cAAc,CAAA;YACzC,wBAAwB,EAAE,cAAc,CAAA;YACxC,yBAAyB,EAAE,cAAc,CAAA;YACzC,oBAAoB,EAAE,cAAc,CAAA;YACpC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SACnC,CAAA;KACF,EAAE,CAAA;IAEH,gBAAgB,EAAE;QACh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C,GAAG,EAAE,eAAe,KAAK,cAAc,GAAG,IAAI,CAAA;IACxD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAA;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cancel-item-fulfillment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-item-fulfillment.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel-item-fulfillment.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@medusajs/utils");
4
- const calculate_order_change_1 = require("../calculate-order-change");
5
- const set_action_reference_1 = require("../set-action-reference");
6
- calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.CANCEL_ITEM_FULFILLMENT, {
7
- operation({ action, currentOrder, options }) {
8
- const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
9
- existing.detail.fulfilled_quantity ??= 0;
10
- existing.detail.fulfilled_quantity = utils_1.MathBN.sub(existing.detail.fulfilled_quantity, action.details.quantity);
11
- (0, set_action_reference_1.setActionReference)(existing, action, options);
12
- },
13
- revert({ action, currentOrder }) {
14
- const existing = currentOrder.items.find((item) => item.id === action.reference_id);
15
- existing.detail.fulfilled_quantity = utils_1.MathBN.add(existing.detail.fulfilled_quantity, action.details.quantity);
16
- (0, set_action_reference_1.unsetActionReference)(existing, action);
17
- },
18
- validate({ action, currentOrder }) {
19
- const refId = action.details?.reference_id;
20
- if (!(0, utils_1.isDefined)(refId)) {
21
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Reference ID is required.");
22
- }
23
- const existing = currentOrder.items.find((item) => item.id === refId);
24
- if (!existing) {
25
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Item ID "${refId}" not found.`);
26
- }
27
- if (!action.details?.quantity) {
28
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Quantity to cancel item fulfillment ${refId} is required.`);
29
- }
30
- if (action.details?.quantity < 1) {
31
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Quantity to cancel item ${refId} must be greater than 0.`);
32
- }
33
- const greater = utils_1.MathBN.gt(action.details?.quantity, existing.detail?.fulfilled_quantity);
34
- if (greater) {
35
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Cannot cancel more items than what was fulfilled for item ${refId}.`);
36
- }
37
- },
38
- });
39
- //# sourceMappingURL=cancel-item-fulfillment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-item-fulfillment.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel-item-fulfillment.ts"],"names":[],"mappings":";;AAAA,2CAKwB;AACxB,sEAAiE;AACjE,kEAGgC;AAEhC,8CAAqB,CAAC,kBAAkB,CACtC,wBAAgB,CAAC,uBAAuB,EACxC;IACE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;QACzC,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,QAAQ,CAAC,MAAM,CAAC,kBAAkB,KAAK,CAAC,CAAA;QAExC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,GAAG,cAAM,CAAC,GAAG,CAC7C,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAClC,MAAM,CAAC,OAAO,CAAC,QAAQ,CACxB,CAAA;QAED,IAAA,yCAAkB,EAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,K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ACH,CAAC;QAED,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CACvB,MAAM,CAAC,OAAO,EAAE,QAAQ,EACxB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CACpC,CAAA;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,6DAA6D,KAAK,GAAG,CACtE,CAAA;QACH,CAAC;IACH,CAAC;CACF,CACF,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-return.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel-return.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fulfill-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/fulfill-item.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"item-add.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/item-add.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"item-remove.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/item-remove.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"receive-damaged-return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/receive-damaged-return-item.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"receive-return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/receive-return-item.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=reinstate-item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reinstate-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/reinstate-item.ts"],"names":[],"mappings":""}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@medusajs/utils");
4
- const calculate_order_change_1 = require("../calculate-order-change");
5
- const set_action_reference_1 = require("../set-action-reference");
6
- calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.REINSTATE_ITEM, {
7
- operation({ action, currentOrder, options }) {
8
- const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
9
- existing.detail.written_off_quantity ??= 0;
10
- existing.detail.written_off_quantity = utils_1.MathBN.sub(existing.detail.written_off_quantity, action.details.quantity);
11
- (0, set_action_reference_1.setActionReference)(existing, action, options);
12
- },
13
- revert({ action, currentOrder }) {
14
- const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
15
- existing.detail.written_off_quantity = utils_1.MathBN.add(existing.detail.written_off_quantity, action.details.quantity);
16
- (0, set_action_reference_1.unsetActionReference)(existing, action);
17
- },
18
- validate({ action, currentOrder }) {
19
- const refId = action.details?.reference_id;
20
- if (!(0, utils_1.isDefined)(refId)) {
21
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Details reference ID is required.");
22
- }
23
- const existing = currentOrder.items.find((item) => item.id === refId);
24
- if (!existing) {
25
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Item ID "${refId}" not found.`);
26
- }
27
- if (!action.details?.quantity) {
28
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Quantity to reinstate item ${refId} is required.`);
29
- }
30
- const quantityAvailable = existing.quantity ?? 0;
31
- const greater = utils_1.MathBN.gt(action.details?.quantity, quantityAvailable);
32
- if (greater) {
33
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Cannot unclaim more items than what was ordered.");
34
- }
35
- },
36
- });
37
- //# sourceMappingURL=reinstate-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reinstate-item.js","sourceRoot":"","sources":["../../../src/utils/actions/reinstate-item.ts"],"names":[],"mappings":";;AAAA,2CAKwB;AACxB,sEAAiE;AACjE,kEAGgC;AAEhC,8CAAqB,CAAC,kBAAkB,CAAC,wBAAgB,CAAC,cAAc,EAAE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;QACzC,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,QAAQ,CAAC,MAAM,CAAC,oBAAoB,KAAK,CAAC,CAAA;QAC1C,QAAQ,CAAC,MAAM,CAAC,oBAAoB,GAAG,cAAM,CAAC,GAAG,CAC/C,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EACpC,MAAM,CAAC,OAAO,CAAC,QAAQ,CACxB,CAAA;QAED,IAAA,yCAAkB,EAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC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C9B,kDAAkD,CACnD,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/return-item.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ship-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/ship-item.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-add.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/shipping-add.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=shipping-remove.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-remove.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/shipping-remove.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@medusajs/utils");
4
- const calculate_order_change_1 = require("../calculate-order-change");
5
- calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.SHIPPING_REMOVE, {
6
- operation({ action, currentOrder, options }) {
7
- const shipping = Array.isArray(currentOrder.shipping_methods)
8
- ? currentOrder.shipping_methods
9
- : [currentOrder.shipping_methods];
10
- const existingIndex = shipping.findIndex((item) => item.id === action.reference_id);
11
- if (existingIndex > -1) {
12
- shipping.splice(existingIndex, 1);
13
- }
14
- currentOrder.shipping_methods = shipping;
15
- },
16
- revert({ action, currentOrder }) {
17
- const shipping = Array.isArray(currentOrder.shipping_methods)
18
- ? currentOrder.shipping_methods
19
- : [currentOrder.shipping_methods];
20
- const existingIndex = shipping.findIndex((item) => item.id === action.reference_id);
21
- if (existingIndex > -1) {
22
- shipping.push({
23
- id: action.reference_id,
24
- order_id: currentOrder.id,
25
- return_id: action.return_id,
26
- claim_id: action.claim_id,
27
- exchange_id: action.exchange_id,
28
- amount: action.amount,
29
- });
30
- }
31
- },
32
- validate({ action }) {
33
- if (!action.reference_id) {
34
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Reference ID is required.");
35
- }
36
- if (!(0, utils_1.isDefined)(action.amount)) {
37
- throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Amount is required.");
38
- }
39
- },
40
- });
41
- //# sourceMappingURL=shipping-remove.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shipping-remove.js","sourceRoot":"","sources":["../../../src/utils/actions/shipping-remove.ts"],"names":[],"mappings":";;AAAA,2CAA0E;AAC1E,sEAAiE;AAEjE,8CAAqB,CAAC,kBAAkB,CAAC,wBAAgB,CAAC,eAAe,EAAE;IACzE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE;QACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC;YAC3D,CAAC,CAAC,YAAY,CAAC,gBAAgB;YAC/B,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;QAEnC,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,YAAY,CAC1C,CAAA;QAED,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC;YACvB,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;QACnC,CAAC;QAED,YAAY,CAAC,gBAAgB,GAAG,QAAQ,CAAA;IAC1C,CAAC;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC;YAC3D,CAAC,CAAC,YAAY,CAAC,gBAAgB;YAC/B,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;QAEnC,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,YAAY,CAC1C,CAAA;QAED,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,MAAM,CAAC,YAAa;gBACxB,QAAQ,EAAE,YAAY,CAAC,EAAE;gBACzB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,MAAM,EAAE,MAAM,CAAC,MAAgB;aAChC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,EAAE,MAAM,EAAE;QACjB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YACzB,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,2BAA2B,CAC5B,CAAA;QACH,CAAC;QAED,IAAI,CAAC,IAAA,iBAAS,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,qBAAqB,CACtB,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-off-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/write-off-item.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- import { OrderChangeActionDTO } from "@medusajs/types";
2
- import { OrderItem, OrderShippingMethod } from "../models";
3
- export interface ApplyOrderChangeDTO extends OrderChangeActionDTO {
4
- id: string;
5
- order_id: string;
6
- version: number;
7
- applied: boolean;
8
- }
9
- export declare function applyChangesToOrder(orders: any[], actionsMap: Record<string, any[]>, options?: {
10
- addActionReferenceToObject?: boolean;
11
- }): {
12
- itemsToUpsert: OrderItem[];
13
- shippingMethodsToUpsert: OrderShippingMethod[];
14
- summariesToUpsert: any[];
15
- orderToUpdate: any[];
16
- calculatedOrders: {};
17
- };
18
- //# sourceMappingURL=apply-order-changes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-order-changes.d.ts","sourceRoot":"","sources":["../../src/utils/apply-order-changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAMtD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGxD,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,GAAG,EAAE,EACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EACjC,OAAO,CAAC,EAAE;IACR,0BAA0B,CAAC,EAAE,OAAO,CAAA;CACrC;;;;;;EAuGF"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyChangesToOrder = void 0;
4
- const utils_1 = require("@medusajs/utils");
5
- const calculate_order_change_1 = require("./calculate-order-change");
6
- function applyChangesToOrder(orders, actionsMap, options) {
7
- const itemsToUpsert = [];
8
- const shippingMethodsToUpsert = [];
9
- const summariesToUpsert = [];
10
- const orderToUpdate = [];
11
- const calculatedOrders = {};
12
- for (const order of orders) {
13
- const calculated = (0, calculate_order_change_1.calculateOrderChange)({
14
- order: order,
15
- actions: actionsMap[order.id],
16
- transactions: order.transactions ?? [],
17
- options,
18
- });
19
- (0, utils_1.createRawPropertiesFromBigNumber)(calculated);
20
- calculatedOrders[order.id] = calculated;
21
- const version = actionsMap[order.id]?.[0]?.version ?? order.version;
22
- for (const item of calculated.order.items) {
23
- const isExistingItem = item.id === item.detail?.item_id;
24
- const orderItem = isExistingItem ? item.detail : item;
25
- const itemId = isExistingItem ? orderItem.item_id : item.id;
26
- itemsToUpsert.push({
27
- id: orderItem.version === version ? orderItem.id : undefined,
28
- item_id: itemId,
29
- order_id: order.id,
30
- version,
31
- quantity: orderItem.quantity,
32
- fulfilled_quantity: orderItem.fulfilled_quantity ?? 0,
33
- shipped_quantity: orderItem.shipped_quantity ?? 0,
34
- return_requested_quantity: orderItem.return_requested_quantity ?? 0,
35
- return_received_quantity: orderItem.return_received_quantity ?? 0,
36
- return_dismissed_quantity: orderItem.return_dismissed_quantity ?? 0,
37
- written_off_quantity: orderItem.written_off_quantity,
38
- metadata: orderItem.metadata,
39
- });
40
- }
41
- const orderSummary = order.summary;
42
- summariesToUpsert.push({
43
- id: orderSummary?.version === version ? orderSummary.id : undefined,
44
- order_id: order.id,
45
- version,
46
- totals: calculated.summary,
47
- });
48
- if (version > order.version) {
49
- for (const shippingMethod of calculated.order.shipping_methods ?? []) {
50
- const shippingMethod_ = shippingMethod;
51
- const isNewShippingMethod = !(0, utils_1.isDefined)(shippingMethod_?.detail);
52
- if (!shippingMethod_) {
53
- continue;
54
- }
55
- let associatedMethodId;
56
- let hasShippingMethod = false;
57
- if (isNewShippingMethod) {
58
- associatedMethodId = shippingMethod_.actions?.find((sm) => {
59
- return (sm.action === utils_1.ChangeActionType.SHIPPING_ADD && sm.reference_id);
60
- });
61
- hasShippingMethod = !!associatedMethodId;
62
- }
63
- else {
64
- associatedMethodId = shippingMethod_?.detail?.shipping_method_id;
65
- }
66
- const sm = {
67
- ...(isNewShippingMethod ? shippingMethod_ : shippingMethod_.detail),
68
- version,
69
- shipping_method_id: associatedMethodId,
70
- };
71
- delete sm.id;
72
- if (!hasShippingMethod) {
73
- shippingMethodsToUpsert.push(sm);
74
- }
75
- }
76
- orderToUpdate.push({
77
- selector: {
78
- id: order.id,
79
- },
80
- data: {
81
- version,
82
- },
83
- });
84
- }
85
- }
86
- return {
87
- itemsToUpsert,
88
- shippingMethodsToUpsert,
89
- summariesToUpsert,
90
- orderToUpdate,
91
- calculatedOrders,
92
- };
93
- }
94
- exports.applyChangesToOrder = applyChangesToOrder;
95
- //# sourceMappingURL=apply-order-changes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-order-changes.js","sourceRoot":"","sources":["../../src/utils/apply-order-changes.ts"],"names":[],"mappings":";;;AACA,2CAIwB;AAExB,qEAA+D;AAS/D,SAAgB,mBAAmB,CACjC,MAAa,EACb,UAAiC,EACjC,OAEC;IAED,MAAM,aAAa,GAAgB,EAAE,CAAA;IACrC,MAAM,uBAAuB,GAA0B,EAAE,CAAA;IACzD,MAAM,iBAAiB,GAAU,EAAE,CAAA;IACnC,MAAM,aAAa,GAAU,EAAE,CAAA;IAE/B,MAAM,gBAAgB,GAAG,EAAE,CAAA;IAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,IAAA,6CAAoB,EAAC;YACtC,KAAK,EAAE,KAAY;YACnB,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE;YACtC,OAAO;SACR,CAAC,CAAA;QAEF,IAAA,wCAAgC,EAAC,UAAU,CAAC,CAAA;QAE5C,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,UAAU,CAAA;QAEvC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAA;QAEnE,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,EAAE,OAAO,CAAA;YACvD,MAAM,SAAS,GAAG,cAAc,C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AAA;AACH,CAAC;AA5GD,kDA4GC"}
@@ -1,3 +0,0 @@
1
- import { Constructor } from "@medusajs/types";
2
- export declare function setFindMethods<T>(klass: Constructor<T>, entity: any): void;
3
- //# sourceMappingURL=base-repository-find.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-repository-find.d.ts","sourceRoot":"","sources":["../../src/utils/base-repository-find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,iBAAiB,CAAA;AAK3D,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,QAkLnE"}
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setFindMethods = void 0;
4
- const core_1 = require("@mikro-orm/core");
5
- const _models_1 = require("../models");
6
- const _1 = require(".");
7
- function setFindMethods(klass, entity) {
8
- klass.prototype.find = async function find(options, context) {
9
- const manager = this.getActiveManager(context);
10
- const knex = manager.getKnex();
11
- const findOptions_ = { ...options };
12
- findOptions_.options ??= {};
13
- findOptions_.where ??= {};
14
- findOptions_.populate ??= [];
15
- if (!("strategy" in findOptions_.options)) {
16
- if (findOptions_.options.limit != null || findOptions_.options.offset) {
17
- Object.assign(findOptions_.options, {
18
- strategy: core_1.LoadStrategy.SELECT_IN,
19
- });
20
- }
21
- else {
22
- Object.assign(findOptions_.options, {
23
- strategy: core_1.LoadStrategy.JOINED,
24
- });
25
- }
26
- }
27
- const isRelatedEntity = entity !== _models_1.Order;
28
- const config = (0, _1.mapRepositoryToOrderModel)(findOptions_, isRelatedEntity);
29
- config.options ??= {};
30
- config.options.populate ??= [];
31
- let orderAlias = "o0";
32
- if (isRelatedEntity) {
33
- if (!config.options.populate.includes("order.items")) {
34
- config.options.populate.unshift("order.items");
35
- }
36
- // first relation is always order if the entity is not Order
37
- const index = config.options.populate.findIndex((p) => p === "order");
38
- if (index > -1) {
39
- config.options.populate.splice(index, 1);
40
- }
41
- config.options.populate.unshift("order");
42
- orderAlias = "o1";
43
- }
44
- let defaultVersion = knex.raw(`"${orderAlias}"."version"`);
45
- const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
46
- if (strategy === core_1.LoadStrategy.SELECT_IN) {
47
- const sql = manager
48
- .qb(_models_1.Order, "_sub0")
49
- .select("version")
50
- .where({ id: knex.raw(`"${orderAlias}"."order_id"`) })
51
- .getKnexQuery()
52
- .toString();
53
- defaultVersion = knex.raw(`(${sql})`);
54
- }
55
- const version = config.where.version ?? defaultVersion;
56
- delete config.where?.version;
57
- config.options.populateWhere ??= {};
58
- const popWhere = config.options.populateWhere;
59
- if (isRelatedEntity) {
60
- popWhere.order ??= {};
61
- popWhere.shipping_methods ??= {};
62
- popWhere.shipping_methods.version = version;
63
- popWhere.shipping_methods.deleted_at ??= null;
64
- popWhere.shipping_methods.shipping_method ??= {};
65
- popWhere.shipping_methods.shipping_method.deleted_at ??= null;
66
- }
67
- const orderWhere = isRelatedEntity ? popWhere.order : popWhere;
68
- orderWhere.summary ??= {};
69
- orderWhere.summary.version = version;
70
- orderWhere.items ??= {};
71
- orderWhere.items.version = version;
72
- orderWhere.items.deleted_at ??= null;
73
- orderWhere.shipping_methods ??= {};
74
- orderWhere.shipping_methods.version = version;
75
- orderWhere.shipping_methods.deleted_at ??= null;
76
- orderWhere.shipping_methods.shipping_method ??= {};
77
- orderWhere.shipping_methods.shipping_method.deleted_at ??= null;
78
- if (!config.options.orderBy) {
79
- config.options.orderBy = { id: "ASC" };
80
- }
81
- config.where ??= {};
82
- config.where.deleted_at ??= null;
83
- return await manager.find(entity, config.where, config.options);
84
- };
85
- klass.prototype.findAndCount = async function findAndCount(findOptions = { where: {} }, context = {}) {
86
- const manager = this.getActiveManager(context);
87
- const knex = manager.getKnex();
88
- const findOptions_ = { ...findOptions };
89
- findOptions_.options ??= {};
90
- findOptions_.where ??= {};
91
- if (!("strategy" in findOptions_.options)) {
92
- Object.assign(findOptions_.options, {
93
- strategy: core_1.LoadStrategy.SELECT_IN,
94
- });
95
- }
96
- const isRelatedEntity = entity !== _models_1.Order;
97
- const config = (0, _1.mapRepositoryToOrderModel)(findOptions_, isRelatedEntity);
98
- let orderAlias = "o0";
99
- if (isRelatedEntity) {
100
- // first relation is always order if the entity is not Order
101
- const index = config.options.populate.findIndex((p) => p === "order");
102
- if (index > -1) {
103
- config.options.populate.splice(index, 1);
104
- }
105
- config.options.populate.unshift("order");
106
- orderAlias = "o1";
107
- }
108
- let defaultVersion = knex.raw(`"${orderAlias}"."version"`);
109
- const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
110
- if (strategy === core_1.LoadStrategy.SELECT_IN) {
111
- const sql = manager
112
- .qb(_models_1.Order, "_sub0")
113
- .select("version")
114
- .where({ id: knex.raw(`"${orderAlias}"."order_id"`) })
115
- .getKnexQuery()
116
- .toString();
117
- defaultVersion = knex.raw(`(${sql})`);
118
- }
119
- const version = config.where.version ?? defaultVersion;
120
- delete config.where.version;
121
- config.options.populateWhere ??= {};
122
- const popWhere = config.options.populateWhere;
123
- if (isRelatedEntity) {
124
- popWhere.order ??= {};
125
- }
126
- const orderWhere = isRelatedEntity ? popWhere.order : popWhere;
127
- orderWhere.summary ??= {};
128
- orderWhere.summary.version = version;
129
- orderWhere.items ??= {};
130
- orderWhere.items.version = version;
131
- orderWhere.items.deleted_at ??= null;
132
- popWhere.shipping_methods ??= {};
133
- popWhere.shipping_methods.version = version;
134
- popWhere.shipping_methods.deleted_at ??= null;
135
- if (!config.options.orderBy) {
136
- config.options.orderBy = { id: "ASC" };
137
- }
138
- return await manager.findAndCount(entity, config.where, config.options);
139
- };
140
- }
141
- exports.setFindMethods = setFindMethods;
142
- //# sourceMappingURL=base-repository-find.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-repository-find.js","sourceRoot":"","sources":["../../src/utils/base-repository-find.ts"],"names":[],"mappings":";;;AACA,0CAA8C;AAC9C,qCAA+B;AAC/B,w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AC,OAAO,CAA4B;IAC3C,OAAO,CAAC,OAAO,CAAqB;IAEpC,OAAO,CAAC,gBAAgB,CAAoD;IAC5E,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,OAAO,CAAsB;WAEvB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB;gBAI5D,EACV,KAAK,EACL,YAAY,EACZ,OAAO,EACP,OAAO,GACR,EAAE;QACD,KAAK,EAAE,YAAY,CAAA;QACnB,YAAY,EAAE,gBAAgB,EAAE,CAAA;QAChC,OAAO,EAAE,wBAAwB,EAAE,CAAA;QACnC,OAAO,EAAE,cAAc,CAAA;KACxB;IAoCD,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,cAAc;IAKf,cAAc;IAgFrB,OAAO,CAAC,cAAc;IAiFtB,OAAO,CAAC,iBAAiB;IAqDzB,OAAO,CAAC,YAAY;IAmDb,UAAU,IAAI,eAAe;IAoB7B,eAAe,IAAI,YAAY;CAGvC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,YAAiB,EACjB,OAAY,EACZ,OAAY,GACb,EAAE;IACD,KAAK,EAAE,YAAY,CAAA;IACnB,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACjC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;;;EAaA"}
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- export declare function setActionReference(existing: any, action: any, options: any): void;
2
- export declare function unsetActionReference(existing: any, action: any): void;
3
- //# sourceMappingURL=set-action-reference.d.ts.map
@@ -1 +0,0 @@
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;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,KAAA,EAAE,MAAM,KAAA,QAIpD"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unsetActionReference = exports.setActionReference = void 0;
4
- function setActionReference(existing, action, options) {
5
- if (options?.addActionReferenceToObject) {
6
- existing.actions ??= [];
7
- existing.actions.push(action);
8
- }
9
- }
10
- exports.setActionReference = setActionReference;
11
- function unsetActionReference(existing, action) {
12
- if (Array.isArray(existing?.actions)) {
13
- existing.actions = existing.actions.filter((a) => a.id !== action.id);
14
- }
15
- }
16
- exports.unsetActionReference = unsetActionReference;
17
- //# sourceMappingURL=set-action-reference.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-action-reference.js","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":";;;AAAA,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;AALD,gDAKC;AAED,SAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;QACrC,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,CAAA;IACvE,CAAC;AACH,CAAC;AAJD,oDAIC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-order.d.ts","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAU5C,wBAAgB,WAAW,CACzB,KAAK,KAAA,EACL,OAAO,EAAE;IACP,MAAM,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GACA,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAkF/D;AAmFD,wBAAgB,yBAAyB,CAAC,MAAM,KAAA,EAAE,eAAe,UAAQ,OAwExE"}