@izara_project/izara-core-generate-service-code 1.0.4 → 1.0.5

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.4",
3
+ "version": "1.0.5",
4
4
  "description": "Code for locally generating per service files",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -269,26 +269,27 @@ export default async function updateMain(
269
269
  if (Object.keys(updateNodeParams.objInstanceFull.fields).length === 0) {
270
270
  return
271
271
  } else {
272
+
272
273
  //(<beforeUpdateNode>)
273
274
  //(</beforeUpdateNode>)
274
275
 
275
- awaitingStepIds.push(
276
+ awaitingStepIds.push( // createAwaitingStepId if updateGraph
276
277
  {
277
- awaitingStepId: await asyncFlowSharedLib.createAwaitingStepId(
278
- (hash({
279
- objType: objType,
280
- graphServerTag: storageTag,
281
- identifiers: objInstanceFullForGraph.identifiers,
282
- callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
283
- })),
284
- PREFIX.CREATE_OBJECT_ASYNC
278
+ awaitingStepId: asyncFlowSharedLib.createAwaitingStepId(
279
+ hash({
280
+ objectType: objType.objectType,
281
+ serviceTag: objType.serviceTag,
282
+ identifiers: identifiers,
283
+ fields: fields,
284
+ // correlationIds: _izContext.correlationIds.get("id")
285
+ }),
286
+ PREFIX.updateNode
285
287
  ),
286
- //(<additionalAttributeCreateNode>)
288
+ //(<additionalAttributes>)
287
289
  additionalAttributes: {}
288
- //(</additionalAttributeCreateNode>)
289
- },
290
- );
291
-
290
+ //(</additionalAttributes>)
291
+ }
292
+ )
292
293
  _izContext.logger.debug("awaitingStepIds", awaitingStepIds)
293
294
 
294
295
  if (awaitingStepIds.length) {
@@ -98,7 +98,7 @@ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
98
98
  tableName,
99
99
  flowSchemaComplete,
100
100
  triggerType,
101
- queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: flowSchema.flowTag })}_Main`
101
+ queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: upperCase(flowSchema.flowTag) })}_Main`
102
102
  },
103
103
  setting: {
104
104
  savePath: path.join(
@@ -63,7 +63,6 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
63
63
  let functionName = 'Process' + upperCase(flowSchema.flowTag);
64
64
  let handlerType = upperCase(HANDLER.hdrSqs);
65
65
  let additionalResourcePermission = defaultIamRolePerAction();
66
- let route = upperCase(flowSchema.flowTag);
67
66
  let queueName = upperCase(flowSchema.flowTag) + handlerType;
68
67
  let objectSchema;
69
68
 
@@ -28,7 +28,21 @@ let perRecordsValidatorSchema = {
28
28
  //(<validatorSchema>)
29
29
  //(</validatorSchema>)
30
30
  }
31
- middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
31
+
32
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
33
+ {
34
+ type: "object",
35
+ required: ['body', 'messageAttributes'],
36
+ properties: {
37
+ body: {
38
+ type: 'object',
39
+ },
40
+ messageAttributes: {
41
+ type: 'object'
42
+ }
43
+ }
44
+ }
45
+ ));
32
46
 
33
47
  export const main = middleware.wrap(async (event, context) => {
34
48
 
@@ -22,7 +22,7 @@ const __dirname = path.dirname(__filename);
22
22
  import consts from '../../../../libs/Consts.js';
23
23
  import utils from '../../../../libs/Utils.js';
24
24
 
25
- const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
25
+ const { SOURCE_PATH, SAVE_FILE_NAME, HANDLER } = consts;
26
26
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
27
 
28
28
  const snsTemplatePath = path.join(
@@ -64,6 +64,15 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
64
64
 
65
65
  let defaultDsqQueueDataList = [];
66
66
 
67
+ if (flowSchema.statusType === 'triggerCache') {
68
+ defaultDsqQueueDataList.push(
69
+ {
70
+ queueName: upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq)
71
+ }
72
+ )
73
+
74
+ }
75
+
67
76
  // if (flowSchema.outputTopic) {
68
77
  // if (flowSteps.includes("Out")) {
69
78
  // if (flowSchema.outputTopic) {
@@ -41,11 +41,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
41
41
  let functionName =
42
42
  'CheckTriggerCache' + upperCase(flowSchema.flowTag) + 'Complete';
43
43
  let handlerType = upperCase(HANDLER.hdrSqs);
44
- let queueName =
45
- 'CheckTriggerCache' +
46
- upperCase(flowSchema.flowTag) +
47
- 'Complete' +
48
- handlerType;
44
+ let queueName = 'CheckTriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
49
45
 
50
46
  return {
51
47
  templatePath: templatePath,
@@ -58,12 +58,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
58
58
  queueName
59
59
  },
60
60
  setting: {
61
- savePath: path.join(
62
- srcPath,
63
- SOURCE_PATH.flowSchema,
64
- upperCase(flowSchema.flowTag),
65
- 'source/'
66
- ),
61
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
67
62
  saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
68
63
  fileExtension: '.js',
69
64
  isAppend: true
@@ -29,7 +29,21 @@ let perRecordsValidatorSchema = {
29
29
  //(<validatorSchema>)
30
30
  //(</validatorSchema>)
31
31
  }
32
- middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
32
+
33
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
34
+ {
35
+ type: "object",
36
+ required: ['body', 'messageAttributes'],
37
+ properties: {
38
+ body: {
39
+ type: 'object',
40
+ },
41
+ messageAttributes: {
42
+ type: 'object'
43
+ }
44
+ }
45
+ }
46
+ ));
33
47
 
34
48
  export const main = middleware.wrap(async (event, context) => {
35
49
 
@@ -44,8 +44,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
44
44
  let functionName =
45
45
  'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete';
46
46
  let handlerType = upperCase(HANDLER.hdrSqs);
47
- let queueName =
48
- 'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
47
+ let queueName = 'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
49
48
 
50
49
  return {
51
50
  templatePath: templatePath,