@izara_project/izara-core-generate-service-code 1.0.22 → 1.0.24

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.
Files changed (106) hide show
  1. package/package.json +1 -1
  2. package/src/generateCode/generateFlowSchema/GenerateCodeFlowSchema.js +11 -8
  3. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/functionYaml/data.js +2 -2
  4. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/functionYaml/template.ejs +3 -10
  5. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/handler/inv/data.js +5 -4
  6. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/handler/inv/template.ejs +5 -14
  7. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/index.js +4 -13
  8. package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/mainFunction/data.js +2 -2
  9. package/src/generateCode/generateFlowSchema/event/extTopicComponent/index.js +5 -9
  10. package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/functionYaml/data.js +6 -10
  11. package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/functionYaml/template.ejs +4 -11
  12. package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/handler/data.js +2 -2
  13. package/src/generateCode/generateFlowSchema/event/extTopicComponent/sns-in-sqs/data.js +2 -2
  14. package/src/generateCode/generateFlowSchema/event/extTopicComponent/sns-out/data.js +4 -3
  15. package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/data.js +4 -8
  16. package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/template.ejs +12 -21
  17. package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/handler/data.js +2 -2
  18. package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/index.js +3 -7
  19. package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/data.js +11 -9
  20. package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/template.ejs +3 -10
  21. package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/handler/data.js +2 -2
  22. package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/index.js +3 -7
  23. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/endpointComponent/functionYaml/data.js +4 -3
  24. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/endpointComponent/handler/data.js +3 -3
  25. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/functionYaml/data.js +8 -11
  26. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/handler/data.js +2 -2
  27. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/mainFunction/data.js +2 -2
  28. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/index.js +8 -24
  29. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/sns-in/data.js +2 -2
  30. package/src/generateCode/generateFlowSchema/event/ownTopicComponent/sns-out/data.js +4 -3
  31. package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/data.js +14 -12
  32. package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/template.ejs +5 -8
  33. package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/statusFieldTemplate.ejs +30 -0
  34. package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/storedCacheTemplate.ejs +26 -0
  35. package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/triggerCacheTemplate.ejs +44 -0
  36. package/src/generateCode/generateFlowSchema/event/s3Component/index.js +23 -55
  37. package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/functionYaml/data.js +3 -7
  38. package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/handler/data.js +3 -7
  39. package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/mainFunction/data.js +3 -7
  40. package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/queue/data.js +2 -2
  41. package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/functionYaml/data.js +3 -7
  42. package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/handler/data.js +3 -7
  43. package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/mainFunction/data.js +3 -7
  44. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/functionYaml/data.js +3 -7
  45. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/handler/data.js +3 -7
  46. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/mainFunction/data.js +3 -7
  47. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/queue/data.js +2 -2
  48. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/functionYaml/data.js +6 -10
  49. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/handler/data.js +3 -7
  50. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/mainFunction/data.js +3 -7
  51. package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/sqs/data.js +2 -2
  52. package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/functionYml/HdrS3/data.js +3 -7
  53. package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/handler/handlerS3/data.js +3 -7
  54. package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/mainFunction/data.js +3 -7
  55. package/src/generateCode/generateFlowSchema/event/s3Component/upload/relate/S3/data.js +4 -4
  56. package/src/generateCode/generateFlowSchema/event/s3Component/upload/relate/sns-out/data.js +5 -3
  57. package/src/generateCode/generateFlowSchema/event/s3Component/websocket/dynamoDb/ReservedTableData.js +3 -3
  58. package/src/generateCode/generateFlowSchema/flowSchemaMainFunction/data.js +4 -8
  59. package/src/generateCode/generateFlowSchema/flowSchemaMainFunction/template.ejs +3 -5
  60. package/src/generateCode/generateFlowSchema/flowStep/flowStep.js +7 -2
  61. package/src/generateCode/generateFlowSchema/libs/data.js +3 -7
  62. package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/functionYaml/data.js +9 -9
  63. package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/handler/data.js +1 -5
  64. package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/index.js +6 -18
  65. package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/mainFunction/data.js +15 -14
  66. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +4 -8
  67. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +15 -15
  68. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +15 -15
  69. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/index.js +13 -33
  70. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/functionYaml/data.js +4 -8
  71. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/handler/data.js +12 -14
  72. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/mainFunction/data.js +11 -14
  73. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/functionYaml/dsq/data.js +4 -9
  74. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/functionYaml/sqs/data.js +4 -9
  75. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/handler/dsq/data.js +11 -14
  76. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/handler/sqs/data.js +11 -14
  77. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +15 -15
  78. package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheQueue/data.js +2 -3
  79. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/create/mainFunction/template.ejs +185 -103
  80. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/create/sns-out/data.js +2 -1
  81. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/delete/sns-out/data.js +2 -1
  82. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/get/sns-out/data.js +2 -1
  83. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/update/mainFunction/template.ejs +137 -71
  84. package/src/generateCode/generateSchema/actionEndpointCompleteComponent/update/sns-out/data.js +2 -1
  85. package/src/generateCode/generateSchema/actionEndpointComponent/mainFunction/create/main/template.ejs +1 -1
  86. package/src/generateCode/generateSchema/actionEndpointComponent/yaml/data.js +6 -4
  87. package/src/generateCode/generateSchema/findDataComponent/mainFunction/data.js +1 -1
  88. package/src/generateCode/generateSchema/relationshipPerActionComponent/changeRelationship/complete/sns-out/data.js +2 -1
  89. package/src/generateCode/generateSchema/relationshipPerActionComponent/create/action/functionYaml/data.js +1 -0
  90. package/src/generateCode/generateSchema/relationshipPerActionComponent/create/complete/sns-out/data.js +2 -1
  91. package/src/generateCode/generateSchema/relationshipPerActionComponent/delete/action/functionYaml/data.js +1 -0
  92. package/src/generateCode/generateSchema/relationshipPerActionComponent/delete/complete/sns-out/data.js +2 -1
  93. package/src/generateCode/generateSchema/relationshipPerActionComponent/get/action/functionYaml/data.js +1 -0
  94. package/src/generateCode/generateSchema/relationshipPerActionComponent/get/complete/sns-out/data.js +2 -1
  95. package/src/generateCode/generateSchema/relationshipPerActionComponent/moveRelationship/complete/sns-out/data.js +2 -1
  96. package/src/generateCode/generateSchema/relationshipPerActionComponent/update/action/functionYaml/data.js +1 -0
  97. package/src/generateCode/generateSchema/relationshipPerActionComponent/update/action/sns-out/data.js +2 -1
  98. package/src/generateCode/generateSchema/relationshipPerActionComponent/update/complete/sns-out/data.js +2 -1
  99. package/src/generateCode/resourceYamlComponent/sns-out/data.js +2 -1
  100. package/src/generateCode/resourceYamlComponent/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -1
  101. package/src/generateCode/resourceYamlComponent/sns-out/template.ejs +2 -6
  102. package/src/generateCode.js +9 -7
  103. package/src/libs/Consts.js +9 -12
  104. package/src/libs/Utils.js +26 -1
  105. package/src/__TemplateData/flowSchema/event/externalTopic/Process/handler/data.js +0 -64
  106. package/src/__TemplateData/flowSchema/event/externalTopic/sns-out/data.js +0 -75
