@medusajs/core-flows 0.0.2-next-20231124140416

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/definition/cart/create-cart.d.ts +9 -0
  2. package/dist/definition/cart/create-cart.js +148 -0
  3. package/dist/definition/cart/create-cart.js.map +1 -0
  4. package/dist/definition/cart/index.d.ts +1 -0
  5. package/dist/definition/cart/index.js +18 -0
  6. package/dist/definition/cart/index.js.map +1 -0
  7. package/dist/definition/index.d.ts +4 -0
  8. package/dist/definition/index.js +21 -0
  9. package/dist/definition/index.js.map +1 -0
  10. package/dist/definition/inventory/create-inventory-item.d.ts +14 -0
  11. package/dist/definition/inventory/create-inventory-item.js +41 -0
  12. package/dist/definition/inventory/create-inventory-item.js.map +1 -0
  13. package/dist/definition/inventory/index.d.ts +1 -0
  14. package/dist/definition/inventory/index.js +18 -0
  15. package/dist/definition/inventory/index.js.map +1 -0
  16. package/dist/definition/price-list/create-price-lists.d.ts +13 -0
  17. package/dist/definition/price-list/create-price-lists.js +55 -0
  18. package/dist/definition/price-list/create-price-lists.js.map +1 -0
  19. package/dist/definition/price-list/index.d.ts +6 -0
  20. package/dist/definition/price-list/index.js +23 -0
  21. package/dist/definition/price-list/index.js.map +1 -0
  22. package/dist/definition/price-list/remove-price-list-prices.d.ts +11 -0
  23. package/dist/definition/price-list/remove-price-list-prices.js +50 -0
  24. package/dist/definition/price-list/remove-price-list-prices.js.map +1 -0
  25. package/dist/definition/price-list/remove-price-lists.d.ts +12 -0
  26. package/dist/definition/price-list/remove-price-lists.js +40 -0
  27. package/dist/definition/price-list/remove-price-lists.js.map +1 -0
  28. package/dist/definition/price-list/remove-product-prices.d.ts +11 -0
  29. package/dist/definition/price-list/remove-product-prices.js +51 -0
  30. package/dist/definition/price-list/remove-product-prices.js.map +1 -0
  31. package/dist/definition/price-list/remove-variant-prices.d.ts +11 -0
  32. package/dist/definition/price-list/remove-variant-prices.js +51 -0
  33. package/dist/definition/price-list/remove-variant-prices.js.map +1 -0
  34. package/dist/definition/price-list/update-price-lists.d.ts +13 -0
  35. package/dist/definition/price-list/update-price-lists.js +51 -0
  36. package/dist/definition/price-list/update-price-lists.js.map +1 -0
  37. package/dist/definition/product/create-product-variants.d.ts +15 -0
  38. package/dist/definition/product/create-product-variants.js +91 -0
  39. package/dist/definition/product/create-product-variants.js.map +1 -0
  40. package/dist/definition/product/create-products.d.ts +18 -0
  41. package/dist/definition/product/create-products.js +211 -0
  42. package/dist/definition/product/create-products.js.map +1 -0
  43. package/dist/definition/product/index.d.ts +4 -0
  44. package/dist/definition/product/index.js +34 -0
  45. package/dist/definition/product/index.js.map +1 -0
  46. package/dist/definition/product/prepare-create-inventory-items.d.ts +23 -0
  47. package/dist/definition/product/prepare-create-inventory-items.js +28 -0
  48. package/dist/definition/product/prepare-create-inventory-items.js.map +1 -0
  49. package/dist/definition/product/update-product-variants.d.ts +15 -0
  50. package/dist/definition/product/update-product-variants.js +81 -0
  51. package/dist/definition/product/update-product-variants.js.map +1 -0
  52. package/dist/definition/product/update-products.d.ts +19 -0
  53. package/dist/definition/product/update-products.js +328 -0
  54. package/dist/definition/product/update-products.js.map +1 -0
  55. package/dist/definitions.d.ts +27 -0
  56. package/dist/definitions.js +37 -0
  57. package/dist/definitions.js.map +1 -0
  58. package/dist/handlers/address/find-or-create-addresses.d.ts +24 -0
  59. package/dist/handlers/address/find-or-create-addresses.js +66 -0
  60. package/dist/handlers/address/find-or-create-addresses.js.map +1 -0
  61. package/dist/handlers/address/index.d.ts +1 -0
  62. package/dist/handlers/address/index.js +18 -0
  63. package/dist/handlers/address/index.js.map +1 -0
  64. package/dist/handlers/cart/attach-line-items-to-cart.d.ts +21 -0
  65. package/dist/handlers/cart/attach-line-items-to-cart.js +35 -0
  66. package/dist/handlers/cart/attach-line-items-to-cart.js.map +1 -0
  67. package/dist/handlers/cart/create-cart.d.ts +36 -0
  68. package/dist/handlers/cart/create-cart.js +27 -0
  69. package/dist/handlers/cart/create-cart.js.map +1 -0
  70. package/dist/handlers/cart/index.d.ts +4 -0
  71. package/dist/handlers/cart/index.js +21 -0
  72. package/dist/handlers/cart/index.js.map +1 -0
  73. package/dist/handlers/cart/remove-cart.d.ts +14 -0
  74. package/dist/handlers/cart/remove-cart.js +17 -0
  75. package/dist/handlers/cart/remove-cart.js.map +1 -0
  76. package/dist/handlers/cart/retrieve-cart.d.ts +22 -0
  77. package/dist/handlers/cart/retrieve-cart.js +18 -0
  78. package/dist/handlers/cart/retrieve-cart.js.map +1 -0
  79. package/dist/handlers/common/index.d.ts +1 -0
  80. package/dist/handlers/common/index.js +18 -0
  81. package/dist/handlers/common/index.js.map +1 -0
  82. package/dist/handlers/common/set-context.d.ts +17 -0
  83. package/dist/handlers/common/set-context.js +16 -0
  84. package/dist/handlers/common/set-context.js.map +1 -0
  85. package/dist/handlers/customer/find-or-create-customer.d.ts +19 -0
  86. package/dist/handlers/customer/find-or-create-customer.js +38 -0
  87. package/dist/handlers/customer/find-or-create-customer.js.map +1 -0
  88. package/dist/handlers/customer/index.d.ts +1 -0
  89. package/dist/handlers/customer/index.js +18 -0
  90. package/dist/handlers/customer/index.js.map +1 -0
  91. package/dist/handlers/index.d.ts +10 -0
  92. package/dist/handlers/index.js +37 -0
  93. package/dist/handlers/index.js.map +1 -0
  94. package/dist/handlers/inventory/attach-inventory-items.d.ts +16 -0
  95. package/dist/handlers/inventory/attach-inventory-items.js +23 -0
  96. package/dist/handlers/inventory/attach-inventory-items.js.map +1 -0
  97. package/dist/handlers/inventory/create-inventory-items.d.ts +17 -0
  98. package/dist/handlers/inventory/create-inventory-items.js +31 -0
  99. package/dist/handlers/inventory/create-inventory-items.js.map +1 -0
  100. package/dist/handlers/inventory/detach-inventory-items.d.ts +16 -0
  101. package/dist/handlers/inventory/detach-inventory-items.js +22 -0
  102. package/dist/handlers/inventory/detach-inventory-items.js.map +1 -0
  103. package/dist/handlers/inventory/index.d.ts +5 -0
  104. package/dist/handlers/inventory/index.js +22 -0
  105. package/dist/handlers/inventory/index.js.map +1 -0
  106. package/dist/handlers/inventory/remove-inventory-items.d.ts +14 -0
  107. package/dist/handlers/inventory/remove-inventory-items.js +18 -0
  108. package/dist/handlers/inventory/remove-inventory-items.js.map +1 -0
  109. package/dist/handlers/inventory/restore-inventory-items.d.ts +12 -0
  110. package/dist/handlers/inventory/restore-inventory-items.js +18 -0
  111. package/dist/handlers/inventory/restore-inventory-items.js.map +1 -0
  112. package/dist/handlers/middlewares/create-products-prepare-create-prices-compensation.d.ts +26 -0
  113. package/dist/handlers/middlewares/create-products-prepare-create-prices-compensation.js +31 -0
  114. package/dist/handlers/middlewares/create-products-prepare-create-prices-compensation.js.map +1 -0
  115. package/dist/handlers/middlewares/extract-variants.d.ts +18 -0
  116. package/dist/handlers/middlewares/extract-variants.js +23 -0
  117. package/dist/handlers/middlewares/extract-variants.js.map +1 -0
  118. package/dist/handlers/middlewares/index.d.ts +6 -0
  119. package/dist/handlers/middlewares/index.js +23 -0
  120. package/dist/handlers/middlewares/index.js.map +1 -0
  121. package/dist/handlers/middlewares/map-data.d.ts +11 -0
  122. package/dist/handlers/middlewares/map-data.js +19 -0
  123. package/dist/handlers/middlewares/map-data.js.map +1 -0
  124. package/dist/handlers/middlewares/update-products-extract-created-variants.d.ts +19 -0
  125. package/dist/handlers/middlewares/update-products-extract-created-variants.js +27 -0
  126. package/dist/handlers/middlewares/update-products-extract-created-variants.js.map +1 -0
  127. package/dist/handlers/middlewares/update-products-extract-deleted-variants.d.ts +19 -0
  128. package/dist/handlers/middlewares/update-products-extract-deleted-variants.js +29 -0
  129. package/dist/handlers/middlewares/update-products-extract-deleted-variants.js.map +1 -0
  130. package/dist/handlers/middlewares/use-variants-inventory-items.d.ts +24 -0
  131. package/dist/handlers/middlewares/use-variants-inventory-items.js +31 -0
  132. package/dist/handlers/middlewares/use-variants-inventory-items.js.map +1 -0
  133. package/dist/handlers/price-list/create-price-list.d.ts +18 -0
  134. package/dist/handlers/price-list/create-price-list.js +18 -0
  135. package/dist/handlers/price-list/create-price-list.js.map +1 -0
  136. package/dist/handlers/price-list/index.d.ts +10 -0
  137. package/dist/handlers/price-list/index.js +27 -0
  138. package/dist/handlers/price-list/index.js.map +1 -0
  139. package/dist/handlers/price-list/prepare-create-price-list.d.ts +17 -0
  140. package/dist/handlers/price-list/prepare-create-price-list.js +57 -0
  141. package/dist/handlers/price-list/prepare-create-price-list.js.map +1 -0
  142. package/dist/handlers/price-list/prepare-remove-price-list-prices.d.ts +15 -0
  143. package/dist/handlers/price-list/prepare-remove-price-list-prices.js +23 -0
  144. package/dist/handlers/price-list/prepare-remove-price-list-prices.js.map +1 -0
  145. package/dist/handlers/price-list/prepare-remove-product-prices.d.ts +10 -0
  146. package/dist/handlers/price-list/prepare-remove-product-prices.js +35 -0
  147. package/dist/handlers/price-list/prepare-remove-product-prices.js.map +1 -0
  148. package/dist/handlers/price-list/prepare-remove-variant-prices.d.ts +10 -0
  149. package/dist/handlers/price-list/prepare-remove-variant-prices.js +33 -0
  150. package/dist/handlers/price-list/prepare-remove-variant-prices.js.map +1 -0
  151. package/dist/handlers/price-list/prepare-update-price-lists.d.ts +15 -0
  152. package/dist/handlers/price-list/prepare-update-price-lists.js +58 -0
  153. package/dist/handlers/price-list/prepare-update-price-lists.js.map +1 -0
  154. package/dist/handlers/price-list/remove-price-list.d.ts +14 -0
  155. package/dist/handlers/price-list/remove-price-list.js +14 -0
  156. package/dist/handlers/price-list/remove-price-list.js.map +1 -0
  157. package/dist/handlers/price-list/remove-price-set-price-list-prices.d.ts +5 -0
  158. package/dist/handlers/price-list/remove-price-set-price-list-prices.js +25 -0
  159. package/dist/handlers/price-list/remove-price-set-price-list-prices.js.map +1 -0
  160. package/dist/handlers/price-list/remove-prices.d.ts +13 -0
  161. package/dist/handlers/price-list/remove-prices.js +17 -0
  162. package/dist/handlers/price-list/remove-prices.js.map +1 -0
  163. package/dist/handlers/price-list/update-price-lists.d.ts +15 -0
  164. package/dist/handlers/price-list/update-price-lists.js +38 -0
  165. package/dist/handlers/price-list/update-price-lists.js.map +1 -0
  166. package/dist/handlers/product/attach-sales-channel-to-products.d.ts +18 -0
  167. package/dist/handlers/product/attach-sales-channel-to-products.js +30 -0
  168. package/dist/handlers/product/attach-sales-channel-to-products.js.map +1 -0
  169. package/dist/handlers/product/attach-shipping-profile-to-products.d.ts +18 -0
  170. package/dist/handlers/product/attach-shipping-profile-to-products.js +28 -0
  171. package/dist/handlers/product/attach-shipping-profile-to-products.js.map +1 -0
  172. package/dist/handlers/product/create-product-variants-prepare-data.d.ts +21 -0
  173. package/dist/handlers/product/create-product-variants-prepare-data.js +35 -0
  174. package/dist/handlers/product/create-product-variants-prepare-data.js.map +1 -0
  175. package/dist/handlers/product/create-product-variants.d.ts +23 -0
  176. package/dist/handlers/product/create-product-variants.js +22 -0
  177. package/dist/handlers/product/create-product-variants.js.map +1 -0
  178. package/dist/handlers/product/create-products-prepare-data.d.ts +28 -0
  179. package/dist/handlers/product/create-products-prepare-data.js +77 -0
  180. package/dist/handlers/product/create-products-prepare-data.js.map +1 -0
  181. package/dist/handlers/product/create-products.d.ts +12 -0
  182. package/dist/handlers/product/create-products.js +14 -0
  183. package/dist/handlers/product/create-products.js.map +1 -0
  184. package/dist/handlers/product/detach-sales-channel-from-products.d.ts +18 -0
  185. package/dist/handlers/product/detach-sales-channel-from-products.js +30 -0
  186. package/dist/handlers/product/detach-sales-channel-from-products.js.map +1 -0
  187. package/dist/handlers/product/detach-shipping-profile-from-products.d.ts +18 -0
  188. package/dist/handlers/product/detach-shipping-profile-from-products.js +28 -0
  189. package/dist/handlers/product/detach-shipping-profile-from-products.js.map +1 -0
  190. package/dist/handlers/product/index.d.ts +19 -0
  191. package/dist/handlers/product/index.js +36 -0
  192. package/dist/handlers/product/index.js.map +1 -0
  193. package/dist/handlers/product/list-products.d.ts +13 -0
  194. package/dist/handlers/product/list-products.js +31 -0
  195. package/dist/handlers/product/list-products.js.map +1 -0
  196. package/dist/handlers/product/remove-product-variants.d.ts +13 -0
  197. package/dist/handlers/product/remove-product-variants.js +16 -0
  198. package/dist/handlers/product/remove-product-variants.js.map +1 -0
  199. package/dist/handlers/product/remove-products.d.ts +13 -0
  200. package/dist/handlers/product/remove-products.js +16 -0
  201. package/dist/handlers/product/remove-products.js.map +1 -0
  202. package/dist/handlers/product/revert-update-products.d.ts +14 -0
  203. package/dist/handlers/product/revert-update-products.js +20 -0
  204. package/dist/handlers/product/revert-update-products.js.map +1 -0
  205. package/dist/handlers/product/revert-variant-prices.d.ts +14 -0
  206. package/dist/handlers/product/revert-variant-prices.js +28 -0
  207. package/dist/handlers/product/revert-variant-prices.js.map +1 -0
  208. package/dist/handlers/product/update-product-variants-prepare-data.d.ts +21 -0
  209. package/dist/handlers/product/update-product-variants-prepare-data.js +48 -0
  210. package/dist/handlers/product/update-product-variants-prepare-data.js.map +1 -0
  211. package/dist/handlers/product/update-product-variants.d.ts +12 -0
  212. package/dist/handlers/product/update-product-variants.js +23 -0
  213. package/dist/handlers/product/update-product-variants.js.map +1 -0
  214. package/dist/handlers/product/update-products-prepare-data.d.ts +25 -0
  215. package/dist/handlers/product/update-products-prepare-data.js +65 -0
  216. package/dist/handlers/product/update-products-prepare-data.js.map +1 -0
  217. package/dist/handlers/product/update-products-variants-prices.d.ts +18 -0
  218. package/dist/handlers/product/update-products-variants-prices.js +90 -0
  219. package/dist/handlers/product/update-products-variants-prices.js.map +1 -0
  220. package/dist/handlers/product/update-products.d.ts +12 -0
  221. package/dist/handlers/product/update-products.js +29 -0
  222. package/dist/handlers/product/update-products.js.map +1 -0
  223. package/dist/handlers/product/upsert-variant-prices.d.ts +25 -0
  224. package/dist/handlers/product/upsert-variant-prices.js +122 -0
  225. package/dist/handlers/product/upsert-variant-prices.js.map +1 -0
  226. package/dist/handlers/region/find-region.d.ts +17 -0
  227. package/dist/handlers/region/find-region.js +29 -0
  228. package/dist/handlers/region/find-region.js.map +1 -0
  229. package/dist/handlers/region/index.d.ts +1 -0
  230. package/dist/handlers/region/index.js +18 -0
  231. package/dist/handlers/region/index.js.map +1 -0
  232. package/dist/handlers/sales-channel/find-sales-channel.d.ts +20 -0
  233. package/dist/handlers/sales-channel/find-sales-channel.js +41 -0
  234. package/dist/handlers/sales-channel/find-sales-channel.js.map +1 -0
  235. package/dist/handlers/sales-channel/index.d.ts +1 -0
  236. package/dist/handlers/sales-channel/index.js +18 -0
  237. package/dist/handlers/sales-channel/index.js.map +1 -0
  238. package/dist/index.d.ts +3 -0
  239. package/dist/index.js +33 -0
  240. package/dist/index.js.map +1 -0
  241. package/package.json +42 -0
