@pxp-nd/flow 1.0.54 → 1.0.56

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.
@@ -439,7 +439,7 @@ let Flow = class Flow extends core_1.Controller {
439
439
  const newNode = manager.create(Node_1.default, {
440
440
  nodeId: undefined,
441
441
  flowId: params.flowId,
442
- isInit: 'N',
442
+ isInit: 'Y',
443
443
  actionId: params.actionId
444
444
  });
445
445
  const saveNode = await manager.save(newNode);
@@ -81,31 +81,37 @@ let Node = class Node extends core_1.Controller {
81
81
  };
82
82
  }
83
83
  async getParameterizedNode(params, manager) {
84
+ console.log('getParameterizedNode llega');
84
85
  lodash_1.default.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
85
86
  const { nodeId, flowId, substitutionsSchemaJson = {} } = params;
87
+ const tNodeData = (0, core_1.__)(Node_1.default.findOne(nodeId));
88
+ const nodeData = await tNodeData;
86
89
  const tNodeOrigin = await (0, core_1.__)(Node_1.default.findOne({
87
90
  relations: ['action'],
88
91
  where: {
89
- flowId: flowId,
92
+ flowId: nodeData.flowId,
90
93
  isInit: 'Y',
91
94
  action: {
92
95
  originName: (0, typeorm_1.Not)((0, typeorm_1.IsNull)())
93
96
  }
94
97
  }
95
98
  }));
96
- const tNodeData = (0, core_1.__)(Node_1.default.findOne(nodeId));
97
99
  const tFieldMapData = (0, core_1.__)(manager.createQueryBuilder(FieldMap_1.default, 'fm')
98
100
  .innerJoin(OriginName_1.default, 'on', 'on.originNameId = fm.originNameId')
99
101
  .where("on.name = :n ", { n: tNodeOrigin.action.originName })
100
102
  .getMany());
101
103
  //const nodeOrigin = await tNodeOrigin; todo
102
- const nodeData = await tNodeData;
103
104
  const fieldMapData = await tFieldMapData;
104
105
  /*const [nodeData, fieldMapData] = await Promise.all([
105
106
  tNodeData,
106
107
  tFieldMapData
107
108
  ]);*/
108
109
  const { actionConfigJson, action: { schemaJson, configJsonTemplate, actionType: { schemaJson: schemaJsonFromActionType } } } = nodeData;
110
+ console.log('nodeData actionConfigJson', actionConfigJson);
111
+ console.log('action schemaJson', schemaJson);
112
+ console.log('action configJsonTemplate', configJsonTemplate);
113
+ console.log('actionType schemaJsonFromActionType', schemaJsonFromActionType);
114
+ console.log('actionType fieldMapData', fieldMapData);
109
115
  const actionConfigJsonObject = actionConfigJson ? JSON.parse(actionConfigJson) : {};
110
116
  const configJsonTemplateObject = configJsonTemplate ? JSON.parse(configJsonTemplate) : {};
111
117
  let schemaJsonFromActionTypeObject = schemaJsonFromActionType ? JSON.parse(lodash_1.default.template(schemaJsonFromActionType)(substitutionsSchemaJson)) : {};
@@ -184,6 +190,7 @@ let Node = class Node extends core_1.Controller {
184
190
  }
185
191
  return undefined;
186
192
  };
193
+ console.log('mergeValues', mergeValues);
187
194
  for (const [nameKey, value] of Object.entries(mergeValues)) {
188
195
  if (schemaJsonObject[nameKey]) {
189
196
  const descValue = await (0, core_1.__)(findFieldInConfigForComponent(schemaJsonObject[nameKey], value));
@@ -195,15 +202,17 @@ let Node = class Node extends core_1.Controller {
195
202
  };
196
203
  }
197
204
  }
198
- Object.entries(schemaJsonObject)
199
- .filter(([, value]) => value.initialValue === undefined && value.fromFieldMap === undefined && value.fieldMappingType)
205
+ console.log('111 schemaJsonObject', schemaJsonObject);
206
+ /*Object.entries(schemaJsonObject)
207
+ .filter(([, value]: [nameKey: string, value: any]) => value.initialValue === undefined && value.fromFieldMap === undefined && value.fieldMappingType)
200
208
  .forEach(([nameKey]) => {
201
- const hasUniqueByTypeInMappingData = findFieldMapUniqueByType(schemaJsonObject[nameKey].fieldMappingType);
202
- schemaJsonObject[nameKey] = {
209
+ const hasUniqueByTypeInMappingData = findFieldMapUniqueByType(schemaJsonObject[nameKey].fieldMappingType);
210
+ schemaJsonObject[nameKey] = {
203
211
  ...schemaJsonObject[nameKey],
204
212
  ...(hasUniqueByTypeInMappingData && { fromFieldMap: true, ...hasUniqueByTypeInMappingData }),
205
- };
206
- });
213
+ };
214
+ })*/
215
+ console.log('222 schemaJsonObject', schemaJsonObject);
207
216
  return {
208
217
  actionConfigJsonObject,
209
218
  configJsonTemplateObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",