@@ -37,11 +37,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
37
37
  * @return {{templatePath, templateData,setting}}
38
38
  */
39
39
 
40
- function data(_izContext, flowSchema, srcPath) {
41
- return [createParamsForCreateSource(_izContext, flowSchema, srcPath)];
42
- }
43
-
44
- function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
40
+ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
45
41
  let functionName = upperCase(FUNCTION_NAME.createObjectS3);
46
42
  let objectType = flowSchema.objType.objectType;
47
43
 
@@ -53,7 +49,7 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
53
49
  },
54
50
  setting: {
55
51
  savePath: path.join(
56
- srcPath,
52
+ appPath,
57
53
  SOURCE_PATH.webSocket,
58
54
  flowSchema.flowTag,
59
55
  'source/'
@@ -65,4 +61,4 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
65
61
  };
66
62
  }
67
63
 
68
- export default data;
64
+ export default createParamsForCreateSource;
@@ -56,11 +56,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
56
56
  * @return {{ templatePath, templateData, setting } }
57
57
  */
58
58
 
59
- function data(_izContext, flowSchema, srcPath) {
60
- return [createSourceParams(_izContext, flowSchema, srcPath)];
61
- }
62
-
63
- function createSourceParams(_izContext, flowSchema, srcPath) {
59
+ function createSourceParams(_izContext, flowSchema, appPath) {
64
60
  let functionName = upperCase(FUNCTION_NAME.createPresignUrl);
65
61
  let handlerType = upperCase(HANDLER.hdrSqs);
66
62
  let additionalResourcePermission = defaultIamRolePerAction();
@@ -133,11 +129,11 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
133
129
  },
134
130
  setting: {
135
131
  saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
136
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
132
+ savePath: path.join(appPath, SOURCE_PATH.appYaml),
137
133
  fileExtension: '.yml',
138
134
  isAppend: true
139
135
  }
140
136
  };
