@pxp-nd/flow 1.0.72 → 1.0.74

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.
@@ -531,6 +531,9 @@ let Flow = class Flow extends core_1.Controller {
531
531
  async validateFlow(flowId, manager) {
532
532
  const nodes = await Node_1.default.find({ flowId, isActive: true });
533
533
  let res = '';
534
+ if (nodes.length < 2) {
535
+ throw new core_1.PxpError(400, 'Your flow must have at least 2 steps. Please finish configuring it before start');
536
+ }
534
537
  for (const node of nodes) {
535
538
  const configActionType = !node.action.actionType.schemaJson ? {} : JSON.parse(node.action.actionType.schemaJson);
536
539
  const configAction = !node.action.schemaJson ? {} : JSON.parse(node.action.schemaJson);
@@ -556,7 +559,7 @@ let Flow = class Flow extends core_1.Controller {
556
559
  }
557
560
  });
558
561
  if (missingRequired.length > 0) {
559
- res += `In node ${node.action.name} you have missing fields: ${missingRequired.join(',')}, `;
562
+ res += `In node ${node.action.name} you have missing fields: ${missingRequired.join(', ')}, `;
560
563
  }
561
564
  }
562
565
  if (res != '') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",