@pxp-nd/flow 1.0.73 → 1.0.75

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.
@@ -15,6 +15,7 @@
15
15
  * 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
16
16
  * 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
17
17
  * 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
18
+ * 16-Sep-2023 SP22SEP23 Mercedes Zambrana Change GET to POST in insertEventFlow
18
19
  * ******************************************************************************
19
20
  */
20
21
  import { EntityManager } from 'typeorm';
@@ -16,6 +16,7 @@
16
16
  * 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
17
17
  * 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
18
18
  * 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
19
+ * 16-Sep-2023 SP22SEP23 Mercedes Zambrana Change GET to POST in insertEventFlow
19
20
  * ******************************************************************************
20
21
  */
21
22
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -531,6 +532,9 @@ let Flow = class Flow extends core_1.Controller {
531
532
  async validateFlow(flowId, manager) {
532
533
  const nodes = await Node_1.default.find({ flowId, isActive: true });
533
534
  let res = '';
535
+ if (nodes.length < 2) {
536
+ throw new core_1.PxpError(400, 'Your flow must have at least 2 steps. Please finish configuring it before start');
537
+ }
534
538
  for (const node of nodes) {
535
539
  const configActionType = !node.action.actionType.schemaJson ? {} : JSON.parse(node.action.actionType.schemaJson);
536
540
  const configAction = !node.action.schemaJson ? {} : JSON.parse(node.action.schemaJson);
@@ -714,6 +718,7 @@ __decorate([
714
718
  ], Flow.prototype, "saveFlow", null);
715
719
  __decorate([
716
720
  (0, core_1.Get)(),
721
+ (0, core_1.Post)(),
717
722
  (0, core_1.DbSettings)('Orm'),
718
723
  (0, core_1.ReadOnly)(true),
719
724
  (0, core_1.Log)(true),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",