@izara_project/izara-core-generate-service-code 1.0.37 → 1.0.39
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.
- package/package.json +1 -1
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/handler/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/handler/templateWebSocket.ejs +2 -0
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/template.ejs +1 -1
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/handler/data.js +1 -1
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/mainFunction/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/index.js +23 -16
- package/src/generateCode/generateSchema/actionEndpointComponent/mainFunction/beforeLogical/template.ejs +10 -0
- package/src/generateCode/generateSchema/relationshipPerActionComponent/create/action/mainFunction/template.ejs +2 -2
- package/src/libs/Consts.js +2 -2
- package/src/libs/Libs.js +1 -0
package/package.json
CHANGED
package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/handler/data.js
CHANGED
|
@@ -49,7 +49,13 @@ async function data(_izContext, data, appPath) {
|
|
|
49
49
|
route: functionName
|
|
50
50
|
},
|
|
51
51
|
setting: {
|
|
52
|
-
savePath: path.join(
|
|
52
|
+
savePath: path.join(
|
|
53
|
+
appPath,
|
|
54
|
+
SOURCE_PATH.flowSchema,
|
|
55
|
+
`${upperCase(data.flowTag)}`,
|
|
56
|
+
`${upperCase(data.flowStepName)}`,
|
|
57
|
+
'source/'
|
|
58
|
+
),
|
|
53
59
|
saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
|
|
54
60
|
fileExtension: '.js',
|
|
55
61
|
isAppend: true
|
|
@@ -20,6 +20,8 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
|
|
|
20
20
|
import { webSocket } from '@izara_project/izara-core-library-external-request';
|
|
21
21
|
const { postToConnection } = webSocket;
|
|
22
22
|
|
|
23
|
+
import <%- functionName %> from './<%- functionName %>_Main.js';
|
|
24
|
+
|
|
23
25
|
export const main = middleware.wrap(async (event, context) => {
|
|
24
26
|
|
|
25
27
|
event._izContext.logger.debug('Event:', event);
|
|
@@ -41,7 +41,13 @@ async function data(_izContext, data, appPath) {
|
|
|
41
41
|
functionName
|
|
42
42
|
},
|
|
43
43
|
setting: {
|
|
44
|
-
savePath: path.join(
|
|
44
|
+
savePath: path.join(
|
|
45
|
+
appPath,
|
|
46
|
+
SOURCE_PATH.flowSchema,
|
|
47
|
+
`${upperCase(data.flowTag)}`,
|
|
48
|
+
`${upperCase(data.flowStepName)}`,
|
|
49
|
+
'source/'
|
|
50
|
+
),
|
|
45
51
|
saveFileName: `${upperCase(functionName)}${upperCase(data.recieveType)}_Main`,
|
|
46
52
|
fileExtension: '.js',
|
|
47
53
|
isAppend: false
|
|
@@ -42,7 +42,7 @@ async function data(_izContext, data, appPath) {
|
|
|
42
42
|
...data,
|
|
43
43
|
},
|
|
44
44
|
setting: {
|
|
45
|
-
savePath: path.join(appPath, SOURCE_PATH.flowSchema, `${upperCase(data.flowTag)}`, `${data.flowStepName}`, 'source/'),
|
|
45
|
+
savePath: path.join(appPath, SOURCE_PATH.flowSchema, `${upperCase(data.flowTag)}`, `${upperCase(data.flowStepName)}`, 'source/'),
|
|
46
46
|
saveFileName: `${upperCase(data.functionName)}_${upperCase(data.handlerType)}`,
|
|
47
47
|
fileExtension: '.js',
|
|
48
48
|
isAppend: true
|
|
@@ -34,7 +34,13 @@ async function data(_izContext, data, appPath) {
|
|
|
34
34
|
templatePath: templatePath,
|
|
35
35
|
templateData: { ...data },
|
|
36
36
|
setting: {
|
|
37
|
-
savePath: path.join(
|
|
37
|
+
savePath: path.join(
|
|
38
|
+
appPath,
|
|
39
|
+
SOURCE_PATH.flowSchema,
|
|
40
|
+
`${upperCase(data.flowTag)}`,
|
|
41
|
+
`${upperCase(data.flowStepName)}`,
|
|
42
|
+
'source/'
|
|
43
|
+
),
|
|
38
44
|
saveFileName: `${upperCase(data.functionName)}_Main`,
|
|
39
45
|
fileExtension: '.js',
|
|
40
46
|
isAppend: false
|
|
@@ -170,6 +170,9 @@ async function generatePlunIg(
|
|
|
170
170
|
allCreateSourceParams.push(snsOutResult);
|
|
171
171
|
|
|
172
172
|
let mainResult;
|
|
173
|
+
if (flowStepConfig.hasOwnProperty("handleLogic")) {
|
|
174
|
+
|
|
175
|
+
}
|
|
173
176
|
if (flowStepConfig.hasOwnProperty("plugInHooks")) {
|
|
174
177
|
// for (const plugInHookFlow of flowStepConfig.plugInHooks) {
|
|
175
178
|
for (let i = 0; i < flowStepConfig.plugInHooks.length; i++) {
|
|
@@ -204,32 +207,36 @@ async function generatePlunIg(
|
|
|
204
207
|
}
|
|
205
208
|
allCreateSourceParams.push(mainResult);
|
|
206
209
|
};
|
|
207
|
-
|
|
208
|
-
if (objSchema.hasOwnProperty('recievePlugInHookTag')) {
|
|
209
|
-
for (const recieveConfig of Object.values(objSchema.recievePlugInHookTag)) {
|
|
210
|
-
if (recieveConfig.hasOwnProperty('flowType')) {
|
|
211
|
-
data['recieveType'] = "async",
|
|
212
|
-
data['flowType'] = recieveConfig.flowType
|
|
213
|
-
} else {
|
|
214
|
-
data['recieveType'] = 'sync'
|
|
215
|
-
}
|
|
216
|
-
const yamlRecievePlugInResult = await yamlRecievePlugIn(_izContext, data, appPath);
|
|
217
|
-
const handlerRecievePlugInResult = await handlerRecievePlugIn(_izContext, data, appPath);
|
|
218
|
-
const mainFunctionRecievePlugInResult = await mainFunctionRecievePlugIn(_izContext, data, appPath);
|
|
219
|
-
// console.log("mainFunctionRecievePlugInResult", mainFunctionRecievePlugInResult)
|
|
220
|
-
allCreateSourceParams.push(...yamlRecievePlugInResult, ...handlerRecievePlugInResult, mainFunctionRecievePlugInResult);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
210
|
}
|
|
224
211
|
}
|
|
225
212
|
} else {
|
|
226
213
|
mainResult = await mainFunctionFlowStep(_izContext, { ...data, havePlugIn: false }, appPath);
|
|
227
214
|
allCreateSourceParams.push(mainResult);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
for (const objSchema of allObjSchemas) {
|
|
218
|
+
if (!objSchema.hasOwnProperty("recievePlugInHookTag"))
|
|
219
|
+
continue;
|
|
220
|
+
for (const recieveConfig of Object.values(objSchema.recievePlugInHookTag)) {
|
|
221
|
+
if (recieveConfig.hasOwnProperty('flowType')) {
|
|
222
|
+
data['recieveType'] = "async",
|
|
223
|
+
data['flowType'] = recieveConfig.flowType
|
|
224
|
+
} else {
|
|
225
|
+
data['recieveType'] = 'sync'
|
|
226
|
+
}
|
|
227
|
+
const yamlRecievePlugInResult = await yamlRecievePlugIn(_izContext, data, appPath);
|
|
228
|
+
const handlerRecievePlugInResult = await handlerRecievePlugIn(_izContext, data, appPath);
|
|
229
|
+
const mainFunctionRecievePlugInResult = await mainFunctionRecievePlugIn(_izContext, data, appPath);
|
|
230
|
+
// console.log("mainFunctionRecievePlugInResult", mainFunctionRecievePlugInResult)
|
|
231
|
+
allCreateSourceParams.push(...yamlRecievePlugInResult, ...handlerRecievePlugInResult, mainFunctionRecievePlugInResult);
|
|
232
|
+
}
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
235
|
}
|
|
231
236
|
};
|
|
232
237
|
|
|
238
|
+
|
|
239
|
+
|
|
233
240
|
const uniqueSortedTargetFiles = Array.from(
|
|
234
241
|
new Set(
|
|
235
242
|
allCreateSourceParams
|
|
@@ -135,6 +135,16 @@ import { <%= action %>MainLogical } from './<%= functionName %>_Main.js';
|
|
|
135
135
|
})
|
|
136
136
|
);
|
|
137
137
|
|
|
138
|
+
if (callingFlowConfig.callingFlow === `${process.env.iz_resourcePrefix}CreateBeforeLogical`) {
|
|
139
|
+
callingFlowConfig =
|
|
140
|
+
callingFlowConfig.callingFlowProperties.parentPassBackProperties;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_izContext.logger.debug(
|
|
144
|
+
'[createBeforeLogicalMain] callingFlowConfig',
|
|
145
|
+
callingFlowConfig
|
|
146
|
+
);
|
|
147
|
+
|
|
138
148
|
//(<beforeLogicalMain>)
|
|
139
149
|
//(</beforeLogicalMain>)
|
|
140
150
|
|
|
@@ -143,8 +143,8 @@ export default async function createRelationship(
|
|
|
143
143
|
const { serviceTag: fromServiceTag, objectType: fromObjectType } = link.from.objType;
|
|
144
144
|
const { serviceTag: toServiceTag, objectType: toObjType } = link.to.objType;
|
|
145
145
|
|
|
146
|
-
const { serviceTag: firstServiceTag, objectType: firstObjectType } =
|
|
147
|
-
const { serviceTag: secondServiceTag, objectType: secondObjectType } =
|
|
146
|
+
const { serviceTag: firstServiceTag, objectType: firstObjectType } = firstObject.objType;
|
|
147
|
+
const { serviceTag: secondServiceTag, objectType: secondObjectType } = secondObject.objType;
|
|
148
148
|
|
|
149
149
|
const matchFromTo = fromServiceTag === firstServiceTag && fromObjectType === firstObjectType &&
|
|
150
150
|
toServiceTag === secondServiceTag && toObjType === secondObjectType;
|
package/src/libs/Consts.js
CHANGED
|
@@ -94,7 +94,7 @@ const SOURCE_PATH = {
|
|
|
94
94
|
'src/generatedCode/CreateRecordComplete/',
|
|
95
95
|
|
|
96
96
|
// systemText
|
|
97
|
-
systemTextSchema: '
|
|
97
|
+
systemTextSchema: 'SystemTextSchemas/generatedCode/',
|
|
98
98
|
|
|
99
99
|
// rbac
|
|
100
100
|
rbac: '/src/generatedCode/Rbac/source/',
|
|
@@ -161,7 +161,7 @@ const SAVE_FILE_NAME = {
|
|
|
161
161
|
refObjectRelationship: 'RefObjectRelationships',
|
|
162
162
|
objectSchema: 'ObjectFieldSchema',
|
|
163
163
|
roleNameConfig: 'RoleNameConfig',
|
|
164
|
-
systemTextSchema: '
|
|
164
|
+
systemTextSchema: 'SystemTextSchemas'
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
const FUNCTION_NAME = {
|
package/src/libs/Libs.js
CHANGED
|
@@ -494,6 +494,7 @@ function createSnsResource(topicNames) {
|
|
|
494
494
|
resourceNames(RESOURCE_CLASSES.sns, topicName))
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
|
+
|
|
497
498
|
async function getLocalOrS3ObjectSchema(_izContext, objType, schemasPath) {
|
|
498
499
|
console.log("objType, schemasPath", objType, schemasPath)
|
|
499
500
|
const iz_serviceTag = getLocalConfig('iz_serviceTag');
|