@izara_project/izara-core-generate-service-code 1.0.38 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-core-generate-service-code",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Code for locally generating per service files",
5
5
  "author": "Sven Mason <thebarbariansven@gmail.com>",
6
6
  "license": "AGPL-3.0-or-later",
@@ -49,7 +49,13 @@ async function data(_izContext, data, appPath) {
49
49
  route: functionName
50
50
  },
51
51
  setting: {
52
- savePath: path.join(appPath, SOURCE_PATH.flowSchema, `${upperCase(data.flowTag)}`, `${data.flowStepName}`, 'source/'),
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(appPath, SOURCE_PATH.flowSchema, `${upperCase(data.flowTag)}`, `${data.flowStepName}`, 'source/'),
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
@@ -70,7 +70,7 @@ export default async function <%- functionName %> (
70
70
 
71
71
 
72
72
  } catch (err) {
73
- _izContext.logger.error('error recievePlugInRequest: ', err)
73
+ _izContext.logger.error('error <%- functionName %>: ', err)
74
74
  throw (err)
75
75
  }
76
76
  }
@@ -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(appPath, SOURCE_PATH.flowSchema, `${upperCase(data.flowTag)}`, `${data.flowStepName}`, 'source/'),
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
@@ -94,7 +94,7 @@ const SOURCE_PATH = {
94
94
  'src/generatedCode/CreateRecordComplete/',
95
95
 
96
96
  // systemText
97
- systemTextSchema: 'SystemTextSchema/generatedCode/',
97
+ systemTextSchema: 'SystemTextSchemas/generatedCode/',
98
98
 
99
99
  // rbac
100
100
  rbac: '/src/generatedCode/Rbac/source/',
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');