@pxp-nd/flow 1.0.20 → 1.0.21

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.
@@ -29,6 +29,7 @@ const typeorm_1 = require("typeorm");
29
29
  const Node_1 = __importDefault(require("../entity/Node"));
30
30
  const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
31
31
  const core_1 = require("@pxp-nd/core");
32
+ const lodash_1 = __importDefault(require("lodash"));
32
33
  const FieldMap_1 = __importDefault(require("../entity/FieldMap"));
33
34
  const OriginName_1 = __importDefault(require("../entity/OriginName"));
34
35
  let Node = class Node extends core_1.Controller {
@@ -79,7 +80,8 @@ let Node = class Node extends core_1.Controller {
79
80
  };
80
81
  }
81
82
  async getParameterizedNode(params, manager) {
82
- const { nodeId, flowId } = params;
83
+ lodash_1.default.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
84
+ const { nodeId, flowId, substitutionsSchemaJson } = params;
83
85
  /*const tNodeOrigin = __(NodeModel.find({
84
86
  relations: ['action'],
85
87
  where: {
@@ -101,10 +103,12 @@ let Node = class Node extends core_1.Controller {
101
103
  tNodeData,
102
104
  tFieldMapData
103
105
  ]);*/
104
- const { actionConfigJson, action: { configJsonTemplate, actionType: { schemaJson } } } = nodeData;
106
+ const { actionConfigJson, action: { schemaJson, configJsonTemplate, actionType: { schemaJson: schemaJsonFromActionType } } } = nodeData;
105
107
  const actionConfigJsonObject = actionConfigJson ? JSON.parse(actionConfigJson) : {};
106
108
  const configJsonTemplateObject = configJsonTemplate ? JSON.parse(configJsonTemplate) : {};
107
- let schemaJsonObject = schemaJson ? JSON.parse(schemaJson) : {};
109
+ let schemaJsonFromActionTypeObject = schemaJsonFromActionType ? JSON.parse(lodash_1.default.template(schemaJsonFromActionType)(substitutionsSchemaJson)) : {};
110
+ let schemaJsonFromActionObject = schemaJson ? JSON.parse(lodash_1.default.template(schemaJson)(substitutionsSchemaJson)) : {};
111
+ let schemaJsonObject = { ...schemaJsonFromActionTypeObject, ...schemaJsonFromActionObject };
108
112
  const mergeValues = {
109
113
  ...configJsonTemplateObject,
110
114
  ...actionConfigJsonObject
@@ -177,7 +181,7 @@ __decorate([
177
181
  __metadata("design:returntype", Promise)
178
182
  ], Node.prototype, "AddActionConfigJson", null);
179
183
  __decorate([
180
- core_1.Get(),
184
+ core_1.Post(),
181
185
  core_1.DbSettings('Orm'),
182
186
  core_1.ReadOnly(false),
183
187
  core_1.Log(true),
@@ -12,6 +12,7 @@ export default class Action extends PxpEntity {
12
12
  controllerFunction: string;
13
13
  configJsonTemplate: string;
14
14
  hidden: string;
15
+ schemaJson: string;
15
16
  actionType: ActionType;
16
17
  nodes: Node[];
17
18
  eventNodes: Node[];
@@ -58,6 +58,10 @@ __decorate([
58
58
  typeorm_1.Column({ type: 'varchar', nullable: false, length: 1, default: 'N' }),
59
59
  __metadata("design:type", String)
60
60
  ], Action.prototype, "hidden", void 0);
61
+ __decorate([
62
+ typeorm_1.Column({ name: 'schema_json', type: 'text' }),
63
+ __metadata("design:type", String)
64
+ ], Action.prototype, "schemaJson", void 0);
61
65
  __decorate([
62
66
  typeorm_1.ManyToOne(() => ActionType_1.default, actionType => actionType.actions, { eager: true }),
63
67
  typeorm_1.JoinColumn({ name: 'action_type_id' }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",