@medusajs/core-flows 2.8.3-preview-20250521180140 → 2.8.3-preview-20250522000308

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.
@@ -1,4 +1,21 @@
1
- import { CartCreditLineDTO, CreateCartCreditLineDTO } from "@medusajs/framework/types";
1
+ import { CartCreditLineDTO, CreateCartCreditLinesWorkflowInput } from "@medusajs/framework/types";
2
2
  export declare const createCartCreditLinesWorkflowId = "create-cart-credit-lines";
3
- export declare const createCartCreditLinesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<CreateCartCreditLineDTO[], CartCreditLineDTO[], []>;
3
+ /**
4
+ * This workflow creates one or more credit lines for a cart.
5
+ *
6
+ * @example
7
+ * const { result } = await createCartCreditLinesWorkflow(container)
8
+ * .run({
9
+ * input: {
10
+ * cart_id: "cart_123",
11
+ * amount: 10,
12
+ * reference: "payment",
13
+ * reference_id: "payment_123",
14
+ * metadata: {
15
+ * key: "value",
16
+ * },
17
+ * }
18
+ * })
19
+ */
20
+ export declare const createCartCreditLinesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<CreateCartCreditLinesWorkflowInput, CartCreditLineDTO[], []>;
4
21
  //# sourceMappingURL=create-cart-credit-lines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-cart-credit-lines.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/create-cart-credit-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,2BAA2B,CAAA;AASlC,eAAO,MAAM,+BAA+B,6BAA6B,CAAA;AACzE,eAAO,MAAM,6BAA6B,gHAczC,CAAA"}
1
+ {"version":3,"file":"create-cart-credit-lines.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/create-cart-credit-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kCAAkC,EACnC,MAAM,2BAA2B,CAAA;AASlC,eAAO,MAAM,+BAA+B,6BAA6B,CAAA;AACzE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,6BAA6B,yHAczC,CAAA"}
@@ -5,6 +5,23 @@ const utils_1 = require("@medusajs/framework/utils");
5
5
  const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
6
6
  const create_entities_1 = require("../../common/steps/create-entities");
7
7
  exports.createCartCreditLinesWorkflowId = "create-cart-credit-lines";
