@izara_project/izara-market-library-service-schemas 1.0.31 → 1.0.33
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 +9 -9
- package/src/GenerateCodeLibs/src/Consts.js +29 -13
- package/src/MainLibs/src/Consts.js +13 -5
- package/src/reStructure/GenerateCode.js +16 -18
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +2 -5
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +1 -1
- package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +18 -8
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +5 -5
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +36 -14
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +0 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +18 -18
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +11 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +1 -14
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/statusFieldTemplate.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +81 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/data.js +202 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +21 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/data.js +77 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/request.json +7 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +64 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/data.js +73 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/request.json +5 -0
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +88 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +73 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +53 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +75 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +83 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +17 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +65 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template.ejs +130 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +61 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +70 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +147 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +18 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowSchema → externalTopic/websocket}/handler/template.ejs +17 -16
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +60 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +74 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +89 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → EndpointComplete}/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +82 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +59 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +52 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → EndpointComponent}/mainFunction/template.ejs +24 -30
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → FlowSchemaCompleteComponent}/functionYaml/data.js +24 -22
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → FlowSchemaCompleteComponent}/handler/data.js +7 -21
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/template.ejs +84 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → FlowSchemaCompleteComponent}/mainFunction/data.js +4 -15
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/template.ejs +88 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchema → FlowSchemaComponent}/functionYaml/data.js +24 -22
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchema → FlowSchemaComponent}/functionYaml/template.ejs +2 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchema → FlowSchemaComponent}/handler/data.js +6 -19
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchemaComplete → FlowSchemaComponent}/handler/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchema → FlowSchemaComponent}/mainFunction/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{flowSchema → FlowSchemaComponent}/mainFunction/template.ejs +3 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +96 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/sqsTemplate.ejs +53 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +77 -0
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +207 -114
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +36 -6
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +13 -14
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +3 -3
|
@@ -47,7 +47,7 @@ const createWebSocketCreateObjectCompleteMainFunction = require('./components/up
|
|
|
47
47
|
|
|
48
48
|
// PreSign URL components
|
|
49
49
|
const createReservedLimitFunctionYaml = require('./components/upload/preSignUrl/reservedLimit/functionYaml/data');
|
|
50
|
-
const
|
|
50
|
+
const createReservedLimitHandler = require('./components/upload/preSignUrl/reservedLimit/handler/data');
|
|
51
51
|
const createReservedLimitMainFunction = require('./components/upload/preSignUrl/reservedLimit/mainFunction/data');
|
|
52
52
|
const createReservedLimitQueueName = require('./components/upload/preSignUrl/reservedLimit/sqs/data');
|
|
53
53
|
|
|
@@ -56,6 +56,7 @@ const createPresignUrlFunctionYaml = require('./components/upload/preSignUrl/cre
|
|
|
56
56
|
const createPresignUrlHandler = require('./components/upload/preSignUrl/createPresignUrl/handler/data');
|
|
57
57
|
const createPresignUrlMainFunction = require('./components/upload/preSignUrl/createPresignUrl/mainFunction/data');
|
|
58
58
|
const createPresignUrlQueueName = require('./components/upload/preSignUrl/createPresignUrl/queue/data');
|
|
59
|
+
// const createReservedLimitQueueName = require('./components/upload/preSignUrl/reservedLimit/sqs/data');
|
|
59
60
|
|
|
60
61
|
// Process uploaded file components
|
|
61
62
|
const createProcessAfterUploadS3FunctionYmlS3 = require('./components/upload/processFile/functionYml/HdrS3/data');
|
|
@@ -69,15 +70,45 @@ const createConfirmAfterUploadS3Handler = require('./components/upload/confirmRe
|
|
|
69
70
|
const createConfirmAfterUploadS3MainFunction = require('./components/upload/confirmReserved/mainFunction/data');
|
|
70
71
|
const createConfirmAfterUploadS3Queue = require('./components/upload/confirmReserved/queue/data');
|
|
71
72
|
|
|
73
|
+
// ** External Topic ** //
|
|
74
|
+
const createExternalWebsocketFunctionYaml = require('./externalTopic/websocket/functionYaml/data');
|
|
75
|
+
const createExternalWebsocketHandler = require('./externalTopic/websocket/handler/data');
|
|
76
|
+
const createExternalWebsocketMainFunction = require('./externalTopic/websocket/mainFunction/data');
|
|
77
|
+
const createExternalSqsFunctionYaml = require('./externalTopic/sqs/functionYaml/data');
|
|
78
|
+
const createExternalSqsHandler = require('./externalTopic/sqs/handler/data');
|
|
79
|
+
const createExternalSqsMainFunction = require('./externalTopic/sqs/mainFunction/data');
|
|
80
|
+
const createExternalTopicSnsInSqs = require('./externalTopic/sns-in-sqs/data');
|
|
81
|
+
const createExternalTopicSnsOut = require('./externalTopic/sns-out/data');
|
|
82
|
+
|
|
72
83
|
// flowSchema OwnTopic component
|
|
73
|
-
const createFlowSchemaOwnTopicFunctionYaml = require('./flowSchemaOwnTopic/
|
|
74
|
-
const createFlowSchemaOwnTopicHandler = require('./flowSchemaOwnTopic/
|
|
75
|
-
const createFlowSchemaOwnTopicMainFunction = require('./flowSchemaOwnTopic/
|
|
84
|
+
const createFlowSchemaOwnTopicFunctionYaml = require('./flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data');
|
|
85
|
+
const createFlowSchemaOwnTopicHandler = require('./flowSchemaOwnTopic/FlowSchemaComponent/handler/data');
|
|
86
|
+
const createFlowSchemaOwnTopicMainFunction = require('./flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data');
|
|
76
87
|
|
|
77
88
|
// flowSchema OwnTopicComplete component
|
|
78
|
-
const createFlowSchemaOwnTopicCompleteFunctionYaml = require("./flowSchemaOwnTopic/
|
|
79
|
-
const createFlowSchemaOwnTopicCompleteHandler = require("./flowSchemaOwnTopic/
|
|
80
|
-
const createFlowSchemaOwnTopicCompleteMainFunction = require("./flowSchemaOwnTopic/
|
|
89
|
+
const createFlowSchemaOwnTopicCompleteFunctionYaml = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data");
|
|
90
|
+
const createFlowSchemaOwnTopicCompleteHandler = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/data");
|
|
91
|
+
const createFlowSchemaOwnTopicCompleteMainFunction = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data");
|
|
92
|
+
|
|
93
|
+
// flowSchema OwnTopicEndpoint component
|
|
94
|
+
const createFlowSchemaOwnTopicEndpointFuntionYaml = require('./flowSchemaOwnTopic/EndpointComponent/functionYaml/data');
|
|
95
|
+
const createFlowSchemaOwnTopicEndpointHandler = require('./flowSchemaOwnTopic/EndpointComponent/handler/data');
|
|
96
|
+
const createFlowSchemaOwnTopicEndpointMainFunction = require('./flowSchemaOwnTopic/EndpointComponent/mainFunction/data');
|
|
97
|
+
|
|
98
|
+
// flowSchema OwnTopicEndpointComplete component
|
|
99
|
+
const createFlowSchemaOwnTopicEndpointCompleteFuntionYaml = require('./flowSchemaOwnTopic/EndpointComplete/functionYaml/data');
|
|
100
|
+
const createFlowSchemaOwnTopicEndpointCompleteHandler = require('./flowSchemaOwnTopic/EndpointComplete/handler/data');
|
|
101
|
+
const createFlowSchemaOwnTopicEndpointCompleteMainFunction = require('./flowSchemaOwnTopic/EndpointComplete/mainFunction/data');
|
|
102
|
+
|
|
103
|
+
const createFlowSchemaOwnTopicQueue = require('./flowSchemaOwnTopic/sns-in/data');
|
|
104
|
+
const createFlowSchemaOwnTopicSnsOut = require('./flowSchemaOwnTopic/sns-out/data');
|
|
105
|
+
// ** EventBridge **
|
|
106
|
+
const createFlowSchemaEventBridgeFunctionYaml = require('./eventBridge/functionYaml/data');
|
|
107
|
+
const createFlowSchemaEventBridgeHandler = require('./eventBridge/handler/inv/data');
|
|
108
|
+
const createFlowSchemaEventBridgeMainFunction = require('./eventBridge/mainFunction/data');
|
|
109
|
+
|
|
110
|
+
const createFlowSchemaDynamoDb = require('./dynamoDb/data')
|
|
111
|
+
|
|
81
112
|
|
|
82
113
|
/**
|
|
83
114
|
* Generates code with templates for different actions
|
|
@@ -86,6 +117,7 @@ const createFlowSchemaOwnTopicCompleteMainFunction = require("./flowSchemaOwnTop
|
|
|
86
117
|
* @returns {Array} Array of generated code parameters
|
|
87
118
|
*/
|
|
88
119
|
async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
120
|
+
console.log("objSchemaPath", objSchemaPath);
|
|
89
121
|
try {
|
|
90
122
|
const saveFilePath = join(objSchemaPath, '../');
|
|
91
123
|
let createSourceParams = [];
|
|
@@ -98,131 +130,192 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
98
130
|
|
|
99
131
|
const webSocketResource = [...webSocketTaskTable, ...webSocketConnectYaml, ...webSocketConnectHandler]
|
|
100
132
|
if (allLocalFlowSchemas.records.length) {
|
|
133
|
+
const webSocketGenerateCodeLibs = createWebSocketGenerateCodeLibs(_izContext, saveFilePath)
|
|
101
134
|
createSourceParams.push(
|
|
102
|
-
...webSocketResource
|
|
135
|
+
...webSocketResource,
|
|
136
|
+
...webSocketGenerateCodeLibs
|
|
137
|
+
|
|
103
138
|
)
|
|
104
139
|
}
|
|
105
140
|
|
|
106
141
|
for (const flowSchema of allLocalFlowSchemas.records) {
|
|
107
|
-
|
|
108
|
-
const reservedDataTable = createReservedDataMainTable(_izContext, saveFilePath);
|
|
109
|
-
const bucketS3 = createBucketS3(_izContext, flowSchema, saveFilePath)
|
|
110
|
-
|
|
111
|
-
const functionYamlCreateObjectWebSocket = createFunctionYamlCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
112
|
-
const handlerCreateObjectWebSocket = createHandlerCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
113
|
-
const mainFunctionCreateObjectWebSocket = await createMainFunctionCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
114
|
-
const webSocketCreateObjectCompleteFunctionYaml = createWebSocketCreateObjectCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
115
|
-
const webSocketCreateObjectCompleteQueue = createWebSocketCreateObjectCompleteQueue(_izContext, saveFilePath);
|
|
116
|
-
const webSocketCreateObjectCompleteMainFunction = createWebSocketCreateObjectCompleteMainFunction(_izContext, flowSchema, saveFilePath)
|
|
117
|
-
const webSocketCreateObjectCompleteHandler = createWebSocketCreateObjectCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
118
|
-
|
|
119
|
-
// const webSocketCreateObjectStordCache = createWebSocketCreateObjectStoredCache(_izContext, saveFilePath);
|
|
120
|
-
const webSocketGenerateCodeLibs = createWebSocketGenerateCodeLibs(_izContext, saveFilePath)
|
|
121
|
-
|
|
122
|
-
const getPreSignUrlFunctionYaml = createReservedLimitFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
123
|
-
const getPreSignUrlHandler = createReservedLimitlHandler(_izContext, flowSchema, saveFilePath);
|
|
124
|
-
const getPreSignUrlMainFunction = createReservedLimitMainFunction(_izContext, flowSchema, saveFilePath);
|
|
125
|
-
const getPreSignUrlQueue = createReservedLimitQueueName(_izContext, saveFilePath);
|
|
126
|
-
|
|
127
|
-
const reservedLimitCompleteFunctionYaml = createPresignUrlFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
128
|
-
const reservedLimitCompleteMainFunction = createPresignUrlMainFunction(_izContext, flowSchema, saveFilePath);
|
|
129
|
-
const reservedLimitCompleteHandler = createPresignUrlHandler(_izContext, flowSchema, saveFilePath);
|
|
130
|
-
const reservedLimitCompleteQueue = createPresignUrlQueueName(_izContext, saveFilePath);
|
|
131
|
-
|
|
132
|
-
const processAfterUploadFunctionYmlS3 = createProcessAfterUploadS3FunctionYmlS3(_izContext, flowSchema, saveFilePath);
|
|
133
|
-
// const processAfterUploadFunctionYamlHdrDsq = createProcessAfterUploadS3FunctionYmlDsq(_izContext, saveFilePath);
|
|
134
|
-
const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
|
|
135
|
-
const processAfterUploadHandlerS3 = createProcessAfterUploadS3HandlerS3(_izContext, flowSchema, saveFilePath);
|
|
136
|
-
// const processAfterUploadHandlerDsq = createProcessAfterUploadS3HandlerDsq(_izContext, saveFilePath);
|
|
137
|
-
const processAfterUploadMainFunction = createProcessAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
|
|
138
|
-
|
|
139
|
-
const confirmReservedAfterUploadFunctionYaml = createConfirmAfterUploadS3FunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
140
|
-
const confirmReservedAfterUploadHandler = createConfirmAfterUploadS3Handler(_izContext, flowSchema, saveFilePath);
|
|
141
|
-
const confirmReservedAfterUploadMainFunction = createConfirmAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
|
|
142
|
-
const confirmReservedAfterUploadQueue = createConfirmAfterUploadS3Queue(_izContext, saveFilePath);
|
|
143
|
-
|
|
144
|
-
// Group related resources for better organization
|
|
145
|
-
const webSocketFunctions = [
|
|
146
|
-
...functionYamlCreateObjectWebSocket,
|
|
147
|
-
...handlerCreateObjectWebSocket,
|
|
148
|
-
...mainFunctionCreateObjectWebSocket,
|
|
149
|
-
...webSocketCreateObjectCompleteFunctionYaml,
|
|
150
|
-
...webSocketCreateObjectCompleteQueue,
|
|
151
|
-
...webSocketCreateObjectCompleteMainFunction,
|
|
152
|
-
...webSocketCreateObjectCompleteHandler
|
|
153
|
-
];
|
|
154
|
-
|
|
155
|
-
const getPreSignUrlResources = [
|
|
156
|
-
...getPreSignUrlFunctionYaml,
|
|
157
|
-
...getPreSignUrlHandler,
|
|
158
|
-
...getPreSignUrlMainFunction,
|
|
159
|
-
...getPreSignUrlQueue
|
|
160
|
-
];
|
|
161
|
-
|
|
162
|
-
const reservedLimitResources = [
|
|
163
|
-
...reservedLimitCompleteFunctionYaml,
|
|
164
|
-
...reservedLimitCompleteHandler,
|
|
165
|
-
...reservedLimitCompleteMainFunction,
|
|
166
|
-
...reservedLimitCompleteQueue
|
|
167
|
-
];
|
|
168
|
-
|
|
169
|
-
const processAfterUploadResources = [
|
|
170
|
-
...processAfterUploadFunctionYmlS3,
|
|
171
|
-
...processAfterUploadSqs,
|
|
172
|
-
...processAfterUploadHandlerS3,
|
|
173
|
-
...processAfterUploadMainFunction
|
|
174
|
-
// Commented resources kept for reference
|
|
175
|
-
// ...processAfterUploadHandlerDsq,
|
|
176
|
-
// ...processAfterUploadFunctionYamlHdrDsq
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
const confirmAfterUploadResources = [
|
|
180
|
-
...confirmReservedAfterUploadFunctionYaml,
|
|
181
|
-
...confirmReservedAfterUploadHandler,
|
|
182
|
-
...confirmReservedAfterUploadMainFunction,
|
|
183
|
-
...confirmReservedAfterUploadQueue
|
|
184
|
-
];
|
|
185
|
-
|
|
186
|
-
// Group all resources related to S3 upload functionality
|
|
187
|
-
const webSocketUploadS3Resources = [
|
|
188
|
-
...webSocketFunctions,
|
|
189
|
-
...webSocketGenerateCodeLibs,
|
|
190
|
-
...reservedDataTable
|
|
191
|
-
];
|
|
192
|
-
|
|
193
|
-
const flowSchemaOwnTopicFunctionYaml = createFlowSchemaOwnTopicFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
194
|
-
const flowSchemaOwnTopicHandler = createFlowSchemaOwnTopicHandler(_izContext, flowSchema, saveFilePath);
|
|
195
|
-
const flowSchemaOwnTopicMainFunction = createFlowSchemaOwnTopicMainFunction(_izContext, flowSchema, saveFilePath);
|
|
196
|
-
|
|
197
|
-
const flowSchemaOwnTopicComponent = [...flowSchemaOwnTopicFunctionYaml, ...flowSchemaOwnTopicHandler, ...flowSchemaOwnTopicMainFunction];
|
|
198
|
-
|
|
199
|
-
const flowSchemaOwnTopicCompleteFunctionYaml = createFlowSchemaOwnTopicCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
200
|
-
const flowSchemaOwnTopicCompleteHandler = createFlowSchemaOwnTopicCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
201
|
-
const flowSchemaOwnTopicCompleteMainFunction = createFlowSchemaOwnTopicCompleteMainFunction(_izContext, flowSchema, saveFilePath);
|
|
202
|
-
|
|
203
|
-
const flowSchemaOwnTopicCompleteComponent = [...flowSchemaOwnTopicCompleteFunctionYaml, ...flowSchemaOwnTopicCompleteHandler, ...flowSchemaOwnTopicCompleteMainFunction]
|
|
142
|
+
console.log("flowSchema in Generate TemplateData", flowSchema);
|
|
204
143
|
for (const event of flowSchema.event) {
|
|
205
144
|
if (event.includes("s3")) {
|
|
206
|
-
|
|
145
|
+
const reservedDataTable = createReservedDataMainTable(_izContext, saveFilePath);
|
|
146
|
+
const bucketS3 = createBucketS3(_izContext, flowSchema, saveFilePath)
|
|
147
|
+
|
|
148
|
+
const functionYamlCreateObjectWebSocket = createFunctionYamlCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
149
|
+
const handlerCreateObjectWebSocket = createHandlerCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
150
|
+
const mainFunctionCreateObjectWebSocket = await createMainFunctionCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
|
|
151
|
+
const webSocketCreateObjectCompleteFunctionYaml = createWebSocketCreateObjectCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
152
|
+
const webSocketCreateObjectCompleteQueue = createWebSocketCreateObjectCompleteQueue(_izContext, saveFilePath);
|
|
153
|
+
const webSocketCreateObjectCompleteMainFunction = createWebSocketCreateObjectCompleteMainFunction(_izContext, flowSchema, saveFilePath)
|
|
154
|
+
const webSocketCreateObjectCompleteHandler = createWebSocketCreateObjectCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
155
|
+
|
|
156
|
+
// const webSocketCreateObjectStordCache = createWebSocketCreateObjectStoredCache(_izContext, saveFilePath);
|
|
157
|
+
|
|
158
|
+
const getPreSignUrlFunctionYaml = createReservedLimitFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
159
|
+
const getPreSignUrlHandler = createReservedLimitHandler(_izContext, flowSchema, saveFilePath);
|
|
160
|
+
const getPreSignUrlMainFunction = createReservedLimitMainFunction(_izContext, flowSchema, saveFilePath);
|
|
161
|
+
const getPreSignUrlQueue = createReservedLimitQueueName(_izContext, saveFilePath);
|
|
162
|
+
|
|
163
|
+
const reservedLimitCompleteFunctionYaml = createPresignUrlFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
164
|
+
const reservedLimitCompleteMainFunction = createPresignUrlMainFunction(_izContext, flowSchema, saveFilePath);
|
|
165
|
+
const reservedLimitCompleteHandler = createPresignUrlHandler(_izContext, flowSchema, saveFilePath);
|
|
166
|
+
const reservedLimitCompleteQueue = createPresignUrlQueueName(_izContext, saveFilePath);
|
|
167
|
+
|
|
168
|
+
const processAfterUploadFunctionYmlS3 = createProcessAfterUploadS3FunctionYmlS3(_izContext, flowSchema, saveFilePath);
|
|
169
|
+
// const processAfterUploadFunctionYamlHdrDsq = createProcessAfterUploadS3FunctionYmlDsq(_izContext, saveFilePath);
|
|
170
|
+
const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
|
|
171
|
+
const processAfterUploadHandlerS3 = createProcessAfterUploadS3HandlerS3(_izContext, flowSchema, saveFilePath);
|
|
172
|
+
// const processAfterUploadHandlerDsq = createProcessAfterUploadS3HandlerDsq(_izContext, saveFilePath);
|
|
173
|
+
const processAfterUploadMainFunction = createProcessAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
|
|
174
|
+
|
|
175
|
+
const confirmReservedAfterUploadFunctionYaml = createConfirmAfterUploadS3FunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
176
|
+
const confirmReservedAfterUploadHandler = createConfirmAfterUploadS3Handler(_izContext, flowSchema, saveFilePath);
|
|
177
|
+
const confirmReservedAfterUploadMainFunction = createConfirmAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
|
|
178
|
+
const confirmReservedAfterUploadQueue = createConfirmAfterUploadS3Queue(_izContext, saveFilePath);
|
|
179
|
+
|
|
180
|
+
const webSocketFunctions = [
|
|
181
|
+
...functionYamlCreateObjectWebSocket,
|
|
182
|
+
...handlerCreateObjectWebSocket,
|
|
183
|
+
...mainFunctionCreateObjectWebSocket,
|
|
184
|
+
...webSocketCreateObjectCompleteFunctionYaml,
|
|
185
|
+
...webSocketCreateObjectCompleteQueue,
|
|
186
|
+
...webSocketCreateObjectCompleteMainFunction,
|
|
187
|
+
...webSocketCreateObjectCompleteHandler
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
const getPreSignUrlResources = [
|
|
191
|
+
...getPreSignUrlFunctionYaml,
|
|
192
|
+
...getPreSignUrlHandler,
|
|
193
|
+
...getPreSignUrlMainFunction,
|
|
194
|
+
...getPreSignUrlQueue
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
const reservedLimitResources = [
|
|
198
|
+
...reservedLimitCompleteFunctionYaml,
|
|
199
|
+
...reservedLimitCompleteHandler,
|
|
200
|
+
...reservedLimitCompleteMainFunction,
|
|
201
|
+
...reservedLimitCompleteQueue
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
const processAfterUploadResources = [
|
|
205
|
+
...processAfterUploadFunctionYmlS3,
|
|
206
|
+
...processAfterUploadSqs,
|
|
207
|
+
...processAfterUploadHandlerS3,
|
|
208
|
+
...processAfterUploadMainFunction
|
|
209
|
+
// Commented resources kept for reference
|
|
210
|
+
// ...processAfterUploadHandlerDsq,
|
|
211
|
+
// ...processAfterUploadFunctionYamlHdrDsq
|
|
212
|
+
];
|
|
213
|
+
|
|
214
|
+
const confirmAfterUploadResources = [
|
|
215
|
+
...confirmReservedAfterUploadFunctionYaml,
|
|
216
|
+
...confirmReservedAfterUploadHandler,
|
|
217
|
+
...confirmReservedAfterUploadMainFunction,
|
|
218
|
+
...confirmReservedAfterUploadQueue
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
const webSocketUploadS3Resources = [
|
|
222
|
+
...webSocketFunctions,
|
|
223
|
+
...reservedDataTable,
|
|
224
|
+
...bucketS3,
|
|
225
|
+
];
|
|
226
|
+
console.log("event s3 generated")
|
|
227
|
+
|
|
207
228
|
createSourceParams.push(
|
|
208
229
|
...webSocketUploadS3Resources,
|
|
209
230
|
...getPreSignUrlResources,
|
|
210
231
|
...reservedLimitResources,
|
|
211
|
-
...bucketS3,
|
|
212
232
|
...processAfterUploadResources,
|
|
213
|
-
...confirmAfterUploadResources
|
|
233
|
+
...confirmAfterUploadResources,
|
|
214
234
|
);
|
|
235
|
+
|
|
236
|
+
} else if (event.includes("extTopic")) {
|
|
237
|
+
// ** External Topic ** //
|
|
238
|
+
const externalTopicSnsInSqs = createExternalTopicSnsInSqs(_izContext, flowSchema, saveFilePath);
|
|
239
|
+
const externalTopicSnsOut = createExternalTopicSnsOut(_izContext, flowSchema, saveFilePath);
|
|
240
|
+
const externalWebsocketFunctionYaml = createExternalWebsocketFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
241
|
+
const externalWebsocketHandler = createExternalWebsocketHandler(_izContext, flowSchema, saveFilePath);
|
|
242
|
+
const externalWebsocketMainFunction = createExternalWebsocketMainFunction(_izContext, flowSchema, saveFilePath);
|
|
243
|
+
const externalSqsFunctionYaml = createExternalSqsFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
244
|
+
const externalSqsHandler = createExternalSqsHandler(_izContext, flowSchema, saveFilePath);
|
|
245
|
+
const externalSqsMainFunction = createExternalSqsMainFunction(_izContext, flowSchema, saveFilePath);
|
|
246
|
+
|
|
247
|
+
// Group related resources for better organization
|
|
248
|
+
const externalTopic = [
|
|
249
|
+
...externalWebsocketFunctionYaml,
|
|
250
|
+
...externalWebsocketHandler,
|
|
251
|
+
...externalWebsocketMainFunction,
|
|
252
|
+
...externalSqsFunctionYaml,
|
|
253
|
+
...externalSqsHandler,
|
|
254
|
+
...externalSqsMainFunction,
|
|
255
|
+
...externalTopicSnsInSqs,
|
|
256
|
+
...externalTopicSnsOut
|
|
257
|
+
];
|
|
258
|
+
|
|
259
|
+
console.log("event externalTopic generated")
|
|
260
|
+
createSourceParams.push(...externalTopic)
|
|
261
|
+
|
|
262
|
+
} else if (event.includes("ownTopic")) {
|
|
263
|
+
|
|
264
|
+
// flowSchema OwnTopic components
|
|
265
|
+
const flowSchemaOwnTopicFunctionYaml = createFlowSchemaOwnTopicFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
266
|
+
const flowSchemaOwnTopicHandler = createFlowSchemaOwnTopicHandler(_izContext, flowSchema, saveFilePath);
|
|
267
|
+
const flowSchemaOwnTopicMainFunction = createFlowSchemaOwnTopicMainFunction(_izContext, flowSchema, saveFilePath);
|
|
268
|
+
const flowSchemaOwnTopicComponent = [...flowSchemaOwnTopicFunctionYaml, ...flowSchemaOwnTopicHandler, ...flowSchemaOwnTopicMainFunction]
|
|
269
|
+
// flowSchema OwnTopic Complete component
|
|
270
|
+
const flowSchemaOwnTopicCompleteFunctionYaml = createFlowSchemaOwnTopicCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
271
|
+
const flowSchemaOwnTopicCompleteHandler = createFlowSchemaOwnTopicCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
272
|
+
const flowSchemaOwnTopicCompleteMainFunction = createFlowSchemaOwnTopicCompleteMainFunction(_izContext, flowSchema, saveFilePath);
|
|
273
|
+
const flowSchemaOwnTopicCompleteComponent = [...flowSchemaOwnTopicCompleteFunctionYaml, ...flowSchemaOwnTopicCompleteHandler, ...flowSchemaOwnTopicCompleteMainFunction]
|
|
274
|
+
// flowSchemaOwnTopic Endpoint
|
|
275
|
+
const flowSchemaOwnTopicEndpointFuntionYaml = createFlowSchemaOwnTopicEndpointFuntionYaml(_izContext, flowSchema, saveFilePath);
|
|
276
|
+
const flowSchemaOwnTopicEndpointHandler = createFlowSchemaOwnTopicEndpointHandler(_izContext, flowSchema, saveFilePath);
|
|
277
|
+
const flowSchemaOwnTopicEndpointMainFunction = createFlowSchemaOwnTopicEndpointMainFunction(_izContext, flowSchema, saveFilePath);
|
|
278
|
+
const flowSchemaOwnTopicEndpointComponent = [...flowSchemaOwnTopicEndpointFuntionYaml, ...flowSchemaOwnTopicEndpointHandler, ...flowSchemaOwnTopicEndpointMainFunction]
|
|
279
|
+
|
|
280
|
+
// flowSchemaOwnTopic EndpointComplete
|
|
281
|
+
const flowSchemaOwnTopicEndpointCompleteFuntionYaml = createFlowSchemaOwnTopicEndpointCompleteFuntionYaml(_izContext, flowSchema, saveFilePath);
|
|
282
|
+
const flowSchemaOwnTopicEndpointCompleteHandler = createFlowSchemaOwnTopicEndpointCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
283
|
+
const flowSchemaOwnTopicEndpointCompleteMainFunction = createFlowSchemaOwnTopicEndpointCompleteMainFunction(_izContext, flowSchema, saveFilePath);
|
|
284
|
+
const flowSchemaOwnTopicEndpointCompleteComponent = [...flowSchemaOwnTopicEndpointCompleteFuntionYaml, ...flowSchemaOwnTopicEndpointCompleteHandler, ...flowSchemaOwnTopicEndpointCompleteMainFunction];
|
|
285
|
+
|
|
286
|
+
const flowSchemaOwnTopicQueue = createFlowSchemaOwnTopicQueue(_izContext, flowSchema, saveFilePath);
|
|
287
|
+
const flowSchemaOwnTopicSnsOut = createFlowSchemaOwnTopicSnsOut(_izContext, flowSchema, saveFilePath);
|
|
288
|
+
// Group the resources
|
|
289
|
+
const ownTopicResources = [
|
|
290
|
+
...flowSchemaOwnTopicComponent, ...flowSchemaOwnTopicCompleteComponent, ...flowSchemaOwnTopicEndpointComponent, ...flowSchemaOwnTopicQueue, ...flowSchemaOwnTopicSnsOut, ...flowSchemaOwnTopicEndpointCompleteComponent
|
|
291
|
+
];
|
|
292
|
+
|
|
293
|
+
console.log("event ownTopic generated")
|
|
294
|
+
createSourceParams.push(...ownTopicResources);
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
} else if (event.includes("eventBridge")) {
|
|
298
|
+
const flowSchemaEventBridgeHandler = createFlowSchemaEventBridgeHandler(_izContext, flowSchema, saveFilePath);
|
|
299
|
+
const flowSchemaEventBridgeMainFunction = createFlowSchemaEventBridgeMainFunction(_izContext, flowSchema, saveFilePath);
|
|
300
|
+
const flowSchemaEventBridgeFunctionYaml = createFlowSchemaEventBridgeFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
301
|
+
|
|
302
|
+
// Group the resources
|
|
303
|
+
const eventBridgeResources = [
|
|
304
|
+
...flowSchemaEventBridgeHandler,
|
|
305
|
+
...flowSchemaEventBridgeMainFunction,
|
|
306
|
+
...flowSchemaEventBridgeFunctionYaml
|
|
307
|
+
];
|
|
308
|
+
|
|
309
|
+
console.log("event eventBridge generated")
|
|
310
|
+
createSourceParams.push(...eventBridgeResources);
|
|
215
311
|
}
|
|
216
312
|
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
...flowSchemaOwnTopicCompleteComponent
|
|
221
|
-
)
|
|
313
|
+
if (flowSchema.statusType === "storedCache") {
|
|
314
|
+
const flowSchemaDynamoDb = createFlowSchemaDynamoDb(_izContext, flowSchema, saveFilePath)
|
|
315
|
+
createSourceParams.push(...flowSchemaDynamoDb);
|
|
222
316
|
}
|
|
223
317
|
}
|
|
224
318
|
}
|
|
225
|
-
console.log("createSourceParams in flowSchemas", createSourceParams)
|
|
226
319
|
return createSourceParams;
|
|
227
320
|
} catch (error) {
|
|
228
321
|
_izContext.logger.error('Error generating code with template flowSchema:', error);
|
|
@@ -106,7 +106,7 @@ const createSharedResource = (_izContext, createSourceParams, srcPath) => {
|
|
|
106
106
|
handlerType: [],
|
|
107
107
|
resources: {}
|
|
108
108
|
},
|
|
109
|
-
[SOURCE_GENERATE_IAM_ROLE.
|
|
109
|
+
[SOURCE_GENERATE_IAM_ROLE.PerActionEndpoint]: {
|
|
110
110
|
handlerType: [],
|
|
111
111
|
resources: {}
|
|
112
112
|
},
|
|
@@ -114,6 +114,18 @@ const createSharedResource = (_izContext, createSourceParams, srcPath) => {
|
|
|
114
114
|
handlerType: [],
|
|
115
115
|
resources: {}
|
|
116
116
|
},
|
|
117
|
+
[SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole]: {
|
|
118
|
+
handlerType: [],
|
|
119
|
+
resources: {}
|
|
120
|
+
},
|
|
121
|
+
"WebsocketConnect": {
|
|
122
|
+
handlerType: [],
|
|
123
|
+
resources: {}
|
|
124
|
+
},
|
|
125
|
+
[SOURCE_GENERATE_IAM_ROLE.EventBridge]: {
|
|
126
|
+
handlerType: [],
|
|
127
|
+
resources: {}
|
|
128
|
+
},
|
|
117
129
|
Other: []
|
|
118
130
|
};
|
|
119
131
|
const objectTypeList = [];
|
|
@@ -189,24 +201,42 @@ const createSharedResource = (_izContext, createSourceParams, srcPath) => {
|
|
|
189
201
|
templateData.additionalResourcePermission,
|
|
190
202
|
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole].resources
|
|
191
203
|
);
|
|
192
|
-
} else if (templateData
|
|
204
|
+
} else if (templateData?.roleName?.includes(SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role)) {
|
|
193
205
|
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role].handlerType.push(templateData);
|
|
194
206
|
processResourcePermissions(
|
|
195
207
|
templateData.additionalResourcePermission,
|
|
196
208
|
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role].resources
|
|
197
209
|
)
|
|
198
|
-
} else if (templateData
|
|
199
|
-
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.
|
|
210
|
+
} else if (templateData?.roleName?.includes(SOURCE_GENERATE_IAM_ROLE.PerActionEndpoint)) {
|
|
211
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.PerActionEndpoint].handlerType.push(templateData);
|
|
200
212
|
processResourcePermissions(
|
|
201
213
|
templateData.additionalResourcePermission,
|
|
202
|
-
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.
|
|
214
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.PerActionEndpoint].resources
|
|
203
215
|
)
|
|
204
|
-
} else if (templateData
|
|
216
|
+
} else if (templateData?.roleName?.includes(SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic)) {
|
|
205
217
|
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic].handlerType.push(templateData);
|
|
206
218
|
processResourcePermissions(
|
|
207
219
|
templateData.additionalResourcePermission,
|
|
208
220
|
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic].resources
|
|
209
221
|
)
|
|
222
|
+
} else if (templateData?.roleName?.includes(SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole)) {
|
|
223
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole].handlerType.push(templateData);
|
|
224
|
+
processResourcePermissions(
|
|
225
|
+
templateData.additionalResourcePermission,
|
|
226
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole].resources
|
|
227
|
+
)
|
|
228
|
+
} else if (templateData?.roleName?.includes("WebsocketConnect")) {
|
|
229
|
+
groupedByObjectType["WebsocketConnect"].handlerType.push(templateData);
|
|
230
|
+
processResourcePermissions(
|
|
231
|
+
templateData.additionalResourcePermission,
|
|
232
|
+
groupedByObjectType["WebsocketConnect"].resources
|
|
233
|
+
)
|
|
234
|
+
} else if (templateData.roleName.includes(SOURCE_GENERATE_IAM_ROLE.EventBridge)) {
|
|
235
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.EventBridge].handlerType.push(templateData);
|
|
236
|
+
processResourcePermissions(
|
|
237
|
+
templateData.additionalResourcePermission,
|
|
238
|
+
groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.EventBridge].resources
|
|
239
|
+
)
|
|
210
240
|
}
|
|
211
241
|
else {
|
|
212
242
|
// Handle other items
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs
CHANGED
|
@@ -270,7 +270,7 @@ module.exports.createRelationship = async (
|
|
|
270
270
|
let messageParams = {
|
|
271
271
|
Message: JSON.stringify(createRelCompleteMsg),
|
|
272
272
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
273
|
-
TopicArn: await snsSharedLib.
|
|
273
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete),
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
_izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
|
|
@@ -376,7 +376,7 @@ module.exports.createRelationship = async (
|
|
|
376
376
|
|
|
377
377
|
let messageToInCreateRelationship = {
|
|
378
378
|
Message: JSON.stringify(createRelMessageBody),
|
|
379
|
-
TopicArn: await snsSharedLib.
|
|
379
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateRel, storageResource.graphServiceTag),
|
|
380
380
|
};
|
|
381
381
|
_izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInCreateRelationship);
|
|
382
382
|
await sns.publishAsync(_izContext, messageToInCreateRelationship);
|
|
@@ -403,7 +403,7 @@ module.exports.createRelationship = async (
|
|
|
403
403
|
let sendMessageToOutCreateRelComplete = {
|
|
404
404
|
Message: JSON.stringify(messageObject),
|
|
405
405
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
406
|
-
TopicArn: await snsSharedLib.
|
|
406
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
|
|
407
407
|
}
|
|
408
408
|
_izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutCreateRelComplete);
|
|
409
409
|
await sns.publishAsync(_izContext, sendMessageToOutCreateRelComplete);
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs
CHANGED
|
@@ -236,7 +236,7 @@ module.exports.deleteRelationship = async (
|
|
|
236
236
|
let messageParams = {
|
|
237
237
|
Message: JSON.stringify(deleteRelCompleteMsg),
|
|
238
238
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
239
|
-
TopicArn: await snsSharedLib.
|
|
239
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete),
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
_izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
|
|
@@ -336,7 +336,7 @@ module.exports.deleteRelationship = async (
|
|
|
336
336
|
|
|
337
337
|
let messageToInUpdateRelationship = {
|
|
338
338
|
Message: JSON.stringify(deleteRelMessageBody),
|
|
339
|
-
TopicArn: await snsSharedLib.
|
|
339
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inDeleteRel, storageResource.graphServiceTag),
|
|
340
340
|
};
|
|
341
341
|
_izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInUpdateRelationship);
|
|
342
342
|
await sns.publishAsync(_izContext, messageToInUpdateRelationship);
|
|
@@ -363,7 +363,7 @@ module.exports.deleteRelationship = async (
|
|
|
363
363
|
let sendMessageToOutDeleteRelComplete = {
|
|
364
364
|
Message: JSON.stringify(messageObject),
|
|
365
365
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
366
|
-
TopicArn: await snsSharedLib.
|
|
366
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
|
|
367
367
|
}
|
|
368
368
|
_izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutDeleteRelComplete);
|
|
369
369
|
await sns.publishAsync(_izContext, sendMessageToOutDeleteRelComplete);
|
package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs
CHANGED
|
@@ -86,14 +86,14 @@ module.exports.getRelationship = async (
|
|
|
86
86
|
relType,
|
|
87
87
|
relId,
|
|
88
88
|
relationshipDirection,
|
|
89
|
-
//(<
|
|
90
|
-
//(</
|
|
89
|
+
//(<requestparamGetRel>)
|
|
90
|
+
//(</requestparamGetRel>)
|
|
91
91
|
} = requestParams;
|
|
92
92
|
|
|
93
93
|
let errorsFound = [];
|
|
94
94
|
|
|
95
|
-
//(<
|
|
96
|
-
//(</
|
|
95
|
+
//(<beforeValidateGetRel>)
|
|
96
|
+
//(</beforeValidateGetRel>).
|
|
97
97
|
// validate object and identifiers
|
|
98
98
|
async function validateIdentifiersExists(_izContext, objType, identifiersObject) {
|
|
99
99
|
|
|
@@ -125,11 +125,11 @@ module.exports.getRelationship = async (
|
|
|
125
125
|
await validateIdentifiersExists(_izContext, secondObject.objType, secondObject.identifiers);
|
|
126
126
|
// finished validate object and identifiers
|
|
127
127
|
|
|
128
|
-
//(<
|
|
129
|
-
//(</
|
|
128
|
+
//(<afterValidateGetRel>)
|
|
129
|
+
//(</afterValidateGetRel>)
|
|
130
130
|
|
|
131
|
-
//(<
|
|
132
|
-
//(</
|
|
131
|
+
//(<beforeGetRel>)
|
|
132
|
+
//(</beforeGetRel>)
|
|
133
133
|
|
|
134
134
|
const relationshipSchema = await getRelationshipSchemaWithCache(_izContext, relType);
|
|
135
135
|
_izContext.logger.debug("relationshipSchema: ", relationshipSchema);
|
|
@@ -205,8 +205,8 @@ module.exports.getRelationship = async (
|
|
|
205
205
|
secondObject: secondObject,
|
|
206
206
|
relType: relType,
|
|
207
207
|
relationshipDirection,
|
|
208
|
-
//(<
|
|
209
|
-
//(</
|
|
208
|
+
//(<inGetRelCompleteMsgCrateRel>)
|
|
209
|
+
//(</inGetRelCompleteMsgCrateRel>)
|
|
210
210
|
status: 'error',
|
|
211
211
|
errorFounds: errorsFound
|
|
212
212
|
};
|
|
@@ -221,7 +221,7 @@ module.exports.getRelationship = async (
|
|
|
221
221
|
let messageParams = {
|
|
222
222
|
Message: JSON.stringify(getRelCompleteMsg),
|
|
223
223
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
224
|
-
TopicArn: await snsSharedLib.
|
|
224
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outGetRelComplete),
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
_izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
|
|
@@ -276,8 +276,7 @@ module.exports.getRelationship = async (
|
|
|
276
276
|
)
|
|
277
277
|
result = getResultFromDynamo;
|
|
278
278
|
}
|
|
279
|
-
}
|
|
280
|
-
)
|
|
279
|
+
})
|
|
281
280
|
)
|
|
282
281
|
|
|
283
282
|
let messageObject = {
|
|
@@ -297,7 +296,7 @@ module.exports.getRelationship = async (
|
|
|
297
296
|
let sendMessageToOutGetRelComplete = {
|
|
298
297
|
Message: JSON.stringify(messageObject),
|
|
299
298
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
300
|
-
TopicArn: await snsSharedLib.
|
|
299
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outGetRelComplete)
|
|
301
300
|
}
|
|
302
301
|
_izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutGetRelComplete);
|
|
303
302
|
await sns.publishAsync(_izContext, sendMessageToOutGetRelComplete);
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs
CHANGED
|
@@ -235,7 +235,7 @@ module.exports.updateRelationship = async (
|
|
|
235
235
|
let messageParams = {
|
|
236
236
|
Message: JSON.stringify(updateCompleteMsg),
|
|
237
237
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
238
|
-
TopicArn: await snsSharedLib.
|
|
238
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete),
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
_izContext.logger.debug("messageParams OutUpdateRelationshipComplete ::::::: ", messageParams);
|
|
@@ -338,7 +338,7 @@ module.exports.updateRelationship = async (
|
|
|
338
338
|
|
|
339
339
|
let messageToInUpdateRelationship = {
|
|
340
340
|
Message: JSON.stringify(updateRelMessageBody),
|
|
341
|
-
TopicArn: await snsSharedLib.
|
|
341
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateRel, storageResource.graphServiceTag),
|
|
342
342
|
};
|
|
343
343
|
_izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInUpdateRelationship);
|
|
344
344
|
await sns.publishAsync(_izContext, messageToInUpdateRelationship);
|
|
@@ -364,7 +364,7 @@ module.exports.updateRelationship = async (
|
|
|
364
364
|
let sendMessageToOutCreateRelComplete = {
|
|
365
365
|
Message: JSON.stringify(messageObject),
|
|
366
366
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
367
|
-
TopicArn: await snsSharedLib.
|
|
367
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
|
|
368
368
|
}
|
|
369
369
|
_izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutCreateRelComplete);
|
|
370
370
|
await sns.publishAsync(_izContext, sendMessageToOutCreateRelComplete);
|