141
137
  }
142
138
 
143
- export default data;
139
+ export default createSourceParams;
@@ -36,11 +36,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
36
36
  * @return {{ templatePath, templateData, setting } }
37
37
  */
38
38
 
39
- function data(_izContext, flowSchema, srcPath) {
40
- return [createSourceParams(_izContext, flowSchema, srcPath)];
41
- }
42
-
43
- function createSourceParams(_izContext, flowSchema, srcPath) {
39
+ function createSourceParams(_izContext, flowSchema, appPath) {
44
40
  let functionName = upperCase(FUNCTION_NAME.createPresignUrl);
45
41
  let handlerType = upperCase(HANDLER.hdrSqs);
46
42
 
@@ -53,7 +49,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
53
49
  setting: {
54
50
  saveFileName: `${functionName}_${handlerType}`,
55
51
  savePath: path.join(
56
- srcPath,
52
+ appPath,
57
53
  SOURCE_PATH.webSocket,
58
54
  flowSchema.flowTag,
59
55
  'source/'
@@ -64,4 +60,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
64
60
  };
65
61
  }
66
62
 
67
- export default data;
63
+ export default createSourceParams;
@@ -36,11 +36,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
36
36
  * @return {{ templatePath, templateData, setting } }
37
37
  */
38
38
 
39
- function data(_izContext, flowSchema, srcPath) {
40
- return [createSourceParams(_izContext, flowSchema, srcPath)];
41
- }
42
-
43
- function createSourceParams(_izContext, flowSchema, srcPath) {
39
+ function createSourceParams(_izContext, flowSchema, appPath) {
44
40
  let functionName = upperCase(FUNCTION_NAME.createPresignUrl);
45
41
  let bucketName = flowSchema.bucketName;
46
42
  let flowTag = flowSchema.flowTag;
@@ -53,7 +49,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
53
49
  setting: {
54
50
  saveFileName: `${functionName}_Main`,
55
51
  savePath: path.join(
56
- srcPath,
52
+ appPath,
57
53
  SOURCE_PATH.webSocket,
58
54
  flowSchema.flowTag,
59
55
  'source/'
@@ -64,4 +60,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
64
60
  };
65
61
  }
66
62
 
67
- export default data;
63
+ export default createSourceParams;
@@ -36,12 +36,12 @@ const templatePath = path.join(__dirname, 'template.ejs');
36
36
  * @returns {Object[]} - data of multiple dynamoDb template
37
37
  */
38
38
 
39
- function data(_izContext, srcPath) {
39
+ function data(_izContext, appPath) {
40
40
  let resultForCreateSqs = [];
41
41
  const WebSocketSqsQueueNames = [];
42
42
  const setting = {
43
43
  initialData: 'Resources:\n',
44
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
44
+ savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
45
45
  saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
46
46
  fileExtension: '.yml',
47
47
  isAppend: true
@@ -62,15 +62,11 @@ const templatePath = path.join(__dirname, 'template.ejs');
62
62
  * @return {{ templatePath, templateData, setting } }
63
63
  */
64
64
 
65
- async function data(_izContext, flowSchema, srcPath) {
66
- return [await createSourceParams(_izContext, flowSchema, srcPath)];
67
- }
65
+ async function createSourceParams(_izContext, flowSchema, appPath) {
66
+ let iz_serviceSchemaBucketName = getLocalConfig('iz_serviceSchemaBucketName');
67
+
68
+ console.debug('iz_serviceSchemaBucketName:::: ', iz_serviceSchemaBucketName);
68
69
 
69
- async function createSourceParams(_izContext, flowSchema, srcPath) {
70
- let iz_serviceSchemaBucketName = getLocalConfig(
71
- path.join(srcPath, '../'),
72
- 'iz_serviceSchemaBucketName'
73
- );
74
70
  let functionName = upperCase(FUNCTION_NAME.reservedLimit);
75
71
  let handlerType = upperCase(HANDLER.hdrSqs);
76
72
  let additionalResourcePermission = defaultIamRolePerAction();
@@ -140,11 +136,11 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
140
136
  },
141
137
  setting: {
142
138
  saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
143
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
139
+ savePath: path.join(appPath, SOURCE_PATH.appYaml),
144
140
  fileExtension: '.yml',
145
141
  isAppend: true
146
142
  }
147
143
  };
148
144
  }
149
145
 
150
- export default data;
146
+ export default createSourceParams;
@@ -37,11 +37,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
37
37
  * @return {{ templatePath, templateData, setting } }
38
38
  */
39
39
 
40
- function data(_izContext, flowSchema, srcPath) {
41
- return [createSourceParams(_izContext, flowSchema, srcPath)];
42
- }
43
-
44
- function createSourceParams(_izContext, flowSchema, srcPath) {
40
+ function createSourceParams(_izContext, flowSchema, appPath) {
45
41
  let functionName = upperCase(FUNCTION_NAME.reservedLimit);
46
42
  let handlerType = upperCase(HANDLER.hdrSqs);
47
43
 
@@ -54,7 +50,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
54
50
  setting: {
55
51
  saveFileName: `${functionName}_${handlerType}`,
56
52
  savePath: path.join(
57
- srcPath,
53
+ appPath,
58
54
  SOURCE_PATH.webSocket,
59
55
  flowSchema.flowTag,
60
56
  'source/'
@@ -65,4 +61,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
65
61
  };
66
62
  }
67
63
 
68
- export default data;
64
+ export default createSourceParams;
@@ -35,11 +35,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
35
35
  * @return {{ templatePath, templateData, setting } }
36
36
  */
37
37
 
38
- function data(_izContext, flowSchema, srcPath) {
39
- return [createSourceParams(_izContext, flowSchema, srcPath)];
40
- }
41
-
42
- function createSourceParams(_izContext, flowSchema, srcPath) {
38
+ function createSourceParams(_izContext, flowSchema, appPath) {
43
39
  let functionName = upperCase(FUNCTION_NAME.reservedLimit);
44
40
  return {
45
41
  templatePath: templatePath,
@@ -49,7 +45,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
49
45
  setting: {
50
46
  saveFileName: `${functionName}_Main`,
51
47
  savePath: path.join(
52
- srcPath,
48
+ appPath,
53
49
  SOURCE_PATH.webSocket,
54
50
  flowSchema.flowTag,
55
51
  'source/'
@@ -60,4 +56,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
60
56
  };
61
57
  }
62
58
 
63
- export default data;
59
+ export default createSourceParams;
@@ -37,12 +37,12 @@ const templatePath = path.join(__dirname, 'template.ejs');
37
37
  * @returns {Object[]} - data of multiple dynamoDb template
38
38
  */
39
39
 
40
- function data(_izContext, srcPath) {
40
+ function data(_izContext, appPath) {
41
41
  let resultForCreateSqs = [];
42
42
  const WebSocketSqsQueueNames = [];
43
43
  const setting = {
44
44
  initialData: 'Resources:\n',
45
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
45
+ savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
46
46
  saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
47
47
  fileExtension: '.yml',
48
48
  isAppend: true
@@ -50,11 +50,7 @@ const { firstLetterUpperCase: upperCase } = utils;
50
50
 
51
51
  const templatePath = path.join(__dirname, 'template.ejs');
52
52
 
53
- function data(_izContext, flowSchema, srcPath) {
54
- return [createSourceParam(_izContext, flowSchema, srcPath)];
55
- }
56
-
57
- function createSourceParam(_izContext, flowSchema, srcPath) {
53
+ function createSourceParam(_izContext, flowSchema, appPath) {
58
54
  let functionName = upperCase(FUNCTION_NAME.processAfterUploadS3);
59
55
  let handlerType = 'HdrS3';
60
56
  let additionalResourcePermission = defaultIamRolePerAction();
@@ -133,7 +129,7 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
133
129
  roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
134
130
  },
135
131
  setting: {
136
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
132
+ savePath: path.join(appPath, SOURCE_PATH.appYaml),
137
133
  saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
138
134
  isAppend: true,
139
135
  fileExtension: '.yml'
@@ -141,4 +137,4 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
141
137
  };
142
138
  }
143
139
 
144
- export default data;
140
+ export default createSourceParam;
@@ -28,11 +28,7 @@ const { SOURCE_PATH, FUNCTION_NAME } = consts;
28
28
  const { firstLetterUpperCase: upperCase } = utils;
29
29
  const templatePath = path.join(__dirname, 'template.ejs');
30
30
 
31
- function data(_izContext, flowSchema, srcPath) {
32
- return [createSourceData(_izContext, flowSchema, srcPath)];
33
- }
34
-
35
- function createSourceData(_izContext, flowSchema, srcPath) {
31
+ function createSourceData(_izContext, flowSchema, appPath) {
36
32
  let functionName = FUNCTION_NAME.processAfterUploadS3;
37
33
  let handlerType = 'HdrS3';
38
34
  return {
@@ -40,7 +36,7 @@ function createSourceData(_izContext, flowSchema, srcPath) {
40
36
  templateData: {},
41
37
  setting: {
42
38
  savePath: path.join(
43
- srcPath,
39
+ appPath,
44
40
  SOURCE_PATH.webSocket,
45
41
  flowSchema.flowTag,
46
42
  'source/'
@@ -50,4 +46,4 @@ function createSourceData(_izContext, flowSchema, srcPath) {
50
46
  }
51
47
  };
52
48
  }
53
- export default data;
49
+ export default createSourceData;
@@ -28,11 +28,7 @@ const { firstLetterUpperCase: upperCase } = utils;
28
28
 
29
29
  const templatePath = path.join(__dirname, 'template.ejs');
30
30
 
31
- function data(_izContext, flowSchema, srcPath) {
32
- return [createSourceParams(_izContext, flowSchema, srcPath)];
33
- }
34
-
35
- function createSourceParams(_izContext, flowSchema, srcPath) {
31
+ function createSourceParams(_izContext, flowSchema, appPath) {
36
32
  let functionName = upperCase(FUNCTION_NAME.processAfterUploadS3);
37
33
  return {
38
34
  templatePath: templatePath,
@@ -40,7 +36,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
40
36
  setting: {
41
37
  saveFileName: `${functionName}_Main`,
42
38
  savePath: path.join(
43
- srcPath,
39
+ appPath,
44
40
  SOURCE_PATH.webSocket,
45
41
  flowSchema.flowTag,
46
42
  'source/'
@@ -50,4 +46,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
50
46
  };
51
47
  }
52
48
 
53
- export default data;
49
+ export default createSourceParams;
@@ -26,7 +26,7 @@ const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
26
 
27
27
  const templatePath = path.join(__dirname, 'template.ejs');
28
28
 
29
- function data(_izContext, flowSchema, srcPath) {
29
+ function data(_izContext, flowSchema, appPath) {
30
30
  let createBucket = false;
31
31
  if (flowSchema.createBucket) {
32
32
  createBucket = true;
@@ -34,11 +34,11 @@ function data(_izContext, flowSchema, srcPath) {
34
34
  if (!createBucket) {
35
35
  return [];
36
36
  } else {
37
- return [createSourceParams(_izContext, flowSchema, srcPath)];
37
+ return [createSourceParams(_izContext, flowSchema, appPath)];
38
38
  }
39
39
  }
40
40
 
41
- function createSourceParams(_izContext, flowSchema, srcPath) {
41
+ function createSourceParams(_izContext, flowSchema, appPath) {
42
42
  let bucketName = flowSchema.bucketName;
43
43
  let resourceName = bucketName.split('-').join('');
44
44
 
@@ -50,7 +50,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
50
50
  },
51
51
  setting: {
52
52
  initialData: 'Resources:\n',
53
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
53
+ savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
54
54
  saveFileName: SAVE_FILE_NAME.S3Bucket,
55
55
  fileExtension: '.yml',
56
56
  isAppend: true
@@ -41,7 +41,7 @@ const templatePath = path.join(
41
41
  * @returns {Object[]} - data of multiple defaultSnsOutData
42
42
  */
43
43
 
44
- function createDataForDefaultSnsOut(_izContext, flowSchema, srcPath) {
44
+ function createDataForDefaultSnsOut(_izContext, flowSchema, appPath) {
45
45
  let resultsForCreateDefaultSnsOut = [];
46
46
  const defaultSnsOutDataList = [
47
47
  {
@@ -55,13 +55,15 @@ function createDataForDefaultSnsOut(_izContext, flowSchema, srcPath) {
55
55
  templateData: defaultSnsOutData,
56
56
  setting: {
57
57
  initialData: 'Resources:\n',
58
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
58
+ savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
59
59
  saveFileName: SAVE_FILE_NAME.snsOutYaml,
60
60
  fileExtension: '.yml',
61
- isAppend: true
61
+ isAppend: true,
62
+ fromFile: 's3/sns-out/data.js'
62
63
  }
63
64
  });
64
65
  }
66
+
65
67
  return resultsForCreateDefaultSnsOut;
66
68
  }
67
69
 
@@ -26,10 +26,10 @@ const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
26
 
27
27
  const templatePath = path.join(
28
28
  __dirname,
29
- '../../../../../resourceYaml/dynamodb/template.ejs'
29
+ '../../../../../resourceYamlComponent/dynamodb/template.ejs'
30
30
  );
31
31
 
32
- function data(_izContext, srcPath) {
32
+ function data(_izContext, appPath) {
33
33
  let resultForCreateSources = [];
34
34
  const reservedDataTables = [
35
35
  {
@@ -56,7 +56,7 @@ function data(_izContext, srcPath) {
56
56
  templateData: reservedDataTable,
57
57
  setting: {
58
58
  initialData: 'Resources:\n',
59
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
59
+ savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
60
60
  saveFileName: SAVE_FILE_NAME.dynamoDbYaml,
61
61
  fileExtension: '.yml',
62
62
  isAppend: true
@@ -57,11 +57,7 @@ const triggerCacheTemplate = path.join(
57
57
  * @return {{templatePath, templateData,setting}}
58
58
  */
59
59
 
60
- async function data(_izContext, flowSchema, srcPath) {
61
- return [await createParamsForCreateSource(_izContext, flowSchema, srcPath)];
62
- }
63
-
64
- async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
60
+ async function createParamsForCreateSource(_izContext, flowSchema, appPath) {
65
61
  let functionName = 'Process' + upperCase(flowSchema.flowTag);
66
62
  let tableName = null;
67
63
  if (
@@ -72,7 +68,7 @@ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
72
68
  .getLocalObjectSchemas(
73
69
  _izContext,
74
70
  [flowSchema.objType.objectType],
75
- path.join(srcPath, './schemas')
71
+ path.join(appPath, 'src/schemas')
76
72
  )
77
73
  .then(res => res.records[0]);
78
74
  if (!objectSchema)
@@ -111,7 +107,7 @@ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
111
107
  },
112
108
  setting: {
113
109
  savePath: path.join(
114
- srcPath,
110
+ appPath,
115
111
  SOURCE_PATH.flowSchema,
116
112
  upperCase(flowSchema.flowTag),
117
113
  'MainHandler/',
@@ -123,4 +119,4 @@ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
123
119
  }
124
120
  };
125
121
  }
126
- export default data;
122
+ export default createParamsForCreateSource;
@@ -16,8 +16,6 @@ along with this program. If not, see
16
16
  <http: //www.gnu.org/licenses />.
17
17
  */
18
18
 
19
-
20
-
21
19
  import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
22
20
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
23
21
  import snsSharedLib from '@izara_project/izara-core-library-sns';
@@ -29,6 +27,7 @@ import { lambda,sns,sqs } from '@izara_project/izara-core-library-external-reque
29
27
  import { NoRetryError } from '@izara_project/izara-core-library-core';
30
28
  import { utils} from '@izara_project/izara-core-library-service-schemas';
31
29
  const { createFlowTypeConcat } = utils;
30
+
32
31
  <% if (statusType === "triggerCache") { -%>
33
32
  import { triggeredCacheSharedLibV2 } from '@izara_project/izara-core-library-trigger-cache';
34
33
  <% } else if (statusType === "statusField") { -%>
@@ -70,8 +69,7 @@ export default async function <%- functionName %> (
70
69
  <% if (statusType === "statusField") { %>
71
70
  <%- include(statusFieldTemplate, { tableName:tableName, flowTag: flowTag }) %>
72
71
  <% } else if (statusType === "storedCache") { %>
73
- <%- include(storedCacheTemplate, { tableName:tableName, flowSchemaComplete:flowSchemaComplete,flowTag }) %>
74
-
72
+ <%- include(storedCacheTemplate, { tableName:tableName, flowSchemaComplete:flowSchemaComplete, flowTag }) %>
75
73
  <% } else if (statusType === "triggerCache") { %>
76
74
  <%- include(triggerCacheTemplate, {
77
75
  tableName: tableName,
@@ -79,7 +77,7 @@ export default async function <%- functionName %> (
79
77
  triggerType: triggerType,
80
78
  flowTag,
81
79
  queueName
82
- }) %>
80
+ }) %>
83
81
  <% } %>
84
82
 
85
83
  //(<endpointHook>)
@@ -382,10 +382,15 @@ function buildNoPluginHookResources(
382
382
  'source/',
383
383
  `${upperCase(flowStepName)}_${upperCase(HANDLER.hdrSqs)}`
384
384
  ),
385
- functionName: upperCase(flowStepName) + HANDLER.hdrSqs,
385
+ functionName:
386
+ upperCase(flowTag) +
387
+ upperCase(flowStepName) +
388
+ upperCase(HANDLER.hdrSqs),
386
389
  additionalResourcePermission: iamRole,
387
390
  functionNameConfig:
388
- upperCase(flowStepName) + upperCase(shortNameHandler(HANDLER.hdrSqs)),
391
+ upperCase(flowTag) +
392
+ upperCase(flowStepName) +
393
+ upperCase(shortNameHandler(HANDLER.hdrSqs)),
389
394
  roleName: upperCase(flowTag),
390
395
  queueNameSqs: `${upperCase(flowTag)}${upperCase(flowStepName)}`
391
396
  },
@@ -25,11 +25,7 @@ const { SOURCE_PATH } = consts;
25
25
 
26
26
  const templatePath = path.join(__dirname, 'template.ejs');
27
27
 
28
- function data(_izContext, flowSchema, srcPath) {
29
- return [createSourceParams(_izContext, flowSchema, srcPath)];
30
- }
31
-
32
- function createSourceParams(_izContext, flowSchema, srcPath) {
28
+ function createSourceParams(_izContext, flowSchema, appPath) {
33
29
  let uploadS3 = false;
34
30
  for (const event of flowSchema.event) {
35
31
  if (event.includes('s3')) {
@@ -43,11 +39,11 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
43
39
  },
44
40
  setting: {
45
41
  saveFileName: 'GenerateCodeLibs',
46
- savePath: path.join(srcPath, SOURCE_PATH.generateCodeLib),
42
+ savePath: path.join(appPath, SOURCE_PATH.generateCodeLib),
47
43
  fileExtension: '.js',
48
44
  isAppend: false
49
45
  }
50
46
  };
51
47
  }
52
48
 
53
- export default data;
49
+ export default createSourceParams;
@@ -59,17 +59,15 @@ const templatePath = path.join(__dirname, 'template.ejs');
59
59
  * @return {{templatePath, templateData,setting}}
60
60
  */
61
61
 
62
- async function data(_izContext, flowSchema, srcPath) {
63
- return [await createSourceParams(_izContext, flowSchema, srcPath)];
64
- }
65
-
66
- async function createSourceParams(_izContext, flowSchema, srcPath) {
62
+ async function createSourceParams(_izContext, flowSchema, appPath) {
67
63
  let functionName = 'CompleteStatusField' + upperCase(flowSchema.flowTag);
68
64
  let handlerType = upperCase(HANDLER.hdrSqs);
69
65
  let additionalResourcePermission = defaultIamRolePerAction();
70
66
  let queueName =
71
67
  'CompleteStatusField' + upperCase(flowSchema.flowTag) + handlerType;
72
- let serviceTag = getLocalConfig(path.join(srcPath, '../'), 'iz_serviceTag');
68
+ const serviceTag = getLocalConfig('iz_serviceTag');
69
+ console.debug('########################## serviceTag: ', serviceTag);
70
+
73
71
  additionalResourcePermission.push(
74
72
  createIamRole(
75
73
  {
@@ -90,7 +88,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
90
88
  .getLocalObjectSchemasWithHierarchy(
91
89
  _izContext,
92
90
  [flowSchema.objType.objectType],
93
- path.join(srcPath, './schemas')
91
+ path.join(appPath, './schemas')
94
92
  )
95
93
  .then(res => res.records[0]);
96
94
  } else {
@@ -99,6 +97,8 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
99
97
  _izContext,
100
98
  flowSchema.objType
101
99
  );
100
+
101
+ console.debug('### objectSchema: ', objectSchema);
102
102
  }
103
103
  if (!objectSchema) {
104
104
  throw new NoRetryError('ObjectSchema not found');
@@ -140,7 +140,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
140
140
  queueName
141
141
  },
142
142
  setting: {
143
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
143
+ savePath: path.join(appPath, SOURCE_PATH.appYaml),
144
144
  saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
145
145
  fileExtension: '.yml',
146
146
  isAppend: true
@@ -148,4 +148,4 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
148
148
  };
149
149
  }
150
150
 
151
- export default data;
151
+ export default createSourceParams;
@@ -36,10 +36,6 @@ const templatePath = path.join(__dirname, 'template.ejs');
36
36
  * @return {{templatePath, templateData,setting}}
37
37
  */
38
38
 
39
- function data(_izContext, flowSchema, srcPath) {
40
- return [createSourceParams(_izContext, flowSchema, srcPath)];
41
- }
42
-
43
39
  function createSourceParams(_izContext, flowSchema, srcPath) {
44
40
  let functionName = 'CompleteStatusField' + upperCase(flowSchema.flowTag);
45
41
  let handlerType = upperCase(HANDLER.hdrSqs);
@@ -66,4 +62,4 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
66
62
  };
67
63
  }
68
64
 
69
- export default data;
65
+ export default createSourceParams;
@@ -3,28 +3,16 @@ import createCompleteStatusFieldFunctionYaml from './functionYaml/data.js';
3
3
  import createCompleteStatusFieldHandler from './handler/data.js';
4
4
  import createCompleteStatusFieldTopicAndQueue from './sns/data.js';
5
5
 
6
- async function createStatusFieldComponent(
7
- _izContext,
8
- flowSchema,
9
- saveFilePath
10
- ) {
6
+ async function createStatusFieldComponent(_izContext, flowSchema, appPath) {
11
7
  const component = [
12
- ...createCompleteStatusFieldMainFunction(
8
+ createCompleteStatusFieldMainFunction(_izContext, flowSchema, appPath),
9
+ await createCompleteStatusFieldFunctionYaml(
13
10
  _izContext,
14
11
  flowSchema,
15
- saveFilePath
12
+ appPath
16
13
  ),
17
- ...(await createCompleteStatusFieldFunctionYaml(
18
- _izContext,
19
- flowSchema,
20
- saveFilePath
21
- )),
22
- ...createCompleteStatusFieldHandler(_izContext, flowSchema, saveFilePath),
23
- ...createCompleteStatusFieldTopicAndQueue(
24
- _izContext,
25
- flowSchema,
26
- saveFilePath
27
- )
14
+ createCompleteStatusFieldHandler(_izContext, flowSchema, appPath),
15
+ ...createCompleteStatusFieldTopicAndQueue(_izContext, flowSchema, appPath)
28
16
  ];
29
17
 
30
18
  return component;