8
+ /**
9
+ * This workflow creates one or more credit lines for a cart.
10
+ *
11
+ * @example
12
+ * const { result } = await createCartCreditLinesWorkflow(container)
13
+ * .run({
14
+ * input: {
15
+ * cart_id: "cart_123",
16
+ * amount: 10,
17
+ * reference: "payment",
18
+ * reference_id: "payment_123",
19
+ * metadata: {
20
+ * key: "value",
21
+ * },
22
+ * }
23
+ * })
24
+ */
8
25
  exports.createCartCreditLinesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createCartCreditLinesWorkflowId, (input) => {
9
26
  const creditLines = (0, create_entities_1.createEntitiesStep)({
10
27
  moduleRegistrationName: utils_1.Modules.CART,
@@ -1 +1 @@
1
- {"version":3,"file":"create-cart-credit-lines.js","sourceRoot":"","sources":["../../../src/cart/workflows/create-cart-credit-lines.ts"],"names":[],"mappings":";;;AAIA,qDAAmD;AACnD,qEAI0C;AAC1C,wEAAuE;AAE1D,QAAA,+BAA+B,GAAG,0BAA0B,CAAA;AAC5D,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CACE,KAA8C,EACP,EAAE;IACzC,MAAM,WAAW,GAAG,IAAA,oCAAkB,EAAC;QACrC,sBAAsB,EAAE,eAAO,CAAC,IAAI;QACpC,YAAY,EAAE,mBAAmB;QACjC,gBAAgB,EAAE,mBAAmB;QACrC,IAAI,EAAE,KAAK;KACZ,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CACF,CAAA"}
1
+ {"version":3,"file":"create-cart-credit-lines.js","sourceRoot":"","sources":["../../../src/cart/workflows/create-cart-credit-lines.ts"],"names":[],"mappings":";;;AAIA,qDAAmD;AACnD,qEAI0C;AAC1C,wEAAuE;AAE1D,QAAA,+BAA+B,GAAG,0BAA0B,CAAA;AACzE;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CACE,KAAuD,EAChB,EAAE;IACzC,MAAM,WAAW,GAAG,IAAA,oCAAkB,EAAC;QACrC,sBAAsB,EAAE,eAAO,CAAC,IAAI;QACpC,YAAY,EAAE,mBAAmB;QACjC,gBAAgB,EAAE,mBAAmB;QACrC,IAAI,EAAE,KAAK;KACZ,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CACF,CAAA"}
@@ -1,5 +1,11 @@
1
1
  export declare const deleteCartCreditLinesWorkflowId = "delete-cart-credit-lines";
2
+ /**
3
+ * This workflow deletes one or more credit lines from a cart.
4
+ */
2
5
  export declare const deleteCartCreditLinesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<{
6
+ /**
7
+ * The IDs of the credit lines to delete.
8
+ */
3
9
  id: string[];
4
10
  }, undefined, []>;
5
11
  //# sourceMappingURL=delete-cart-credit-lines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete-cart-credit-lines.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/delete-cart-credit-lines.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,+BAA+B,6BAA6B,CAAA;AACzE,eAAO,MAAM,6BAA6B;QAEb,MAAM,EAAE;iBAUpC,CAAA"}
1
+ {"version":3,"file":"delete-cart-credit-lines.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/delete-cart-credit-lines.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,+BAA+B,6BAA6B,CAAA;AACzE;;GAEG;AACH,eAAO,MAAM,6BAA6B;IAGtC;;OAEG;QACC,MAAM,EAAE;iBAWf,CAAA"}
@@ -5,6 +5,9 @@ const utils_1 = require("@medusajs/framework/utils");
5
5
  const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
6
6
  const delete_entities_1 = require("../../common/steps/delete-entities");
7
7
  exports.deleteCartCreditLinesWorkflowId = "delete-cart-credit-lines";
8
+ /**
9
+ * This workflow deletes one or more credit lines from a cart.
10
+ */
8
11
  exports.deleteCartCreditLinesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deleteCartCreditLinesWorkflowId, (input) => {
9
12
  (0, delete_entities_1.deleteEntitiesStep)({
10
13
  moduleRegistrationName: utils_1.Modules.CART,
@@ -1 +1 @@
1
- {"version":3,"file":"delete-cart-credit-lines.js","sourceRoot":"","sources":["../../../src/cart/workflows/delete-cart-credit-lines.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AACnD,qEAI0C;AAC1C,wEAAuE;AAE1D,QAAA,+BAA+B,GAAG,0BAA0B,CAAA;AAC5D,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CAAC,KAAqC,EAAE,EAAE;IACxC,IAAA,oCAAkB,EAAC;QACjB,sBAAsB,EAAE,eAAO,CAAC,IAAI;QACpC,YAAY,EAAE,uBAAuB;QACrC,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,KAAK,CAAC,EAAE;KACf,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,KAAK,CAAC,CAAC,CAAA;AACrC,CAAC,CACF,CAAA"}
1
+ {"version":3,"file":"delete-cart-credit-lines.js","sourceRoot":"","sources":["../../../src/cart/workflows/delete-cart-credit-lines.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AACnD,qEAI0C;AAC1C,wEAAuE;AAE1D,QAAA,+BAA+B,GAAG,0BAA0B,CAAA;AACzE;;GAEG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CAAC,KAKC,EAAE,EAAE;IACJ,IAAA,oCAAkB,EAAC;QACjB,sBAAsB,EAAE,eAAO,CAAC,IAAI;QACpC,YAAY,EAAE,uBAAuB;QACrC,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,KAAK,CAAC,EAAE;KACf,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,KAAK,CAAC,CAAC,CAAA;AACrC,CAAC,CACF,CAAA"}
@@ -1,5 +1,7 @@
1
+ export * from "./steps/create-entities";
1
2
  export * from "./steps/create-remote-links";
2
3
  export * from "./steps/dismiss-remote-links";
4
+ export * from "./steps/delete-entities";
3
5
  export * from "./steps/emit-event";
4
6
  export * from "./steps/remove-remote-links";
5
7
  export * from "./steps/update-remote-links";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA"}
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./steps/create-entities"), exports);
17
18
  __exportStar(require("./steps/create-remote-links"), exports);
18
19
  __exportStar(require("./steps/dismiss-remote-links"), exports);
20
+ __exportStar(require("./steps/delete-entities"), exports);
19
21
  __exportStar(require("./steps/emit-event"), exports);
20
22
  __exportStar(require("./steps/remove-remote-links"), exports);
21
23
  __exportStar(require("./steps/update-remote-links"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA2C;AAC3C,+DAA4C;AAC5C,qDAAkC;AAClC,8DAA2C;AAC3C,8DAA2C;AAC3C,0DAAuC;AACvC,2DAAwC;AACxC,+DAA4C;AAC5C,0DAAuC;AACvC,2DAAwC;AACxC,4DAAyC;AACzC,2DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,8DAA2C;AAC3C,+DAA4C;AAC5C,0DAAuC;AACvC,qDAAkC;AAClC,8DAA2C;AAC3C,8DAA2C;AAC3C,0DAAuC;AACvC,2DAAwC;AACxC,+DAA4C;AAC5C,0DAAuC;AACvC,2DAAwC;AACxC,4DAAyC;AACzC,2DAAwC"}
@@ -1,13 +1,45 @@
1
1
  export interface CreateEntitiesStepType {
2
+ /**
3
+ * The regitration name of the module that contains the method to be invoked.
4
+ */
2
5
  moduleRegistrationName: string;
6
+ /**
7
+ * The method to be invoked.
8
+ */
3
9
  invokeMethod: string;
10
+ /**
11
+ * The method to be invoked in case of compensation (when an error occurs).
12
+ */
4
13
  compensateMethod: string;
14
+ /**
15
+ * A string to pass to the compensate method.
16
+ */
5
17
  entityIdentifier?: string;
18
+ /**
19
+ * The data to pass to the invoke method.
20
+ * For example, an array of objects to create.
21
+ */
6
22
  data: any[];
7
23
  }
8
24
  export declare const createEntitiesStepId = "create-entities-step";
9
25
  /**
10
- * This step creates entities for any given module or resource
26
+ * This step creates one or more entities using methods in a module's service.
27
+ *
28
+ * @example
29
+ * createEntitiesStep({
30
+ * moduleRegistrationName: Modules.CART,
31
+ * invokeMethod: "createCreditLines",
32
+ * compensateMethod: "deleteCreditLines",
33
+ * data: {
34
+ * cart_id: "cart_123",
35
+ * amount: 10,
36
+ * reference: "payment",
37
+ * reference_id: "payment_123",
38
+ * metadata: {
39
+ * key: "value",
40
+ * },
41
+ * },
42
+ * })
11
43
  */
12
44
  export declare const createEntitiesStep: import("@medusajs/framework/workflows-sdk").StepFunction<CreateEntitiesStepType, any[]>;
13
45
  //# sourceMappingURL=create-entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-entities.d.ts","sourceRoot":"","sources":["../../../src/common/steps/create-entities.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,yFAmC9B,CAAA"}
1
+ {"version":3,"file":"create-entities.d.ts","sourceRoot":"","sources":["../../../src/common/steps/create-entities.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,IAAI,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,yFAmC9B,CAAA"}
@@ -4,7 +4,23 @@ exports.createEntitiesStep = exports.createEntitiesStepId = void 0;
4
4
  const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
5
5
  exports.createEntitiesStepId = "create-entities-step";
6
6
  /**
7
- * This step creates entities for any given module or resource
7
+ * This step creates one or more entities using methods in a module's service.
8
+ *
9
+ * @example
10
+ * createEntitiesStep({
11
+ * moduleRegistrationName: Modules.CART,
12
+ * invokeMethod: "createCreditLines",
13
+ * compensateMethod: "deleteCreditLines",
14
+ * data: {
15
+ * cart_id: "cart_123",
16
+ * amount: 10,
17
+ * reference: "payment",
18
+ * reference_id: "payment_123",
19
+ * metadata: {
20
+ * key: "value",
21
+ * },
22
+ * },
23
+ * })
8
24
  */
9
25
  exports.createEntitiesStep = (0, workflows_sdk_1.createStep)(exports.createEntitiesStepId, async (input, { container }) => {
10
26
  const { moduleRegistrationName, invokeMethod, compensateMethod, entityIdentifier = "id", data = [], } = input;
@@ -1 +1 @@
1
- {"version":3,"file":"create-entities.js","sourceRoot":"","sources":["../../../src/common/steps/create-entities.ts"],"names":[],"mappings":";;;AAAA,qEAA4E;AAU/D,QAAA,oBAAoB,GAAG,sBAAsB,CAAA;AAC1D;;GAEG;AACU,QAAA,kBAAkB,GAAG,IAAA,0BAAU,EAC1C,4BAAoB,EACpB,KAAK,EAAE,KAA6B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACrD,MAAM,EACJ,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GAAG,IAAI,EACvB,IAAI,GAA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,GAAG,KAAK,CAAA;IAET,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAM,sBAAsB,CAAC,CAAA;IAC7D,MAAM,OAAO,GAAU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE1E,OAAO,IAAI,4BAAY,CAAC,OAAO,EAAE;QAC/B,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;QAC1D,sBAAsB;QACtB,gBAAgB;KACjB,CAAC,CAAA;AACJ,CAAC,EACD,KAAK,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACvC,MAAM,EACJ,iBAAiB,GAAG,EAAE,EACtB,sBAAsB,EACtB,gBAAgB,GACjB,GAAG,eAAgB,CAAA;IAEpB,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;QAC/B,OAAM;IACR,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAM,sBAAsB,CAAC,CAAA;IAE7D,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC,iBAAiB,CAAC,CAAA;AACnD,CAAC,CACF,CAAA"}
@@ -1,13 +1,38 @@
1
1
  export interface DeleteEntitiesStepType {
2
+ /**
3
+ * The regitration name of the module that contains the method to be invoked.
4
+ */
2
5
  moduleRegistrationName: string;
6
+ /**
7
+ * The method to be invoked.
8
+ */
3
9
  invokeMethod: string;
10
+ /**
11
+ * The method to be invoked in case of compensation (when an error occurs).
12
+ */
4
13
  compensateMethod: string;
14
+ /**
15
+ * A string to pass to the compensate method.
16
+ * For example, an ID of the entity to be deleted.
17
+ */
5
18
  entityIdentifier?: string;
19
+ /**
20
+ * The data to pass to the invoke method.
21
+ * For example, an array of IDs to delete.
22
+ */
6
23
  data: any[];
7
24
  }
8
25
  export declare const deleteEntitiesStepId = "delete-entities-step";
9
26
  /**
10
- * This step deletes one or more entities.
27
+ * This step deletes one or more entities using methods in a module's service.
28
+ *
29
+ * @example
30
+ * deleteEntitiesStep({
31
+ * moduleRegistrationName: Modules.CART,
32
+ * invokeMethod: "softDeleteCreditLines",
33
+ * compensateMethod: "restoreCreditLines",
34
+ * data: input.id,
35
+ * })
11
36
  */
12
37
  export declare const deleteEntitiesStep: import("@medusajs/framework/workflows-sdk").StepFunction<DeleteEntitiesStepType, undefined>;
13
38
  //# sourceMappingURL=delete-entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete-entities.d.ts","sourceRoot":"","sources":["../../../src/common/steps/delete-entities.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,6FAkC9B,CAAA"}
1
+ {"version":3,"file":"delete-entities.d.ts","sourceRoot":"","sources":["../../../src/common/steps/delete-entities.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,IAAI,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAC1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,6FAkC9B,CAAA"}
@@ -4,7 +4,15 @@ exports.deleteEntitiesStep = exports.deleteEntitiesStepId = void 0;
4
4
  const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
5
5
  exports.deleteEntitiesStepId = "delete-entities-step";
6
6
  /**
7
- * This step deletes one or more entities.
7
+ * This step deletes one or more entities using methods in a module's service.
8
+ *
9
+ * @example
10
+ * deleteEntitiesStep({
11
+ * moduleRegistrationName: Modules.CART,
12
+ * invokeMethod: "softDeleteCreditLines",
13
+ * compensateMethod: "restoreCreditLines",
14
+ * data: input.id,
15
+ * })
8
16
  */
9
17
  exports.deleteEntitiesStep = (0, workflows_sdk_1.createStep)(exports.deleteEntitiesStepId, async (input, { container }) => {
10
18
  const { moduleRegistrationName, invokeMethod, compensateMethod, data = [], } = input;
@@ -1 +1 @@
1
- {"version":3,"file":"delete-entities.js","sourceRoot":"","sources":["../../../src/common/steps/delete-entities.ts"],"names":[],"mappings":";;;AAAA,qEAA4E;AAU/D,QAAA,oBAAoB,GAAG,sBAAsB,CAAA;AAC1D;;GAEG;AACU,QAAA,kBAAkB,GAAG,IAAA,0BAAU,EAC1C,4BAAoB,EACpB,KAAK,EAAE,KAA6B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACrD,MAAM,EACJ,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,IAAI,GAAG,EAAE,GACV,GAAG,KAAK,CAAA;IAET,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAM,sBAAsB,CAAC,CAAA;IAC7D,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAEnD,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,EAAE;QAC9B,iBAAiB,EAAE,KAAK,CAAC,IAAI;QAC7B,sBAAsB;QACtB,gBAAgB;KACjB,CAAC,CAAA;AACJ,CAAC,EACD,KAAK,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC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M,EAAE,CAAC;QAC/B,OAAM;IACR,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAM,sBAAsB,CAAC,CAAA;IAE7D,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC,iBAAiB,CAAC,CAAA;AACnD,CAAC,CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/core-flows",
3
- "version": "2.8.3-preview-20250521180140",
3
+ "version": "2.8.3-preview-20250522000308",
4
4
  "description": "Set of workflow definitions for Medusa",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -26,7 +26,7 @@
26
26
  "author": "Medusa",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@medusajs/framework": "2.8.3-preview-20250521180140",
29
+ "@medusajs/framework": "2.8.3-preview-20250522000308",
30
30
  "@mikro-orm/core": "6.4.3",
31
31
  "@mikro-orm/knex": "6.4.3",
32
32
  "@mikro-orm/migrations": "6.4.3",
@@ -44,7 +44,7 @@
44
44
  "json-2-csv": "^5.5.4"
45
45
  },
46
46
  "peerDependencies": {
47
- "@medusajs/framework": "2.8.3-preview-20250521180140",
47
+ "@medusajs/framework": "2.8.3-preview-20250522000308",
48
48
  "awilix": "^8.0.1"
49
49
  },
50
50
  "scripts": {