@@ -0,0 +1,9 @@
1
+ import { CartWorkflow } from "@medusajs/types";
2
+ type CreateCartWorkflowOutput = Record<any, any>;
3
+ export declare const createCart: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
4
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
5
+ __definition: import("@medusajs/types").ModuleDefinition;
6
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
7
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? CartWorkflow.CreateCartWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? CreateCartWorkflowOutput : TResultOverride>>;
8
+ };
9
+ export {};
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCart = void 0;
4
+ const orchestration_1 = require("@medusajs/orchestration");
5
+ const definitions_1 = require("../../definitions");
6
+ const handlers_1 = require("../../handlers");
7
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
8
+ var CreateCartActions;
9
+ (function (CreateCartActions) {
10
+ CreateCartActions["setContext"] = "setContext";
11
+ CreateCartActions["attachLineItems"] = "attachLineItems";
12
+ CreateCartActions["findRegion"] = "findRegion";
13
+ CreateCartActions["findSalesChannel"] = "findSalesChannel";
14
+ CreateCartActions["createCart"] = "createCart";
15
+ CreateCartActions["findOrCreateAddresses"] = "findOrCreateAddresses";
16
+ CreateCartActions["findOrCreateCustomer"] = "findOrCreateCustomer";
17
+ CreateCartActions["removeCart"] = "removeCart";
18
+ CreateCartActions["removeAddresses"] = "removeAddresses";
19
+ })(CreateCartActions || (CreateCartActions = {}));
20
+ const workflowAlias = "cart";
21
+ const getWorkflowInput = (alias = workflowAlias) => ({
22
+ inputAlias: workflowAlias,
23
+ invoke: {
24
+ from: workflowAlias,
25
+ alias,
26
+ },
27
+ });
28
+ const workflowSteps = {
29
+ next: [
30
+ {
31
+ action: CreateCartActions.findOrCreateCustomer,
32
+ noCompensation: true,
33
+ },
34
+ {
35
+ action: CreateCartActions.findSalesChannel,
36
+ noCompensation: true,
37
+ },
38
+ {
39
+ action: CreateCartActions.setContext,
40
+ noCompensation: true,
41
+ },
42
+ {
43
+ action: CreateCartActions.findRegion,
44
+ noCompensation: true,
45
+ next: {
46
+ action: CreateCartActions.findOrCreateAddresses,
47
+ noCompensation: true,
48
+ next: {
49
+ action: CreateCartActions.createCart,
50
+ next: {
51
+ action: CreateCartActions.attachLineItems,
52
+ noCompensation: true,
53
+ },
54
+ },
55
+ },
56
+ },
57
+ ],
58
+ };
59
+ const handlers = new Map([
60
+ [
61
+ CreateCartActions.findOrCreateCustomer,
62
+ {
63
+ invoke: (0, workflows_sdk_1.pipe)(getWorkflowInput(handlers_1.CustomerHandlers.findOrCreateCustomer.aliases.Customer), handlers_1.CustomerHandlers.findOrCreateCustomer),
64
+ },
65
+ ],
66
+ [
67
+ CreateCartActions.findSalesChannel,
68
+ {
69
+ invoke: (0, workflows_sdk_1.pipe)(getWorkflowInput(handlers_1.SalesChannelHandlers.findSalesChannel.aliases.SalesChannel), handlers_1.SalesChannelHandlers.findSalesChannel),
70
+ },
71
+ ],
72
+ [
73
+ CreateCartActions.setContext,
74
+ {
75
+ invoke: (0, workflows_sdk_1.pipe)(getWorkflowInput(handlers_1.CommonHandlers.setContext.aliases.Context), handlers_1.CommonHandlers.setContext),
76
+ },
77
+ ],
78
+ [
79
+ CreateCartActions.findRegion,
80
+ {
81
+ invoke: (0, workflows_sdk_1.pipe)(getWorkflowInput(handlers_1.RegionHandlers.findRegion.aliases.Region), handlers_1.RegionHandlers.findRegion),
82
+ },
83
+ ],
84
+ [
85
+ CreateCartActions.findOrCreateAddresses,
86
+ {
87
+ invoke: (0, workflows_sdk_1.pipe)({
88
+ invoke: [
89
+ getWorkflowInput(handlers_1.AddressHandlers.findOrCreateAddresses.aliases.Addresses).invoke,
90
+ {
91
+ from: CreateCartActions.findRegion,
92
+ alias: handlers_1.AddressHandlers.findOrCreateAddresses.aliases.Region,
93
+ },
94
+ ],
95
+ }, handlers_1.AddressHandlers.findOrCreateAddresses),
96
+ },
97
+ ],
98
+ [
99
+ CreateCartActions.createCart,
100
+ {
101
+ invoke: (0, workflows_sdk_1.pipe)({
102
+ invoke: [
103
+ {
104
+ from: CreateCartActions.findRegion,
105
+ alias: handlers_1.CartHandlers.createCart.aliases.Region,
106
+ },
107
+ {
108
+ from: CreateCartActions.setContext,
109
+ alias: handlers_1.CartHandlers.createCart.aliases.Context,
110
+ },
111
+ {
112
+ from: CreateCartActions.findOrCreateCustomer,
113
+ alias: handlers_1.CartHandlers.createCart.aliases.Customer,
114
+ },
115
+ {
116
+ from: CreateCartActions.findOrCreateAddresses,
117
+ alias: handlers_1.CartHandlers.createCart.aliases.Addresses,
118
+ },
119
+ ],
120
+ }, handlers_1.CartHandlers.createCart),
121
+ compensate: (0, workflows_sdk_1.pipe)({
122
+ invoke: [
123
+ {
124
+ from: CreateCartActions.createCart,
125
+ alias: handlers_1.CartHandlers.removeCart.aliases.Cart,
126
+ },
127
+ ],
128
+ }, handlers_1.CartHandlers.removeCart),
129
+ },
130
+ ],
131
+ [
132
+ CreateCartActions.attachLineItems,
133
+ {
134
+ invoke: (0, workflows_sdk_1.pipe)({
135
+ invoke: [
136
+ getWorkflowInput(handlers_1.CartHandlers.attachLineItemsToCart.aliases.LineItems).invoke,
137
+ {
138
+ from: CreateCartActions.createCart,
139
+ alias: handlers_1.CartHandlers.attachLineItemsToCart.aliases.Cart,
140
+ },
141
+ ],
142
+ }, handlers_1.CartHandlers.attachLineItemsToCart),
143
+ },
144
+ ],
145
+ ]);
146
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.CreateCart, workflowSteps, handlers);
147
+ exports.createCart = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.CreateCart, CreateCartActions.createCart);
148
+ //# sourceMappingURL=create-cart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-cart.js","sourceRoot":"","sources":["../../../src/definition/cart/create-cart.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export * from "./create-cart";
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-cart"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/cart/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,4 @@
1
+ export * from "./cart";
2
+ export * from "./product";
3
+ export * from "./inventory";
4
+ export * from "./price-list";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cart"), exports);
18
+ __exportStar(require("./product"), exports);
19
+ __exportStar(require("./inventory"), exports);
20
+ __exportStar(require("./price-list"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,4CAAyB;AACzB,8CAA2B;AAC3B,+CAA4B"}
@@ -0,0 +1,14 @@
1
+ import { InventoryTypes, WorkflowTypes } from "@medusajs/types";
2
+ export declare enum CreateInventoryItemActions {
3
+ prepare = "prepare",
4
+ createInventoryItems = "createInventoryItems"
5
+ }
6
+ export declare const createInventoryItems: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
7
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
8
+ __definition: import("@medusajs/types").ModuleDefinition;
9
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
10
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? {
11
+ tag: string;
12
+ inventoryItem: InventoryTypes.InventoryItemDTO;
13
+ }[] : TResultOverride>>;
14
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInventoryItems = exports.CreateInventoryItemActions = void 0;
4
+ const definitions_1 = require("../../definitions");
5
+ const orchestration_1 = require("@medusajs/orchestration");
6
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
7
+ const handlers_1 = require("../../handlers");
8
+ var CreateInventoryItemActions;
9
+ (function (CreateInventoryItemActions) {
10
+ CreateInventoryItemActions["prepare"] = "prepare";
11
+ CreateInventoryItemActions["createInventoryItems"] = "createInventoryItems";
12
+ })(CreateInventoryItemActions || (exports.CreateInventoryItemActions = CreateInventoryItemActions = {}));
13
+ const workflowSteps = {
14
+ next: {
15
+ action: CreateInventoryItemActions.createInventoryItems,
16
+ },
17
+ };
18
+ const handlers = new Map([
19
+ [
20
+ CreateInventoryItemActions.createInventoryItems,
21
+ {
22
+ invoke: (0, workflows_sdk_1.pipe)({
23
+ inputAlias: CreateInventoryItemActions.prepare,
24
+ merge: true,
25
+ invoke: {
26
+ from: CreateInventoryItemActions.prepare,
27
+ },
28
+ }, handlers_1.InventoryHandlers.createInventoryItems),
29
+ compensate: (0, workflows_sdk_1.pipe)({
30
+ merge: true,
31
+ invoke: {
32
+ from: CreateInventoryItemActions.createInventoryItems,
33
+ alias: handlers_1.InventoryHandlers.removeInventoryItems.aliases.inventoryItems,
34
+ },
35
+ }, handlers_1.InventoryHandlers.removeInventoryItems),
36
+ },
37
+ ],
38
+ ]);
39
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.CreateInventoryItems, workflowSteps, handlers);
40
+ exports.createInventoryItems = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.CreateInventoryItems, CreateInventoryItemActions.createInventoryItems, async (data) => data);
41
+ //# sourceMappingURL=create-inventory-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-inventory-item.js","sourceRoot":"","sources":["../../../src/definition/inventory/create-inventory-item.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,2DAGgC;AAChC,2DAA8D;AAG9D,6CAAkD;AAElD,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,iDAAmB,CAAA;IACnB,2EAA6C,CAAA;AAC/C,CAAC,EAHW,0BAA0B,0CAA1B,0BAA0B,QAGrC;AAED,MAAM,aAAa,GAA+B;IAChD,IAAI,EAAE;QACJ,MAAM,EAAE,0BAA0B,CAAC,oBAAoB;KACxD;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB;QACE,0BAA0B,CAAC,oBAAoB;QAC/C;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,UAAU,EAAE,0BAA0B,CAAC,OAAO;gBAC9C,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,0BAA0B,CAAC,OAAO;iBACzC;aACF,EACD,4BAAiB,CAAC,oBAAoB,CACvC;YACD,UAAU,EAAE,IAAA,oBAAI,EACd;gBACE,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,0BAA0B,CAAC,oBAAoB;oBACrD,KAAK,EACH,4BAAiB,CAAC,oBAAoB,CAAC,OAAO,CAAC,cAAc;iBAChE;aACF,EACD,4BAAiB,CAAC,oBAAoB,CACvC;SACF;KACF;CACF,CAAC,CAAA;AAEF,+BAAe,CAAC,QAAQ,CACtB,uBAAS,CAAC,oBAAoB,EAC9B,aAAa,EACb,QAAQ,CACT,CAAA;AAEY,QAAA,oBAAoB,GAAG,IAAA,8BAAc,EAIhD,uBAAS,CAAC,oBAAoB,EAC9B,0BAA0B,CAAC,oBAAoB,EAC/C,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CACrB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from "./create-inventory-item";
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-inventory-item"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/inventory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"}
@@ -0,0 +1,13 @@
1
+ import { PricingTypes, WorkflowTypes } from "@medusajs/types";
2
+ export declare enum CreatePriceListActions {
3
+ prepare = "prepare",
4
+ createPriceList = "createPriceList"
5
+ }
6
+ export declare const createPriceLists: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
7
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
8
+ __definition: import("@medusajs/types").ModuleDefinition;
9
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
10
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.PriceListWorkflow.CreatePriceListWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? {
11
+ priceList: PricingTypes.CreatePriceListDTO;
12
+ }[] : TResultOverride>>;
13
+ };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPriceLists = exports.CreatePriceListActions = void 0;
4
+ const orchestration_1 = require("@medusajs/orchestration");
5
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
6
+ const definitions_1 = require("../../definitions");
7
+ const handlers_1 = require("../../handlers");
8
+ var CreatePriceListActions;
9
+ (function (CreatePriceListActions) {
10
+ CreatePriceListActions["prepare"] = "prepare";
11
+ CreatePriceListActions["createPriceList"] = "createPriceList";
12
+ })(CreatePriceListActions || (exports.CreatePriceListActions = CreatePriceListActions = {}));
13
+ const workflowSteps = {
14
+ next: {
15
+ action: CreatePriceListActions.prepare,
16
+ noCompensation: true,
17
+ next: {
18
+ action: CreatePriceListActions.createPriceList,
19
+ },
20
+ },
21
+ };
22
+ const handlers = new Map([
23
+ [
24
+ CreatePriceListActions.prepare,
25
+ {
26
+ invoke: (0, workflows_sdk_1.pipe)({
27
+ inputAlias: CreatePriceListActions.prepare,
28
+ merge: true,
29
+ invoke: {
30
+ from: CreatePriceListActions.prepare,
31
+ },
32
+ }, handlers_1.PriceListHandlers.prepareCreatePriceLists),
33
+ },
34
+ ],
35
+ [
36
+ CreatePriceListActions.createPriceList,
37
+ {
38
+ invoke: (0, workflows_sdk_1.pipe)({
39
+ invoke: {
40
+ from: CreatePriceListActions.prepare,
41
+ alias: handlers_1.PriceListHandlers.createPriceLists.aliases.priceLists,
42
+ },
43
+ }, handlers_1.PriceListHandlers.createPriceLists),
44
+ compensate: (0, workflows_sdk_1.pipe)({
45
+ invoke: {
46
+ from: CreatePriceListActions.createPriceList,
47
+ alias: handlers_1.PriceListHandlers.removePriceLists.aliases.priceLists,
48
+ },
49
+ }, handlers_1.PriceListHandlers.removePriceLists),
50
+ },
51
+ ],
52
+ ]);
53
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.CreatePriceList, workflowSteps, handlers);
54
+ exports.createPriceLists = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.CreatePriceList, CreatePriceListActions.createPriceList);
55
+ //# sourceMappingURL=create-price-lists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-price-lists.js","sourceRoot":"","sources":["../../../src/definition/price-list/create-price-lists.ts"],"names":[],"mappings":";;;AAAA,2DAGgC;AAEhC,2DAA8D;AAE9D,mDAA6C;AAC7C,6CAAkD;AAElD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,6DAAmC,CAAA;AACrC,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AAED,MAAM,aAAa,GAA+B;IAChD,IAAI,EAAE;QACJ,MAAM,EAAE,sBAAsB,CAAC,OAAO;QACtC,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE;YACJ,MAAM,EAAE,sBAAsB,CAAC,eAAe;SAC/C;KACF;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB;QACE,sBAAsB,CAAC,OAAO;QAC9B;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,UAAU,EAAE,sBAAsB,CAAC,OAAO;gBAC1C,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,sBAAsB,CAAC,OAAO;iBACrC;aACF,EACD,4BAAiB,CAAC,uBAAuB,CAC1C;SACF;KACF;IACD;QACE,sBAAsB,CAAC,eAAe;QACtC;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,MAAM,EAAE;oBACN,IAAI,EAAE,sBAAsB,CAAC,OAAO;oBACpC,KAAK,EAAE,4BAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAU;iBAC7D;aACF,EACD,4BAAiB,CAAC,gBAAgB,CACnC;YACD,UAAU,EAAE,IAAA,oBAAI,EACd;gBACE,MAAM,EAAE;oBACN,IAAI,EAAE,sBAAsB,CAAC,eAAe;oBAC5C,KAAK,EAAE,4BAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAU;iBAC7D;aACF,EACD,4BAAiB,CAAC,gBAAgB,CACnC;SACF;KACF;CACF,CAAC,CAAA;AAEF,+BAAe,CAAC,QAAQ,CAAC,uBAAS,CAAC,eAAe,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAA;AAE/D,QAAA,gBAAgB,GAAG,IAAA,8BAAc,EAK5C,uBAAS,CAAC,eAAe,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from "./create-price-lists";
2
+ export * from "./remove-price-lists";
3
+ export * from "./remove-price-list-prices";
4
+ export * from "./remove-product-prices";
5
+ export * from "./remove-variant-prices";
6
+ export * from "./update-price-lists";
@@ -0,0 +1,23 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-price-lists"), exports);
18
+ __exportStar(require("./remove-price-lists"), exports);
19
+ __exportStar(require("./remove-price-list-prices"), exports);
20
+ __exportStar(require("./remove-product-prices"), exports);
21
+ __exportStar(require("./remove-variant-prices"), exports);
22
+ __exportStar(require("./update-price-lists"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/price-list/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,uDAAoC;AACpC,6DAA0C;AAC1C,0DAAuC;AACvC,0DAAuC;AACvC,uDAAoC"}
@@ -0,0 +1,11 @@
1
+ import { WorkflowTypes } from "@medusajs/types";
2
+ export declare enum RemovePriceListPricesActions {
3
+ prepare = "prepare",
4
+ removePriceListPrices = "removePriceListPrices"
5
+ }
6
+ export declare const removePriceListPrices: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
7
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
8
+ __definition: import("@medusajs/types").ModuleDefinition;
9
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
10
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.PriceListWorkflow.RemovePriceListPricesWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? string[] : TResultOverride>>;
11
+ };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removePriceListPrices = exports.RemovePriceListPricesActions = void 0;
4
+ const orchestration_1 = require("@medusajs/orchestration");
5
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
6
+ const definitions_1 = require("../../definitions");
7
+ const handlers_1 = require("../../handlers");
8
+ var RemovePriceListPricesActions;
9
+ (function (RemovePriceListPricesActions) {
10
+ RemovePriceListPricesActions["prepare"] = "prepare";
11
+ RemovePriceListPricesActions["removePriceListPrices"] = "removePriceListPrices";
12
+ })(RemovePriceListPricesActions || (exports.RemovePriceListPricesActions = RemovePriceListPricesActions = {}));
13
+ const workflowSteps = {
14
+ next: {
15
+ action: RemovePriceListPricesActions.prepare,
16
+ noCompensation: true,
17
+ next: {
18
+ action: RemovePriceListPricesActions.removePriceListPrices,
19
+ noCompensation: true,
20
+ },
21
+ },
22
+ };
23
+ const handlers = new Map([
24
+ [
25
+ RemovePriceListPricesActions.prepare,
26
+ {
27
+ invoke: (0, workflows_sdk_1.pipe)({
28
+ inputAlias: RemovePriceListPricesActions.prepare,
29
+ merge: true,
30
+ invoke: {
31
+ from: RemovePriceListPricesActions.prepare,
32
+ },
33
+ }, handlers_1.PriceListHandlers.prepareRemovePriceListPrices),
34
+ },
35
+ ],
36
+ [
37
+ RemovePriceListPricesActions.removePriceListPrices,
38
+ {
39
+ invoke: (0, workflows_sdk_1.pipe)({
40
+ merge: true,
41
+ invoke: {
42
+ from: RemovePriceListPricesActions.prepare,
43
+ },
44
+ }, handlers_1.PriceListHandlers.removePrices),
45
+ },
46
+ ],
47
+ ]);
48
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.RemovePriceListPrices, workflowSteps, handlers);
49
+ exports.removePriceListPrices = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.RemovePriceListPrices, RemovePriceListPricesActions.removePriceListPrices);
50
+ //# sourceMappingURL=remove-price-list-prices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-price-list-prices.js","sourceRoot":"","sources":["../../../src/definition/price-list/remove-price-list-prices.ts"],"names":[],"mappings":";;;AAAA,2DAGgC;AAEhC,2DAA8D;AAE9D,mDAA6C;AAC7C,6CAAkD;AAElD,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,+EAA+C,CAAA;AACjD,CAAC,EAHW,4BAA4B,4CAA5B,4BAA4B,QAGvC;AAED,MAAM,aAAa,GAA+B;IAChD,IAAI,EAAE;QACJ,MAAM,EAAE,4BAA4B,CAAC,OAAO;QAC5C,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE;YACJ,MAAM,EAAE,4BAA4B,CAAC,qBAAqB;YAC1D,cAAc,EAAE,IAAI;SACrB;KACF;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB;QACE,4BAA4B,CAAC,OAAO;QACpC;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,UAAU,EAAE,4BAA4B,CAAC,OAAO;gBAChD,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,4BAA4B,CAAC,OAAO;iBAC3C;aACF,EACD,4BAAiB,CAAC,4BAA4B,CAC/C;SACF;KACF;IACD;QACE,4BAA4B,CAAC,qBAAqB;QAClD;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,4BAA4B,CAAC,OAAO;iBAC3C;aACF,EACD,4BAAiB,CAAC,YAAY,CAC/B;SACF;KACF;CACF,CAAC,CAAA;AAEF,+BAAe,CAAC,QAAQ,CACtB,uBAAS,CAAC,qBAAqB,EAC/B,aAAa,EACb,QAAQ,CACT,CAAA;AAEY,QAAA,qBAAqB,GAAG,IAAA,8BAAc,EAIjD,uBAAS,CAAC,qBAAqB,EAC/B,4BAA4B,CAAC,qBAAqB,CACnD,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { WorkflowTypes } from "@medusajs/types";
2
+ export declare enum RemovePriceListActions {
3
+ removePriceList = "removePriceList"
4
+ }
5
+ export declare const removePriceLists: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
6
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
7
+ __definition: import("@medusajs/types").ModuleDefinition;
8
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
9
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.PriceListWorkflow.RemovePriceListWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? {
10
+ price_list_ids: string[];
11
+ } : TResultOverride>>;
12
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removePriceLists = exports.RemovePriceListActions = void 0;
4
+ const orchestration_1 = require("@medusajs/orchestration");
5
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
6
+ const handlers_1 = require("../../handlers");
7
+ const definitions_1 = require("../../definitions");
8
+ var RemovePriceListActions;
9
+ (function (RemovePriceListActions) {
10
+ RemovePriceListActions["removePriceList"] = "removePriceList";
11
+ })(RemovePriceListActions || (exports.RemovePriceListActions = RemovePriceListActions = {}));
12
+ const workflowSteps = {
13
+ next: {
14
+ action: RemovePriceListActions.removePriceList,
15
+ noCompensation: true,
16
+ },
17
+ };
18
+ const handlers = new Map([
19
+ [
20
+ RemovePriceListActions.removePriceList,
21
+ {
22
+ invoke: (0, workflows_sdk_1.pipe)({
23
+ inputAlias: RemovePriceListActions.removePriceList,
24
+ merge: true,
25
+ invoke: {
26
+ from: RemovePriceListActions.removePriceList,
27
+ },
28
+ }, handlers_1.PriceListHandlers.removePriceLists),
29
+ },
30
+ ],
31
+ ]);
32
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.DeletePriceLists, workflowSteps, handlers);
33
+ exports.removePriceLists = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.DeletePriceLists, RemovePriceListActions.removePriceList, async (data) => {
34
+ return {
35
+ price_lists: data.price_lists.map((priceListId) => ({
36
+ price_list: { id: priceListId },
37
+ })),
38
+ };
39
+ });
40
+ //# sourceMappingURL=remove-price-lists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-price-lists.js","sourceRoot":"","sources":["../../../src/definition/price-list/remove-price-lists.ts"],"names":[],"mappings":";;;AACA,2DAGgC;AAChC,2DAA8D;AAE9D,6CAAkD;AAClD,mDAA6C;AAE7C,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;AACrC,CAAC,EAFW,sBAAsB,sCAAtB,sBAAsB,QAEjC;AAED,MAAM,aAAa,GAA+B;IAChD,IAAI,EAAE;QACJ,MAAM,EAAE,sBAAsB,CAAC,eAAe;QAC9C,cAAc,EAAE,IAAI;KACrB;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB;QACE,sBAAsB,CAAC,eAAe;QACtC;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,UAAU,EAAE,sBAAsB,CAAC,eAAe;gBAClD,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,sBAAsB,CAAC,eAAe;iBAC7C;aACF,EACD,4BAAiB,CAAC,gBAAgB,CACnC;SACF;KACF;CACF,CAAC,CAAA;AAEF,+BAAe,CAAC,QAAQ,CAAC,uBAAS,CAAC,gBAAgB,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAA;AAEhE,QAAA,gBAAgB,GAAG,IAAA,8BAAc,EAM5C,uBAAS,CAAC,gBAAgB,EAC1B,sBAAsB,CAAC,eAAe,EACtC,KAAK,EAAE,IAAI,EAAE,EAAE;IACb,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAClD,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;SAChC,CAAC,CAAC;KACJ,CAAA;AACH,CAAC,CACF,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { WorkflowTypes } from "@medusajs/types";
2
+ export declare enum RemoveProductPricesActions {
3
+ prepare = "prepare",
4
+ removePriceListPriceSetPrices = "removePriceListPriceSetPrices"
5
+ }
6
+ export declare const removePriceListProductPrices: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
7
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
8
+ __definition: import("@medusajs/types").ModuleDefinition;
9
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
10
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.PriceListWorkflow.RemovePriceListProductsWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? string[] : TResultOverride>>;
11
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removePriceListProductPrices = exports.RemoveProductPricesActions = void 0;
4
+ const orchestration_1 = require("@medusajs/orchestration");
5
+ const workflows_sdk_1 = require("@medusajs/workflows-sdk");
6
+ const definitions_1 = require("../../definitions");
7
+ const handlers_1 = require("../../handlers");
8
+ var RemoveProductPricesActions;
9
+ (function (RemoveProductPricesActions) {
10
+ RemoveProductPricesActions["prepare"] = "prepare";
11
+ RemoveProductPricesActions["removePriceListPriceSetPrices"] = "removePriceListPriceSetPrices";
12
+ })(RemoveProductPricesActions || (exports.RemoveProductPricesActions = RemoveProductPricesActions = {}));
13
+ const workflowSteps = {
14
+ next: {
15
+ action: RemoveProductPricesActions.prepare,
16
+ noCompensation: true,
17
+ next: {
18
+ action: RemoveProductPricesActions.removePriceListPriceSetPrices,
19
+ noCompensation: true,
20
+ },
21
+ },
22
+ };
23
+ const handlers = new Map([
24
+ [
25
+ RemoveProductPricesActions.prepare,
26
+ {
27
+ invoke: (0, workflows_sdk_1.pipe)({
28
+ inputAlias: RemoveProductPricesActions.prepare,
29
+ merge: true,
30
+ invoke: {
31
+ from: RemoveProductPricesActions.prepare,
32
+ },
33
+ }, handlers_1.PriceListHandlers.prepareRemoveProductPrices),
34
+ },
35
+ ],
36
+ [
37
+ RemoveProductPricesActions.removePriceListPriceSetPrices,
38
+ {
39
+ invoke: (0, workflows_sdk_1.pipe)({
40
+ merge: true,
41
+ invoke: {
42
+ from: RemoveProductPricesActions.prepare,
43
+ alias: handlers_1.PriceListHandlers.createPriceLists.aliases.priceLists,
44
+ },
45
+ }, handlers_1.PriceListHandlers.removePriceListPriceSetPrices),
46
+ },
47
+ ],
48
+ ]);
49
+ orchestration_1.WorkflowManager.register(definitions_1.Workflows.RemovePriceListProductPrices, workflowSteps, handlers);
50
+ exports.removePriceListProductPrices = (0, workflows_sdk_1.exportWorkflow)(definitions_1.Workflows.RemovePriceListProductPrices, RemoveProductPricesActions.removePriceListPriceSetPrices);
51
+ //# sourceMappingURL=remove-product-prices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-product-prices.js","sourceRoot":"","sources":["../../../src/definition/price-list/remove-product-prices.ts"],"names":[],"mappings":";;;AAAA,2DAGgC;AAEhC,2DAA8D;AAE9D,mDAA6C;AAC7C,6CAAkD;AAElD,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,iDAAmB,CAAA;IACnB,6FAA+D,CAAA;AACjE,CAAC,EAHW,0BAA0B,0CAA1B,0BAA0B,QAGrC;AAED,MAAM,aAAa,GAA+B;IAChD,IAAI,EAAE;QACJ,MAAM,EAAE,0BAA0B,CAAC,OAAO;QAC1C,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE;YACJ,MAAM,EAAE,0BAA0B,CAAC,6BAA6B;YAChE,cAAc,EAAE,IAAI;SACrB;KACF;CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB;QACE,0BAA0B,CAAC,OAAO;QAClC;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,UAAU,EAAE,0BAA0B,CAAC,OAAO;gBAC9C,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,0BAA0B,CAAC,OAAO;iBACzC;aACF,EACD,4BAAiB,CAAC,0BAA0B,CAC7C;SACF;KACF;IACD;QACE,0BAA0B,CAAC,6BAA6B;QACxD;YACE,MAAM,EAAE,IAAA,oBAAI,EACV;gBACE,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,0BAA0B,CAAC,OAAO;oBACxC,KAAK,EAAE,4BAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAU;iBAC7D;aACF,EACD,4BAAiB,CAAC,6BAA6B,CAChD;SACF;KACF;CACF,CAAC,CAAA;AAEF,+BAAe,CAAC,QAAQ,CACtB,uBAAS,CAAC,4BAA4B,EACtC,aAAa,EACb,QAAQ,CACT,CAAA;AAEY,QAAA,4BAA4B,GAAG,IAAA,8BAAc,EAIxD,uBAAS,CAAC,4BAA4B,EACtC,0BAA0B,CAAC,6BAA6B,CACzD,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { WorkflowTypes } from "@medusajs/types";
2
+ export declare enum RemoveVariantPricesActions {
3
+ prepare = "prepare",
4
+ removePriceListPriceSetPrices = "removePriceListPriceSetPrices"
5
+ }
6
+ export declare const removePriceListVariantPrices: <TDataOverride = undefined, TResultOverride = undefined>(container?: import("@medusajs/types").MedusaContainer | {
7
+ __joinerConfig: import("@medusajs/types").ModuleJoinerConfig;
8
+ __definition: import("@medusajs/types").ModuleDefinition;
9
+ }[] | undefined) => Omit<import("@medusajs/orchestration").LocalWorkflow, "run"> & {
10
+ run: (args?: import("@medusajs/workflows-sdk").FlowRunOptions<TDataOverride extends undefined ? WorkflowTypes.PriceListWorkflow.RemovePriceListVariantsWorkflowInputDTO : TDataOverride> | undefined) => Promise<import("@medusajs/workflows-sdk").WorkflowResult<TResultOverride extends undefined ? string[] : TResultOverride>>;
11
+ };