@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-market-library-service-schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "Schemas for Izara Market project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"testEnvironment": "node"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@izara_project/izara-core-library-calling-flow": "^1.0.3",
|
|
23
24
|
"@izara_project/izara-core-library-core": "^1.0.18",
|
|
24
|
-
"@izara_project/izara-core-library-external-request": "^1.0.
|
|
25
|
-
"@izara_project/izara-core-library-
|
|
26
|
-
"@izara_project/izara-
|
|
27
|
-
"@izara_project/izara-
|
|
28
|
-
"@izara_project/izara-core-library-
|
|
29
|
-
"@izara_project/izara-
|
|
30
|
-
"@izara_project/izara-
|
|
31
|
-
"@izara_project/izara-core-library-logger": "^1.0.6",
|
|
25
|
+
"@izara_project/izara-core-library-external-request": "^1.0.18",
|
|
26
|
+
"@izara_project/izara-core-library-logger": "^1.0.7",
|
|
27
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.49",
|
|
28
|
+
"@izara_project/izara-core-library-sns": "^1.0.4",
|
|
29
|
+
"@izara_project/izara-core-library-sqs": "^1.0.4",
|
|
30
|
+
"@izara_project/izara-shared": "^1.0.126",
|
|
31
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.6",
|
|
32
32
|
"ejs": "^3.1.10",
|
|
33
33
|
"js-beautify": "^1.15.4",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
@@ -28,19 +28,34 @@ const PREFIX = {
|
|
|
28
28
|
getRel: "getRelationshipEndpoint"
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// const TOPIC_NAME_GRAPH_HANDLER = {
|
|
32
|
+
// inUpdateRel: "InUpdateRelationship",
|
|
33
|
+
// inCreateRel: "InCreateRelationshipV2",
|
|
34
|
+
// outUpdateRel: "OutUpdateRelationship",
|
|
35
|
+
// outCreateRel: "OutCreateRelationship",
|
|
36
|
+
// inDeleteRel: "InDeleteRelationshipV2",
|
|
37
|
+
// outDeleteRel: "OutDeleteRelationshipV2",
|
|
38
|
+
// inUpdateNode: "InUpdateNode",
|
|
39
|
+
// outUpdateNode: "OutUpdateNode",
|
|
40
|
+
// inCreateNode: "InCreateNodeV2",
|
|
41
|
+
// outCreateNode: "OutCreateNodeV2",
|
|
42
|
+
// inDeleteNode: "InDeleteNodeV2",
|
|
43
|
+
// outDeleteNode: "OutDeleteNodeV2",
|
|
44
|
+
// }
|
|
45
|
+
|
|
31
46
|
const TOPIC_NAME_GRAPH_HANDLER = {
|
|
32
|
-
inUpdateRel: "
|
|
33
|
-
inCreateRel: "
|
|
34
|
-
outUpdateRel: "
|
|
35
|
-
outCreateRel: "
|
|
36
|
-
inDeleteRel: "
|
|
37
|
-
outDeleteRel: "
|
|
38
|
-
inUpdateNode: "
|
|
39
|
-
outUpdateNode: "
|
|
40
|
-
inCreateNode: "
|
|
41
|
-
outCreateNode: "
|
|
42
|
-
inDeleteNode: "
|
|
43
|
-
outDeleteNode: "
|
|
47
|
+
inUpdateRel: "UpdateRelationship_In",
|
|
48
|
+
inCreateRel: "CreateRelationship_In",
|
|
49
|
+
outUpdateRel: "UpdateRelationship_Out",
|
|
50
|
+
outCreateRel: "CreateRelationship_Out",
|
|
51
|
+
inDeleteRel: "DeleteRelationship_In",
|
|
52
|
+
outDeleteRel: "DeleteRelationship_Out",
|
|
53
|
+
inUpdateNode: "UpdateNode_In",
|
|
54
|
+
outUpdateNode: "UpdateNode_Out",
|
|
55
|
+
inCreateNode: "CreateNode_In",
|
|
56
|
+
outCreateNode: "CreateNode_Out",
|
|
57
|
+
inDeleteNode: "DeleteNode_In",
|
|
58
|
+
outDeleteNode: "DeleteNode_Out"
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
const TOPIC_NAME_GENERATE_CODE = {
|
|
@@ -62,7 +77,8 @@ const TOPIC_NAME_GENERATE_CODE = {
|
|
|
62
77
|
outGetNodeComplete: "GetNodeComplete_Out",
|
|
63
78
|
reservedLimitComplete: "ReservedLimitComplete",
|
|
64
79
|
createPresignUrl: "CreatePresignUrl",
|
|
65
|
-
flowSchemaOwnTopicComplete: "FlowSchemaOwnTopicComplete"
|
|
80
|
+
flowSchemaOwnTopicComplete: "FlowSchemaOwnTopicComplete",
|
|
81
|
+
flowSchemaOwnTopicEndpointComplete: "flowSchemaOwnTopicEndpointComplete",
|
|
66
82
|
}
|
|
67
83
|
|
|
68
84
|
const GRAPH_HANDLER_SERVICE_NAME = {
|
|
@@ -119,7 +119,11 @@ const SOURCE_PATH = {
|
|
|
119
119
|
webSocket: "../src/generatedCode/FlowSchema/UploadS3/",
|
|
120
120
|
resourceLocationWebSocket: "src/generatedCode/FlowSchema/UploadS3/",
|
|
121
121
|
flowSchemaOwnTopic: "../src/generatedCode/FlowSchema/FlowSchemaOwnTopic/",
|
|
122
|
-
resourceLocationFlowSchemaOwnTopic: "src/generatedCode/flowSchemaOwnTopic/
|
|
122
|
+
resourceLocationFlowSchemaOwnTopic: "src/generatedCode/flowSchemaOwnTopic/",
|
|
123
|
+
flowSchemaExternalTopic: "../src/generatedCode/FlowSchema/FlowSchemaExternalTopic/",
|
|
124
|
+
resourceLocationFlowSchemaExternalTopic: "src/generatedCode/flowSchemaExternalTopic/",
|
|
125
|
+
flowSchemaEventBridge: "../src/generatedCode/FlowSchema/EventBridge/",
|
|
126
|
+
resourceLocationFlowSchemaEventBridge: "src/generatedCode/FlowSchema/EventBridge/",
|
|
123
127
|
generateCodeLib: "../src/generatedCode/libs/source/",
|
|
124
128
|
logicalFunctionHook: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source/",
|
|
125
129
|
resourceLocationLogicalFunctionHook: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source",
|
|
@@ -190,7 +194,7 @@ function externalResourceName(resourceClass, resourceName, serviceTag) {
|
|
|
190
194
|
// [RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/*/" + `${resourceName}`,
|
|
191
195
|
[RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/" + `"${serviceTag}"` + `"${resourceName}"`,
|
|
192
196
|
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${await lambdaSharedLib.lambdaFunctionName(_izContext, " + `"${resourceName}" ,"${serviceTag}")}`,
|
|
193
|
-
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${await snsSharedLib.
|
|
197
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${await snsSharedLib.snsTopicNameByFlowSchema(_izContext, " + `"${resourceName}", "${serviceTag}")}`
|
|
194
198
|
|
|
195
199
|
}[resourceClass]
|
|
196
200
|
};
|
|
@@ -255,7 +259,10 @@ const FUNCTION_NAME = {
|
|
|
255
259
|
reservedLimit: "reservedLimit",
|
|
256
260
|
createPresignUrl: "createPresignUrl",
|
|
257
261
|
flowSchemaOwnTopic: "flowSchemaOwnTopic",
|
|
258
|
-
flowSchemaOwnTopicComplete: "flowSchemaOwnTopicComplete"
|
|
262
|
+
flowSchemaOwnTopicComplete: "flowSchemaOwnTopicComplete",
|
|
263
|
+
flowSchemaOwnTopicEndpoint: "flowSchemaOwnTopicEndpoint",
|
|
264
|
+
flowSchemaOwnTopicEndpointComplete: "flowSchemaOwnTopicEndpointComplete",
|
|
265
|
+
flowSchemaExternalTopic: "externalTopic",
|
|
259
266
|
};
|
|
260
267
|
|
|
261
268
|
const SHORT_FUNCTION_NAME = {
|
|
@@ -372,8 +379,9 @@ const SOURCE_GENERATE_IAM_ROLE = {
|
|
|
372
379
|
RelationshipCompleteRole: "RelationshipCom",
|
|
373
380
|
FlowSchemaUploadS3Role: "FlowSchemaUploadS3",
|
|
374
381
|
FlowSchemaOwnTopic: "FlowSchemaOwnTopic",
|
|
375
|
-
|
|
376
|
-
|
|
382
|
+
PerActionEndpoint: "PerActionEndpoint",
|
|
383
|
+
ExternalTopicRole: "ExternalTopic",
|
|
384
|
+
EventBridge: "EventBridge",
|
|
377
385
|
};
|
|
378
386
|
|
|
379
387
|
const ADD_ON_DATA_STRUCTURE_TYPE = {
|
|
@@ -45,16 +45,17 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
45
45
|
let localServicePath = join(saveFilePath, "../../");
|
|
46
46
|
|
|
47
47
|
// // define path for store yml file
|
|
48
|
-
const GENERATE_CODE_SOURCE_PATH = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
// const GENERATE_CODE_SOURCE_PATH = {
|
|
49
|
+
// appYaml: join(saveFilePath, SOURCE_PATH.appYaml),
|
|
50
|
+
// resourceYaml: join(saveFilePath, SOURCE_PATH.resourceYaml),
|
|
51
|
+
// lambdaPerAction: join(saveFilePath, SOURCE_PATH.lambdaPerAction),
|
|
52
|
+
// externalService: join(saveFilePath, SOURCE_PATH.externalService),
|
|
53
|
+
// relationshipPerAction: join(saveFilePath, SOURCE_PATH.relationshipPerAction),
|
|
54
|
+
// webSocketEndpoint: join(saveFilePath, SOURCE_PATH.webSocket),
|
|
55
|
+
// generateCodeLib: join(saveFilePath, SOURCE_PATH.generateCodeLib),
|
|
56
|
+
// generatedMainFunctionPerService: join(saveFilePath, SOURCE_PATH.endpointPerService),
|
|
57
|
+
// flowSchema: join(saveFilePath,'../src/generatedCode/flowSchema')
|
|
58
|
+
// };
|
|
58
59
|
|
|
59
60
|
//------ Start Create Source ------
|
|
60
61
|
|
|
@@ -108,18 +109,15 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
108
109
|
if (status === false) {
|
|
109
110
|
throw Error(errors)
|
|
110
111
|
}
|
|
111
|
-
}
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
// console.log("templatePath in generateCode", setting.savePath)
|
|
114
|
+
// empty file by savePath
|
|
115
|
+
// validate path before empty folder
|
|
116
|
+
validatePathWithRootServicePath(localServicePath, setting.savePath)
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
await deleteFileInDir(folderPathToEmpty);
|
|
118
|
+
await deleteFileInDir(setting.savePath);
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
|
|
123
121
|
// generate all source
|
|
124
122
|
for (let item of allCreateSource) {
|
|
125
123
|
// throw error if item is invalid
|
|
@@ -205,9 +205,6 @@ module.exports.createMain = async (
|
|
|
205
205
|
}
|
|
206
206
|
})
|
|
207
207
|
);
|
|
208
|
-
if (serviceTag.includes(GRAPH_HANDLER_SERVICE_NAME.graphHandler)) {
|
|
209
|
-
filteredRequiredOnCreatedLinks.push(requiredLink);
|
|
210
|
-
}
|
|
211
208
|
})
|
|
212
209
|
)
|
|
213
210
|
_izContext.logger.debug("filteredRequiredOnCreatedLinks", filteredRequiredOnCreatedLinks);
|
|
@@ -530,7 +527,7 @@ module.exports.createMain = async (
|
|
|
530
527
|
|
|
531
528
|
let messageToCreateObject = {
|
|
532
529
|
Message: JSON.stringify(messageObject),
|
|
533
|
-
TopicArn: await snsSharedLib.
|
|
530
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateNode, graphServiceName)
|
|
534
531
|
};
|
|
535
532
|
_izContext.logger.debug("RequestParams before send to sqs messageToCreateObject ::::::: ", messageToCreateObject);
|
|
536
533
|
await sns.publishAsync(_izContext, messageToCreateObject);
|
|
@@ -621,4 +618,4 @@ module.exports.createMain = async (
|
|
|
621
618
|
} catch (err) {
|
|
622
619
|
throw (err)
|
|
623
620
|
}
|
|
624
|
-
}
|
|
621
|
+
}
|
|
@@ -159,7 +159,7 @@ module.exports.deleteMain = async (
|
|
|
159
159
|
let deleteNodeMessageBody = {
|
|
160
160
|
Message: JSON.stringify(deleteNodeParams),
|
|
161
161
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
162
|
-
TopicArn: await snsSharedLib.
|
|
162
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inDeleteNode, storageTag)
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
_izContext.logger.debug("request message params before send to IndeleteNode::", deleteNodeMessageBody);
|
|
@@ -249,7 +249,7 @@ module.exports.updateMain = async (
|
|
|
249
249
|
let updateNodeMessageBody = {
|
|
250
250
|
Message: JSON.stringify(updateNodeParams),
|
|
251
251
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
252
|
-
TopicArn: await snsSharedLib.
|
|
252
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag,)
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
_izContext.logger.debug('requset param before send to topic InUpdateNode:::', updateNodeMessageBody);
|
|
@@ -66,7 +66,7 @@ async function data(_izContext, allObjSchemas, srcPath) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async function createParamForCreateSource(_izContext, allObjSchemas, action, handler, srcPath) {
|
|
69
|
-
let groupBy = SOURCE_GENERATE_IAM_ROLE.
|
|
69
|
+
let groupBy = SOURCE_GENERATE_IAM_ROLE.PerActionEndpoint;
|
|
70
70
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
71
71
|
let functionNameConfig = upperCase(action) + upperCase(shortNameHandler(handler))
|
|
72
72
|
|
|
@@ -21,7 +21,7 @@ const path = require('path');
|
|
|
21
21
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/index.js").utils;
|
|
22
22
|
const templateYamlPath = path.join(__dirname, "./templateYaml.ejs");
|
|
23
23
|
const templatePathIntTestPath = path.join(__dirname, "./templateIntTesting.ejs");
|
|
24
|
-
const { SOURCE_PATH, SOURCE_GENERATE_IAM_ROLE } = require("../../../../MainLibs/
|
|
24
|
+
const { SOURCE_PATH, SOURCE_GENERATE_IAM_ROLE } = require("../../../../MainLibs/src/Consts.js");
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
function data(_izContext, createSourceParams, srcPath) {
|
|
@@ -50,13 +50,23 @@ function data(_izContext, createSourceParams, srcPath) {
|
|
|
50
50
|
const roleNameConcatConfigs = new Set();
|
|
51
51
|
|
|
52
52
|
// Add default IAM roles from configuration
|
|
53
|
-
Object.entries(SOURCE_GENERATE_IAM_ROLE)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
// Object.entries(SOURCE_GENERATE_IAM_ROLE)
|
|
54
|
+
// .filter(([_, enabled]) => enabled)
|
|
55
|
+
// .forEach(([_, value]) => {
|
|
56
|
+
// if (value === SOURCE_GENERATE_IAM_ROLE.NodeCompleteRole) return;
|
|
57
|
+
// roleNameConfigs.add(`${upperCase(value)}Role`);
|
|
58
|
+
// roleNameConcatConfigs.add(`${upperCase(value)}`);
|
|
59
|
+
// });
|
|
60
|
+
for (const data of createSourceParams) {
|
|
61
|
+
let roleName = data.templateData?.roleName
|
|
62
|
+
if (roleName) {
|
|
63
|
+
if (roleName === SOURCE_GENERATE_IAM_ROLE.NodeCompleteRole) {
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
roleNameConfigs.add(`${upperCase(roleName)}Role`);
|
|
67
|
+
roleNameConcatConfigs.add(`${upperCase(roleName)}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
|
|
61
71
|
// Extract role names from templateData in createSourceParams
|
|
62
72
|
createSourceParams.forEach(({ templateData }) => {
|
|
@@ -115,7 +115,7 @@ async function externalLambdaIamRoleDataPerAction(_izContext, allObjSchemas) {
|
|
|
115
115
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
116
116
|
},
|
|
117
117
|
storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.map(graphServiceName =>
|
|
118
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
118
|
+
externalResourceName(RESOURCE_CLASSES.sns, "UpdateNode_In", graphServiceName)
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
createIamRole(
|
|
@@ -123,7 +123,7 @@ async function externalLambdaIamRoleDataPerAction(_izContext, allObjSchemas) {
|
|
|
123
123
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
124
124
|
},
|
|
125
125
|
storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.map(graphServiceName =>
|
|
126
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
126
|
+
externalResourceName(RESOURCE_CLASSES.sns, "CreateNode_In", graphServiceName)
|
|
127
127
|
)
|
|
128
128
|
)
|
|
129
129
|
)
|
|
@@ -151,7 +151,7 @@ async function externalLamdaIamRoleRelationships(_izContext, allRelSchemas) {
|
|
|
151
151
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
152
152
|
},
|
|
153
153
|
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
154
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
154
|
+
externalResourceName(RESOURCE_CLASSES.sns, "UpdateRelationship_In", graphServiceName)
|
|
155
155
|
)
|
|
156
156
|
),
|
|
157
157
|
createIamRole(
|
|
@@ -159,7 +159,7 @@ async function externalLamdaIamRoleRelationships(_izContext, allRelSchemas) {
|
|
|
159
159
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
160
160
|
},
|
|
161
161
|
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
162
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
162
|
+
externalResourceName(RESOURCE_CLASSES.sns, "CreateRelationship_In", graphServiceName)
|
|
163
163
|
)
|
|
164
164
|
),
|
|
165
165
|
createIamRole(
|
|
@@ -167,7 +167,7 @@ async function externalLamdaIamRoleRelationships(_izContext, allRelSchemas) {
|
|
|
167
167
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
168
168
|
},
|
|
169
169
|
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
170
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
170
|
+
externalResourceName(RESOURCE_CLASSES.sns, "DeleteRelationship_In", graphServiceName)
|
|
171
171
|
)
|
|
172
172
|
),
|
|
173
173
|
createIamRole(
|
|
@@ -75,6 +75,10 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
75
75
|
const snsServiceConfigForConfirmReserved = await snsSubscriptionConfirmReserved(_izContext);
|
|
76
76
|
snsServiceConfigForConfirmReserved && snsServiceConfigArray.push(snsServiceConfigForConfirmReserved);
|
|
77
77
|
}
|
|
78
|
+
if (event.includes("extTopic")) {
|
|
79
|
+
const snsServiceConfigForExtTopic = await snsSubscriptionFlowSchemaExternalTopic(_izContext, localFlowSchema);
|
|
80
|
+
snsServiceConfigForExtTopic && snsServiceConfigArray.push(snsServiceConfigForExtTopic);
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
}
|
|
@@ -95,10 +99,10 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
95
99
|
|
|
96
100
|
// update Relationship
|
|
97
101
|
async function snsSubScriptionUpdateRelationshipComplete(_izContext, allRelSchemas) {
|
|
98
|
-
let
|
|
102
|
+
let serviceTag = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas)
|
|
99
103
|
|
|
100
104
|
return {
|
|
101
|
-
|
|
105
|
+
serviceTag: serviceTag,
|
|
102
106
|
topicName: TOPIC_NAME_GRAPH_HANDLER.outUpdateRel, // external service
|
|
103
107
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.updateRelComplete // in service
|
|
104
108
|
}
|
|
@@ -106,10 +110,10 @@ async function snsSubScriptionUpdateRelationshipComplete(_izContext, allRelSchem
|
|
|
106
110
|
|
|
107
111
|
// create Relationship
|
|
108
112
|
async function snsSubscriptionCreateRelationshipComplete(_izContext, allRelSchemas) {
|
|
109
|
-
let
|
|
113
|
+
let serviceTag = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas)
|
|
110
114
|
|
|
111
115
|
return {
|
|
112
|
-
|
|
116
|
+
serviceTag: serviceTag,
|
|
113
117
|
topicName: TOPIC_NAME_GRAPH_HANDLER.outCreateRel,
|
|
114
118
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.createRelComplete
|
|
115
119
|
}
|
|
@@ -118,20 +122,20 @@ async function snsSubscriptionCreateRelationshipComplete(_izContext, allRelSchem
|
|
|
118
122
|
// topic not create yet will return error when initialSetup
|
|
119
123
|
// create topic for OutUpdateNodeComplete
|
|
120
124
|
async function snsSubscriptionOutUpdateNodeComplete(_izContext, allObjSchemas) {
|
|
121
|
-
let
|
|
125
|
+
let serviceTag = await getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas)
|
|
122
126
|
|
|
123
127
|
return {
|
|
124
|
-
|
|
128
|
+
serviceTag: serviceTag,
|
|
125
129
|
topicName: TOPIC_NAME_GRAPH_HANDLER.outUpdateNode,
|
|
126
130
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.updateNodeComplete
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
async function snsSubscriptionCreateNodeComplete(_izContext, allObjectSchemas) {
|
|
131
|
-
let
|
|
135
|
+
let serviceTag = await getGraphServiceNameFromObjectSchema(_izContext, allObjectSchemas)
|
|
132
136
|
|
|
133
137
|
return {
|
|
134
|
-
|
|
138
|
+
serviceTag: serviceTag,
|
|
135
139
|
topicName: TOPIC_NAME_GRAPH_HANDLER.outCreateNode,
|
|
136
140
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.createNodeComplete
|
|
137
141
|
}
|
|
@@ -148,19 +152,19 @@ async function snsSubscriptionDeleteNodeComplate(_izContext, allObjectSchemas) {
|
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
async function snsSubscriptionDeleteRelatipnshipComplete(_izContext, allRelSchemas) {
|
|
151
|
-
let
|
|
155
|
+
let serviceTag = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas)
|
|
152
156
|
|
|
153
157
|
return {
|
|
154
|
-
|
|
158
|
+
serviceTag: serviceTag,
|
|
155
159
|
topicName: TOPIC_NAME_GRAPH_HANDLER.outDeleteRel,
|
|
156
160
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.deleteRelComplete
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
function snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext) {
|
|
161
|
-
let
|
|
165
|
+
let serviceTag = [EXTERNAL_SERVICE_NAME.accountLimits]
|
|
162
166
|
return {
|
|
163
|
-
|
|
167
|
+
serviceTag: serviceTag,
|
|
164
168
|
topicName: TOPIC_NAME_EXTERNAL_SERVICE.reservedDynamicUsageComplete,
|
|
165
169
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.createPresignUrl + upperCase(HANDLER.hdrSqs)
|
|
166
170
|
}
|
|
@@ -168,12 +172,30 @@ function snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext)
|
|
|
168
172
|
|
|
169
173
|
|
|
170
174
|
function snsSubscriptionConfirmReserved(_izContext) {
|
|
171
|
-
let
|
|
175
|
+
let serviceTag = [EXTERNAL_SERVICE_NAME.accountLimits];
|
|
172
176
|
return {
|
|
173
|
-
|
|
177
|
+
serviceTag: serviceTag,
|
|
174
178
|
topicName: TOPIC_NAME_EXTERNAL_SERVICE.reservedDynamicUsageComplete,
|
|
175
179
|
sqsEndpoint: "ConfirmNewReserved" + upperCase(HANDLER.hdrSqs)
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
|
|
183
|
+
function snsSubscriptionFlowSchemaExternalTopic(_izContext, localFlowSchema) {
|
|
184
|
+
const flowSteps = Object.keys(localFlowSchema.flowSteps || {});
|
|
185
|
+
const lastIndex = flowSteps.length - 1;
|
|
186
|
+
|
|
187
|
+
if (lastIndex >= 0) {
|
|
188
|
+
const flowStep = flowSteps[lastIndex];
|
|
189
|
+
const splitFlowStepKey = flowStep.split("_");
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
serviceTag: [splitFlowStepKey[0]],
|
|
193
|
+
topicName: splitFlowStepKey[2],
|
|
194
|
+
sqsEndpoint: splitFlowStepKey[3]
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
179
201
|
module.exports = createExternalSnsSubscriptions;
|
|
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
module.exports.generatedSnsTopicSubscription = [ <% datas.forEach(data => { -%>
|
|
21
|
-
<% data.
|
|
21
|
+
<% data.serviceTag.forEach(serviceTag => { _%>
|
|
22
22
|
{
|
|
23
|
-
|
|
23
|
+
serviceTag: "<%- serviceTag %>",
|
|
24
24
|
topicName: "<%- data.topicName %>",
|
|
25
25
|
sqsEndpoint: "<%- data.sqsEndpoint %>"
|
|
26
26
|
},
|
|
@@ -21,7 +21,7 @@ const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
|
|
|
21
21
|
const snsSharedLib = require('@izara_project/izara-core-library-sns')
|
|
22
22
|
const sns = require('@izara_project/izara-core-library-external-request').sns
|
|
23
23
|
const consts = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
24
|
-
const { getNestObject } = require('../../libs/source/
|
|
24
|
+
const { getNestObject } = require('../../libs/source/GenerateCodeLibs')
|
|
25
25
|
/**
|
|
26
26
|
* description of function.
|
|
27
27
|
* @param {Object} _izContext
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
5
|
events:
|
|
6
|
-
- websocket:
|
|
7
|
-
route: $connect
|
|
8
|
-
- websocket:
|
|
9
|
-
route: $disconnect
|
|
10
6
|
- websocket:
|
|
11
7
|
route: $default
|
|
12
8
|
- websocket:
|
package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs
CHANGED
|
@@ -26,7 +26,7 @@ const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-
|
|
|
26
26
|
const hash = require('object-hash')
|
|
27
27
|
// const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
28
28
|
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
29
|
-
const { postToConnection } = require("../../libs/source/
|
|
29
|
+
const { postToConnection } = require("../../libs/source/GenerateCodeLibs");
|
|
30
30
|
const createObject = require('./CreateObjectS3_Main');
|
|
31
31
|
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
32
32
|
|
|
@@ -21,7 +21,7 @@ const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
|
21
21
|
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
22
22
|
let coreConsts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
23
23
|
|
|
24
|
-
const { postToConnection } = require('../../libs/source/
|
|
24
|
+
const { postToConnection } = require('../../libs/source/GenerateCodeLibs')
|
|
25
25
|
module.exports.webSocketTaskComplete = async (
|
|
26
26
|
_izContext,
|
|
27
27
|
objType,
|
|
@@ -55,7 +55,7 @@ function createDataForDefaultSnsInSqs(_izContext, srcPath) {
|
|
|
55
55
|
defaultSnsInSqsDataList.push(
|
|
56
56
|
{
|
|
57
57
|
queueName: upperCase(FUNCTION_NAME.createObjectS3Complete) + upperCase(HANDLER.hdrSqs),
|
|
58
|
-
subScription:
|
|
58
|
+
subScription: upperCase(FUNCTION_NAME.updateNodeComplete) + "_Out"
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -32,11 +32,10 @@ const client = new S3Client({ region: 'us-east-2' });
|
|
|
32
32
|
const { createPresignedPost } = require('@aws-sdk/s3-presigned-post');
|
|
33
33
|
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
34
34
|
|
|
35
|
-
const { postToConnection } = require("../../libs/source/
|
|
35
|
+
const { postToConnection,getNestObject } = require("../../libs/source/GenerateCodeLibs");
|
|
36
36
|
const hash = require('object-hash');
|
|
37
37
|
const utils = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils');
|
|
38
38
|
const coreConsts = require('@izara_project/izara-core-library-core/src/Consts');
|
|
39
|
-
const { getNestObject } = require("../../libs/source/ImportDataLib");
|
|
40
39
|
const { EXTERNAL_SERVICE_NAME } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
41
40
|
/**
|
|
42
41
|
* description of function.
|
|
@@ -88,7 +88,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
88
88
|
functionName,
|
|
89
89
|
handlerType,
|
|
90
90
|
functionNameConfig: functionName + upperCase(handlerType),
|
|
91
|
-
resourceLocation: path.join(SOURCE_PATH.resourceLocationWebSocket, flowSchema.flowTag, "source/"),
|
|
91
|
+
resourceLocation: path.join(SOURCE_PATH.resourceLocationWebSocket, flowSchema.flowTag, "/source/"),
|
|
92
92
|
additionalResourcePermission,
|
|
93
93
|
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
94
94
|
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
@@ -27,7 +27,7 @@ const lambda = externalRequest.lambda
|
|
|
27
27
|
const consts = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
28
28
|
const coreConsts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
29
29
|
const hash = require('object-hash');
|
|
30
|
-
const importDataLibs = require('../../libs/source/
|
|
30
|
+
const importDataLibs = require('../../libs/source/GenerateCodeLibs')
|
|
31
31
|
/**
|
|
32
32
|
* description of function.
|
|
33
33
|
* @param {Object} _izContext
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
##===== SNS Subscription
|
|
2
|
-
|
|
3
|
-
Subscription<%- queueName %>:
|
|
2
|
+
SubscriptionOut<%- queueNameSubscription %>:
|
|
4
3
|
Type: AWS::SNS::Subscription
|
|
5
4
|
Properties:
|
|
6
|
-
TopicArn: !Ref <%-
|
|
7
|
-
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%-
|
|
5
|
+
TopicArn: !Ref Out<%- queueNameSubscription %>
|
|
6
|
+
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueNameSubscription %>Out"
|
|
8
7
|
Protocol: "sqs"
|
|
9
8
|
##===== [Queue]
|
|
10
|
-
<%- queueName
|
|
9
|
+
<%- queueName %>:
|
|
11
10
|
Type: "AWS::SQS::Queue"
|
|
12
11
|
Properties:
|
|
13
|
-
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
12
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
14
13
|
RedrivePolicy:
|
|
15
14
|
deadLetterTargetArn:
|
|
16
15
|
# !GetAtt
|
|
17
16
|
Fn::GetAtt:
|
|
18
|
-
- <%- queueName %>
|
|
17
|
+
- <%- queueName %>DLQ
|
|
19
18
|
- Arn
|
|
20
19
|
maxReceiveCount: 3
|
|
21
20
|
VisibilityTimeout: 120
|
|
22
21
|
##==== [QueueDLQ]
|
|
23
|
-
<%- queueName %>
|
|
22
|
+
<%- queueName %>DLQ:
|
|
24
23
|
Type: AWS::SQS::Queue
|
|
25
24
|
Properties:
|
|
26
|
-
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
25
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
27
26
|
##==== [QueuePolicy]
|
|
28
|
-
<%- queueName %>
|
|
27
|
+
<%- queueName %>Policy:
|
|
29
28
|
Type: AWS::SQS::QueuePolicy
|
|
30
29
|
Properties:
|
|
31
30
|
PolicyDocument:
|
|
@@ -37,17 +36,18 @@
|
|
|
37
36
|
Resource:
|
|
38
37
|
# !GetAtt
|
|
39
38
|
Fn::GetAtt:
|
|
40
|
-
- <%- queueName %>
|
|
39
|
+
- <%- queueName %>
|
|
41
40
|
- Arn
|
|
42
41
|
Action: "SQS:SendMessage"
|
|
43
42
|
Queues:
|
|
44
|
-
- Ref: <%- queueName %>
|
|
43
|
+
- Ref: <%- queueName %>
|
|
45
44
|
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
46
45
|
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
|
|
48
|
+
<%_ function firstLetterUpperCase(text){
|
|
49
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
50
|
+
} _%>
|
|
51
|
+
<%_ function firstLetterLowerCase(str) {
|
|
52
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
53
|
+
} _%>
|
|
@@ -33,7 +33,7 @@ const s3 = new S3Client({ region: 'us-east-2' });
|
|
|
33
33
|
|
|
34
34
|
const hash = require('object-hash');
|
|
35
35
|
const Readable = require('stream');
|
|
36
|
-
const { isValidCsv, getNestObject } = require('../../libs/source/
|
|
36
|
+
const { isValidCsv, getNestObject } = require('../../libs/source/GenerateCodeLibs')
|
|
37
37
|
const consts = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
38
38
|
const coreConsts = require('@izara_project/izara-core-library-core/src/Consts');
|
|
39
39
|
|
|
@@ -31,7 +31,7 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
31
31
|
templatePath: templatePath,
|
|
32
32
|
templateData: {},
|
|
33
33
|
setting: {
|
|
34
|
-
saveFileName: "
|
|
34
|
+
saveFileName: "GenerateCodeLibs",
|
|
35
35
|
savePath: path.join(srcPath, SOURCE_PATH.generateCodeLib),
|
|
36
36
|
fileExtension: ".js",
|
|
37
37
|
isAppend: false
|