@izara_project/izara-market-library-service-schemas 1.0.65 → 1.0.67
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 +3 -3
- package/src/GenerateCodeLibs/src/Consts.js +7 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +11 -1
- package/src/MainLibs/src/Consts.js +64 -25
- package/src/MainLibs/src/GenerateCodeUtils.js +6 -6
- package/src/reStructure/GenerateCode.js +2 -1
- package/src/reStructure/TemplateData/EndpointPerService/generateTemplateData.js +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +20 -4
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +49 -5
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +3 -0
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +14 -0
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +3 -3
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +4 -2
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/template.ejs +9 -9
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +24 -24
- package/src/reStructure/TemplateData/generateRole/data.js +38 -24
- package/src/reStructure/TemplateData/generateRole/template.ejs +5 -7
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +1 -1
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +4 -4
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +136 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +202 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +144 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +11 -11
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +159 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +202 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +144 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +158 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +202 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +144 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +131 -88
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +158 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +202 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +144 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +160 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +172 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +218 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +161 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +197 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +386 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +121 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +129 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +56 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +159 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/template.ejs +46 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +164 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/data.js +73 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/template.ejs +9 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +202 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +144 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +8 -7
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +36 -30
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +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.67",
|
|
4
4
|
"description": "Schemas for Izara Market project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@izara_project/izara-core-library-core": "^1.0.20",
|
|
25
25
|
"@izara_project/izara-core-library-external-request": "^1.0.20",
|
|
26
26
|
"@izara_project/izara-core-library-logger": "^1.0.7",
|
|
27
|
-
"@izara_project/izara-core-library-service-schemas": "^1.0.
|
|
27
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.95",
|
|
28
28
|
"@izara_project/izara-core-library-sns": "^1.0.6",
|
|
29
29
|
"@izara_project/izara-core-library-sqs": "^1.0.4",
|
|
30
30
|
"@izara_project/izara-shared": "^1.0.126",
|
|
31
|
-
"@izara_project/izara-shared-service-schemas": "^1.0.
|
|
31
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.31",
|
|
32
32
|
"@izara_project/izara-shared-core": "^1.0.2",
|
|
33
33
|
"ejs": "^3.1.10",
|
|
34
34
|
"js-beautify": "^1.15.4",
|
|
@@ -58,7 +58,9 @@ const TOPIC_NAME_GRAPH_HANDLER = {
|
|
|
58
58
|
inDeleteNode: "DeleteNode_In",
|
|
59
59
|
outDeleteNode: "DeleteNode_Out",
|
|
60
60
|
inChangeRelationship: "ChangeRelationshipType_In",
|
|
61
|
-
outChangeRelationship: "ChangeRelationshipType_Out"
|
|
61
|
+
outChangeRelationship: "ChangeRelationshipType_Out",
|
|
62
|
+
inMoveRelationship: "MoveRelationship_In",
|
|
63
|
+
outMoveRelationship: "MoveRelationship_Out"
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
const TOPIC_NAME_GENERATE_CODE = {
|
|
@@ -83,7 +85,10 @@ const TOPIC_NAME_GENERATE_CODE = {
|
|
|
83
85
|
flowSchemaOwnTopicComplete: "FlowSchemaOwnTopicComplete",
|
|
84
86
|
flowSchemaOwnTopicEndpointComplete: "FlowSchemaOwnTopicEndpointComplete",
|
|
85
87
|
createRecordComplete: "CreateRecordComplete",
|
|
86
|
-
changeRelationshipComplete: "ChangeRelationshipComplete"
|
|
88
|
+
changeRelationshipComplete: "ChangeRelationshipComplete",
|
|
89
|
+
outChangeRelationshipComplete: "ChangeRelationshipComplete_Out",
|
|
90
|
+
moveRelationshipComplete: "MoveRelationshipComplete",
|
|
91
|
+
outMoveRelationshipComplete: "MoveRelationshipComplete_Out"
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
const GRAPH_HANDLER_SERVICE_NAME = {
|
|
@@ -889,7 +889,17 @@ async function createDataDetailsLib(_izContext, objectSchemas, settings = { buck
|
|
|
889
889
|
});
|
|
890
890
|
};
|
|
891
891
|
};
|
|
892
|
-
}
|
|
892
|
+
} else if (storageResources[eachStorageResourceTag].storageType === consts.STORAGE_TYPES.externalTopic) {
|
|
893
|
+
let topicName = storageResources[eachStorageResourceTag].serviceTag + storageResources[eachStorageResourceTag].stage + storageResources[eachStorageResourceTag].topicName
|
|
894
|
+
Object.assign(createDataDetails, {
|
|
895
|
+
[topicName]: {
|
|
896
|
+
storageType: consts.STORAGE_TYPES.externalTopic,
|
|
897
|
+
fieldNames: [keyFieldName],
|
|
898
|
+
accountId: storageResources[eachStorageResourceTag].accountId,
|
|
899
|
+
region: storageResources[eachStorageResourceTag].region,
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
}
|
|
893
903
|
};
|
|
894
904
|
}; // end loop storageResourceTags
|
|
895
905
|
}; // end loop
|
|
@@ -286,32 +286,38 @@ const FUNCTION_NAME = {
|
|
|
286
286
|
createRecordComplete: "createRecordComplete",
|
|
287
287
|
flowSchemaRegister: "register",
|
|
288
288
|
changeRel: "changeRelationship",
|
|
289
|
-
changeRelComplete: "changeRelationshipComplete"
|
|
289
|
+
changeRelComplete: "changeRelationshipComplete",
|
|
290
|
+
moveRel: "moveRelationship",
|
|
291
|
+
moveRelComplete: "moveRelationshipComplete"
|
|
290
292
|
};
|
|
291
293
|
|
|
292
|
-
const SHORT_FUNCTION_NAME = {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
294
|
+
const SHORT_FUNCTION_NAME = (functionName) => {
|
|
295
|
+
return {
|
|
296
|
+
[FUNCTION_NAME.updateRel]: "updateRel",
|
|
297
|
+
[FUNCTION_NAME.createRel]: "createRel",
|
|
298
|
+
[FUNCTION_NAME.updateRelComplete]: "updateRelComp",
|
|
299
|
+
[FUNCTION_NAME.createRelComplete]: "createRelComp",
|
|
300
|
+
[FUNCTION_NAME.deleteRel]: "deleteRel",
|
|
301
|
+
[FUNCTION_NAME.deleteRelComplete]: "deleteRelComp",
|
|
302
|
+
// translateId: "translateIdsReq",
|
|
303
|
+
// translateIdsProcess: "processTranslateIds",
|
|
304
|
+
// outTranslateIds: "processTranslateIdsComp",
|
|
305
|
+
[FUNCTION_NAME.findData]: "findData",
|
|
306
|
+
[FUNCTION_NAME.processLogical]: "processLogical",
|
|
307
|
+
[FUNCTION_NAME.updateNodeComplete]: "updateNodeComp",
|
|
308
|
+
[FUNCTION_NAME.createObjectComplete]: "createObjectComp",
|
|
309
|
+
[FUNCTION_NAME.getNodeComplete]: "getNodeComp",
|
|
310
|
+
[FUNCTION_NAME.paginateProcessLogical]: "paginateProLogical",
|
|
311
|
+
[FUNCTION_NAME.deleteNode]: "deleteNode",
|
|
312
|
+
[FUNCTION_NAME.deleteNodeComplete]: "deleteNodeComp",
|
|
313
|
+
[FUNCTION_NAME.createObjectS3Complete]: "webSocketTaskComp",
|
|
314
|
+
[FUNCTION_NAME.getRel]: "getRel",
|
|
315
|
+
[FUNCTION_NAME.getRelComplete]: "getRelComp",
|
|
316
|
+
[FUNCTION_NAME.changeRel]: "changeRel",
|
|
317
|
+
[FUNCTION_NAME.changeRelComplete]: "changeRelComp",
|
|
318
|
+
[FUNCTION_NAME.moveRel]: "moveRel",
|
|
319
|
+
[FUNCTION_NAME.moveRelComplete]: "moveRelComp"
|
|
320
|
+
}[functionName]
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas, settings = { bucketName: OBJECT_SCHEMA_BUCKET_NAME }) => {
|
|
@@ -569,6 +575,38 @@ const FLOW_SCHEMA_EVENT_TYPE = {
|
|
|
569
575
|
eventBridge: "eventBridge",
|
|
570
576
|
}
|
|
571
577
|
|
|
578
|
+
async function getExternalTopicComponentFromAllObjectSchemas(_izContext, allObjSchemas) {
|
|
579
|
+
const externalTopicComponentSet = new Set();
|
|
580
|
+
for (const objectSchema of allObjSchemas) {
|
|
581
|
+
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
582
|
+
|
|
583
|
+
if (storageResource.storageType === STORAGE_TYPES.externalTopic) {
|
|
584
|
+
let uniqueTag = hash({
|
|
585
|
+
accountId: storageResource.accountId,
|
|
586
|
+
region: storageResource.region,
|
|
587
|
+
serviceTag: storageResource.serviceTag,
|
|
588
|
+
stage: storageResource.stage
|
|
589
|
+
})
|
|
590
|
+
|
|
591
|
+
if (!externalTopicComponentSet.has(uniqueTag)) {
|
|
592
|
+
externalTopicComponentSet.add(
|
|
593
|
+
{
|
|
594
|
+
[uniqueTag]: {
|
|
595
|
+
accountId: storageResource.accountId,
|
|
596
|
+
region: storageResource.region,
|
|
597
|
+
serviceTag: storageResource.serviceTag,
|
|
598
|
+
stage: storageResource.stage
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
)
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
let externalTopicComponents = [...externalTopicComponentSet]
|
|
607
|
+
return externalTopicComponents
|
|
608
|
+
};
|
|
609
|
+
|
|
572
610
|
module.exports = {
|
|
573
611
|
STORAGE_TYPES,
|
|
574
612
|
ACTIONS,
|
|
@@ -604,5 +642,6 @@ module.exports = {
|
|
|
604
642
|
checkDynamoTypeRelationship,
|
|
605
643
|
createDynamoDbComponentByLinks,
|
|
606
644
|
getStorageResourceFromObjectSchemas,
|
|
607
|
-
FLOW_SCHEMA_EVENT_TYPE
|
|
645
|
+
FLOW_SCHEMA_EVENT_TYPE,
|
|
646
|
+
getExternalTopicComponentFromAllObjectSchemas
|
|
608
647
|
}
|
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
21
|
-
|
|
21
|
+
const { firstLetterUpperCase: upperCase } = require('./Utils')
|
|
22
22
|
|
|
23
23
|
function checkValidTableYaml(_izContext, currentTableSetting, existsTableSetting) {
|
|
24
24
|
// console.log("checkValidTableYaml", JSON.stringify(currentTableSetting, null, 2), JSON.stringify(existsTableSetting, null, 2))
|
|
@@ -31,14 +31,14 @@ function checkValidTableYaml(_izContext, currentTableSetting, existsTableSetting
|
|
|
31
31
|
|
|
32
32
|
for (let i = 0, length = currentTableSetting.length; i < length; i++) {
|
|
33
33
|
let dynamoDbYamlSetting = currentTableSetting[i];
|
|
34
|
-
console.log("dynamoDbYamlSetting", dynamoDbYamlSetting)
|
|
35
|
-
if (existsTableSetting.hasOwnProperty(dynamoDbYamlSetting.templateData.tableName)) {
|
|
34
|
+
// console.log("dynamoDbYamlSetting", dynamoDbYamlSetting)
|
|
35
|
+
if (existsTableSetting.hasOwnProperty(upperCase(dynamoDbYamlSetting.templateData.tableName))) {
|
|
36
36
|
|
|
37
37
|
// exists table
|
|
38
|
-
if (hash(existsTableSetting[dynamoDbYamlSetting.templateData.tableName]) === hash(dynamoDbYamlSetting.templateData.attributes.sort())) {
|
|
38
|
+
if (hash(existsTableSetting[upperCase(dynamoDbYamlSetting.templateData.tableName)]) === hash(dynamoDbYamlSetting.templateData.attributes.sort())) {
|
|
39
39
|
continue;
|
|
40
40
|
} else {
|
|
41
|
-
throw Error(`tableName:${dynamoDbYamlSetting.templateData.tableName} have duplicate setting but not have same setting`)
|
|
41
|
+
throw Error(`tableName:${upperCase(dynamoDbYamlSetting.templateData.tableName)} have duplicate setting but not have same setting`)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
} else {
|
|
@@ -48,7 +48,7 @@ function checkValidTableYaml(_izContext, currentTableSetting, existsTableSetting
|
|
|
48
48
|
Object.assign(
|
|
49
49
|
existsTableSetting,
|
|
50
50
|
{
|
|
51
|
-
[dynamoDbYamlSetting.templateData.tableName]: dynamoDbYamlSetting.templateData.attributes.sort()
|
|
51
|
+
[upperCase(dynamoDbYamlSetting.templateData.tableName)]: dynamoDbYamlSetting.templateData.attributes.sort()
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
}
|
|
@@ -84,7 +84,8 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath, settings = {}
|
|
|
84
84
|
const functionNameConfigs = functionNameConfigYamlData(_izContext, allCreateSource, saveFilePath);
|
|
85
85
|
allCreateSource.push(...functionNameConfigs);
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
let filterAllCreateSource = allCreateSource.filter((createSource) => createSource.templateData.hasOwnProperty("additionalResourcePermission") && createSource.templateData.hasOwnProperty("roleName"))
|
|
88
|
+
const generateRoleData = generateRole(_izContext, filterAllCreateSource, saveFilePath);
|
|
88
89
|
allCreateSource.push(...generateRoleData);
|
|
89
90
|
|
|
90
91
|
// ** create Generate-Shared-resource
|
|
@@ -60,7 +60,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
60
60
|
try {
|
|
61
61
|
const saveFilePath = join(objSchemaPath, `../`);
|
|
62
62
|
const allObjSchemas = await getAllLocalObjectSchemasWithHierarchy(_izContext, objSchemaPath);
|
|
63
|
-
|
|
63
|
+
console.log("allObjSchemas: ", allObjSchemas.records)
|
|
64
64
|
const createSourceParams = [];
|
|
65
65
|
|
|
66
66
|
for (const objectSchema of allObjSchemas.records) {
|
|
@@ -204,12 +204,12 @@ module.exports.createMain = async (
|
|
|
204
204
|
}
|
|
205
205
|
} else if (objectSchemas.fieldNames[identifier.fieldName].hasOwnProperty("optionalOnCreate")) {
|
|
206
206
|
if ((objectSchemas.fieldNames[identifier.fieldName].optionalOnCreate == true)) {
|
|
207
|
+
//(<createOptionalOnCreateIdentifiers>)
|
|
208
|
+
let optionalOnCreateIdentifiers
|
|
209
|
+
//(</createOptionalOnCreateIdentifiers>)
|
|
207
210
|
Object.assign(
|
|
208
211
|
requestParams.fieldNames, {
|
|
209
|
-
[identifier.fieldName]: hash(
|
|
210
|
-
//(<createIdentifiersOptionalOnCreate>)
|
|
211
|
-
//(</createIdentifiersOptionalOnCreate>)
|
|
212
|
-
})
|
|
212
|
+
[identifier.fieldName]: hash(optionalOnCreateIdentifiers)
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
}
|
|
@@ -375,6 +375,22 @@ module.exports.createMain = async (
|
|
|
375
375
|
|
|
376
376
|
_izContext.logger.debug("FIRST", listOfObjectForCreates)
|
|
377
377
|
|
|
378
|
+
} else if (createDataDetail.storageType === consts.STORAGE_TYPES.externalTopic) {
|
|
379
|
+
_izContext.logger.debug("::::::externalTopic::::::", { storageTag, createDataDetail });
|
|
380
|
+
//(<beforeSendMessageToExternalTopic>)
|
|
381
|
+
//(</beforeSendMessageToExternalTopic>)
|
|
382
|
+
let messageObject = {
|
|
383
|
+
//(<messageObjectHook>)
|
|
384
|
+
//(</messageObjectHook>)
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
let sendToCreateExternalTopic = {
|
|
388
|
+
Message: JSON.stringify(messageObject),
|
|
389
|
+
TopicArn: `arn:aws:sns:${createDataDetail.region}:${createDataDetail.accountId}:${createDataDetail.serviceTag}_${createDataDetail.stage}_Create_In`
|
|
390
|
+
};
|
|
391
|
+
_izContext.logger.debug("Request params before send to create endpoint:", sendToCreateExternalTopic);
|
|
392
|
+
|
|
393
|
+
await sns.publishAsync(_izContext, sendToCreateExternalTopic)
|
|
378
394
|
}
|
|
379
395
|
};
|
|
380
396
|
_izContext.logger.debug("[1]listOfObjectForCreates:::", listOfObjectForCreates);
|
|
@@ -22,6 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const yaml = require('yaml');
|
|
23
23
|
|
|
24
24
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
25
|
+
const hash = require('@izara_project/izara-shared-core').objectHash
|
|
25
26
|
const {
|
|
26
27
|
DEFAULT_HANDLER_PER_ACTION,
|
|
27
28
|
createIamRole,
|
|
@@ -82,7 +83,7 @@ async function createParamForCreateSource(_izContext, allObjSchemas, action, han
|
|
|
82
83
|
[RESOURCE_CLASSES.dynamoDbTable]: Object.values(DYNAMO_RESOURCE),
|
|
83
84
|
},
|
|
84
85
|
storageResourceAllLocalObjectSchemas.resourceDynamoTableName.map(tableName =>
|
|
85
|
-
resourceNames(RESOURCE_CLASSES.dynamoDbTable, tableName)
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(tableName))
|
|
86
87
|
)
|
|
87
88
|
)
|
|
88
89
|
)
|
|
@@ -143,19 +144,44 @@ async function createParamForCreateSource(_izContext, allObjSchemas, action, han
|
|
|
143
144
|
const config = yaml.parse(serverlessConfig);
|
|
144
145
|
const ownServiceTag = config.main_config.iz_serviceTag;
|
|
145
146
|
let parentTables = [];
|
|
147
|
+
let externalTopicComponents = [];
|
|
146
148
|
// create lambdaRole for parent dynamo table if able
|
|
147
149
|
for (const objectSchema of allObjSchemas.records) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (
|
|
150
|
+
for (const storageResource of Object.values(objectSchema.storageResources)) {
|
|
151
|
+
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
152
|
+
if (objectSchema.hasOwnProperty("extendObjType")) {
|
|
151
153
|
if (storageResource.serviceTag && storageResource.serviceTag !== ownServiceTag) {
|
|
152
|
-
parentTables.push({ tableName: storageResource.tableName, serviceTag: storageResource.serviceTag })
|
|
154
|
+
parentTables.push({ tableName: upperCase(storageResource.tableName), serviceTag: upperCase(storageResource.serviceTag) })
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
}
|
|
158
|
+
|
|
159
|
+
if (storageResource.storageType === STORAGE_TYPES.externalTopic) {
|
|
160
|
+
let uniqueTag = hash({
|
|
161
|
+
accountId: storageResource.accountId,
|
|
162
|
+
region: storageResource.region,
|
|
163
|
+
serviceTag: storageResource.serviceTag,
|
|
164
|
+
stage: storageResource.stage
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
if (!externalTopicComponents.includes(uniqueTag)) {
|
|
168
|
+
externalTopicComponents.push(
|
|
169
|
+
{
|
|
170
|
+
[uniqueTag]: {
|
|
171
|
+
accountId: storageResource.accountId,
|
|
172
|
+
region: storageResource.region,
|
|
173
|
+
serviceTag: storageResource.serviceTag,
|
|
174
|
+
stage: storageResource.stage
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
156
180
|
}
|
|
157
181
|
}
|
|
158
182
|
|
|
183
|
+
|
|
184
|
+
|
|
159
185
|
if (parentTables.length > 0) {
|
|
160
186
|
additionalResourcePermission.push(
|
|
161
187
|
createIamRole(
|
|
@@ -179,6 +205,24 @@ async function createParamForCreateSource(_izContext, allObjSchemas, action, han
|
|
|
179
205
|
}
|
|
180
206
|
}
|
|
181
207
|
|
|
208
|
+
if (externalTopicComponents.length > 0) {
|
|
209
|
+
if (action === ACTIONS.create) {
|
|
210
|
+
externalTopicComponents.map(component => {
|
|
211
|
+
for (const [_, compo] of Object.entries(component)) {
|
|
212
|
+
additionalResourcePermission.push(createIamRole(
|
|
213
|
+
{
|
|
214
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
215
|
+
},
|
|
216
|
+
[
|
|
217
|
+
`arn:aws:sns:${compo.region}:${compo.accountId}:${compo.serviceTag}_${compo.stage}_Create_In`
|
|
218
|
+
]
|
|
219
|
+
))
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
182
226
|
return {
|
|
183
227
|
templatePath: templatePath,
|
|
184
228
|
templateData: {
|
|
@@ -25,7 +25,7 @@ const { HANDLER, STORAGE_TYPES, ACTIONS } = require('@izara_project/izara-core-l
|
|
|
25
25
|
const {
|
|
26
26
|
firstLetterLowerCase: lowerCase,
|
|
27
27
|
firstLetterUpperCase: upperCase,
|
|
28
|
-
} = require("../../../../MainLibs/
|
|
28
|
+
} = require("../../../../MainLibs/src/Utils");
|
|
29
29
|
const {
|
|
30
30
|
createIamRole,
|
|
31
31
|
resourceNames,
|
|
@@ -90,7 +90,7 @@ async function data(_izContext, objectSchemas, srcPath, settings) {
|
|
|
90
90
|
additionalResourcePermission.push(
|
|
91
91
|
createIamRole(
|
|
92
92
|
{ [RESOURCE_CLASSES.dynamoDbTable]: [DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.get].dynamoDbPermission] },
|
|
93
|
-
tableForGetItem
|
|
93
|
+
upperCase(tableForGetItem)
|
|
94
94
|
)
|
|
95
95
|
);
|
|
96
96
|
}
|
|
@@ -102,7 +102,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
102
102
|
functionName: functionName,
|
|
103
103
|
handlerType: handlerType,
|
|
104
104
|
additionalResourcePermission: additionalResourcePermission,
|
|
105
|
-
functionNameConfig: upperCase(SHORT_FUNCTION_NAME.createObjectS3Complete) + upperCase(shortNameHandler(handlerType)),
|
|
105
|
+
functionNameConfig: upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.createObjectS3Complete)) + upperCase(shortNameHandler(handlerType)),
|
|
106
106
|
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
107
107
|
},
|
|
108
108
|
setting: {
|
|
@@ -39,7 +39,9 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
39
39
|
let functionName = upperCase(FUNCTION_NAME.reservedLimit)
|
|
40
40
|
return {
|
|
41
41
|
templatePath: templatePath,
|
|
42
|
-
templateData: {
|
|
42
|
+
templateData: {
|
|
43
|
+
flowTag: flowSchema.flowTag
|
|
44
|
+
},
|
|
43
45
|
setting: {
|
|
44
46
|
saveFileName: `${functionName}_Main`,
|
|
45
47
|
savePath: path.join(srcPath, SOURCE_PATH.webSocket, flowSchema.flowTag, "source/"),
|
|
@@ -29,6 +29,10 @@ const coreConsts = require('@izara_project/izara-middleware/src/MiddlewareCore/C
|
|
|
29
29
|
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
30
30
|
const importDataLibs = require('../../../../libs/source/GenerateCodeLibs');
|
|
31
31
|
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
32
|
+
const { createFlowTypeConcat } = require("@izara_project/izara-core-library-service-schemas").utils
|
|
33
|
+
|
|
34
|
+
//(<optionalRequired>)
|
|
35
|
+
//(</optionalRequired>)
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* description of function.
|
|
@@ -81,6 +85,16 @@ module.exports.reservedLimit = async (
|
|
|
81
85
|
|
|
82
86
|
if (res.passStatus === false) {
|
|
83
87
|
importDataLibs.postToConnection({ message: "static limit over" }, connectionId)
|
|
88
|
+
let identifiers = hash({})
|
|
89
|
+
|
|
90
|
+
// after post message delete websocket task
|
|
91
|
+
await dynamodbSharedLib.deleteItem(_izContext,
|
|
92
|
+
await dynamodbSharedLib.tableName(_izContext, "WebSocketTask"),
|
|
93
|
+
{
|
|
94
|
+
taskKey: ${createFlowTypeConcat(_izContext, { flowTag: "<%- flowTag %>", serviceTag: process.env.iz_serviceTag })}${identifiers},
|
|
95
|
+
connectionId: connectionId
|
|
96
|
+
}
|
|
97
|
+
)
|
|
84
98
|
//(<afterFailReservedStaticLimit>)
|
|
85
99
|
return
|
|
86
100
|
//(</afterFailReservedStaticLimit>)
|
|
@@ -21,7 +21,7 @@ const path = require("path")
|
|
|
21
21
|
|
|
22
22
|
const templatePath = path.join(__dirname, '../../resourceYaml/dynamodb/template.ejs')
|
|
23
23
|
const { SOURCE_PATH, SAVE_FILE_NAME, defaultIamRolePerAction, createIamRole, DYNAMO_RESOURCE, resourceNames, RESOURCE_CLASSES, FUNCTION_NAME, SOURCE_GENERATE_IAM_ROLE } = require('../../../../MainLibs/src/Consts.js')
|
|
24
|
-
|
|
24
|
+
const { firstLetterUpperCase: upperCase } = require('../../../../MainLibs/src/Utils.js')
|
|
25
25
|
/**
|
|
26
26
|
* create param of crateSouce for FindData And processLogical
|
|
27
27
|
*
|
|
@@ -84,7 +84,7 @@ const createAwaitingMultipleStepDynamoDbData = (_izContext, flowSchema, allLocal
|
|
|
84
84
|
templatePath,
|
|
85
85
|
templateData: {
|
|
86
86
|
tableName,
|
|
87
|
-
resourceName: tableName,
|
|
87
|
+
resourceName: upperCase(tableName),
|
|
88
88
|
attributes,
|
|
89
89
|
},
|
|
90
90
|
setting: {
|
|
@@ -77,7 +77,7 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
77
77
|
function createSourceParams(_izContext, flowTag, flowStep, srcPath) {
|
|
78
78
|
let functionName = upperCase(flowStep);
|
|
79
79
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
80
|
-
let topicIn = upperCase(flowStep)
|
|
80
|
+
let topicIn = `${upperCase(flowTag)}_${upperCase(flowStep)}`;
|
|
81
81
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
82
82
|
additionalResourcePermission.push(
|
|
83
83
|
createIamRole(
|
|
@@ -95,8 +95,8 @@ function createSourceParams(_izContext, flowTag, flowStep, srcPath) {
|
|
|
95
95
|
[RESOURCE_CLASSES.sqs]: [SQS_RESOURCE.sendMessage, SQS_RESOURCE.receiveMessage, SQS_RESOURCE.deleteMessage, SQS_RESOURCE.getQueueAttributes, SQS_RESOURCE.deleteMessageBatch, SQS_RESOURCE.getQueueUrl]
|
|
96
96
|
},
|
|
97
97
|
[
|
|
98
|
-
resourceNames(RESOURCE_CLASSES.sqs, upperCase(flowStep) + upperCase(handlerType)),
|
|
99
|
-
resourceNames(RESOURCE_CLASSES.sqs, upperCase(flowStep) + upperCase(handlerType) + "DLQ")
|
|
98
|
+
resourceNames(RESOURCE_CLASSES.sqs, `${upperCase(flowTag)}_${upperCase(flowStep)}` + upperCase(handlerType)),
|
|
99
|
+
resourceNames(RESOURCE_CLASSES.sqs, `${upperCase(flowTag)}_${upperCase(flowStep)}` + upperCase(handlerType) + "DLQ")
|
|
100
100
|
]
|
|
101
101
|
)
|
|
102
102
|
)
|
|
@@ -62,7 +62,7 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
62
62
|
function createParamsForCreateSource(_izContext, flowTag, flowStep, srcPath) {
|
|
63
63
|
let functionName = upperCase(flowStep)
|
|
64
64
|
let handlerType = upperCase(HANDLER.hdrSqs)
|
|
65
|
-
let queueName = upperCase(flowStep) + handlerType
|
|
65
|
+
let queueName = `${upperCase(flowTag)}_${upperCase(flowStep)}` + handlerType
|
|
66
66
|
return {
|
|
67
67
|
templatePath: templatePath,
|
|
68
68
|
templateData: {
|
|
@@ -55,7 +55,8 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
|
|
|
55
55
|
for (let i = 2; i < flowSteps.length; i++) {
|
|
56
56
|
generatedSnsTopicInForFlowSchema.add(
|
|
57
57
|
{
|
|
58
|
-
queueName: upperCase(flowSteps[i])
|
|
58
|
+
queueName: `${upperCase(flowSchema.flowTag)}_${upperCase(flowSteps[i])}`,
|
|
59
|
+
resourceName: upperCase(flowSchema.flowTag) + upperCase(flowSteps[i])
|
|
59
60
|
}
|
|
60
61
|
)
|
|
61
62
|
}
|
|
@@ -67,7 +68,8 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
|
|
|
67
68
|
for (let i = 2; i < flowSteps.length; i++) {
|
|
68
69
|
generatedSnsTopicInForFlowSchema.add(
|
|
69
70
|
{
|
|
70
|
-
queueName: upperCase(flowSteps[i])
|
|
71
|
+
queueName: `${upperCase(flowSchema.flowTag)}_${upperCase(flowSteps[i])}`,
|
|
72
|
+
resourceName: upperCase(flowSchema.flowTag) + upperCase(flowSteps[i])
|
|
71
73
|
}
|
|
72
74
|
)
|
|
73
75
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
##===== [Create topic in]
|
|
2
|
-
In<%-
|
|
2
|
+
In<%- resourceName %>:
|
|
3
3
|
Type: AWS::SNS::Topic
|
|
4
4
|
Properties:
|
|
5
5
|
DisplayName: "SNS Message in"
|
|
6
6
|
TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>
|
|
7
7
|
##===== SNS Subscription
|
|
8
8
|
##===== [Topic In]
|
|
9
|
-
SubscriptionIn<%-
|
|
9
|
+
SubscriptionIn<%- resourceName %>:
|
|
10
10
|
Type: AWS::SNS::Subscription
|
|
11
11
|
Properties:
|
|
12
|
-
TopicArn: !Ref In<%-
|
|
12
|
+
TopicArn: !Ref In<%- resourceName %>
|
|
13
13
|
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>HdrSqs"
|
|
14
14
|
Protocol: "sqs"
|
|
15
15
|
##===== [Queue]
|
|
16
|
-
<%-
|
|
16
|
+
<%- resourceName %>HdrSqs:
|
|
17
17
|
Type: "AWS::SQS::Queue"
|
|
18
18
|
Properties:
|
|
19
19
|
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>HdrSqs
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
deadLetterTargetArn:
|
|
22
22
|
# !GetAtt
|
|
23
23
|
Fn::GetAtt:
|
|
24
|
-
- <%-
|
|
24
|
+
- <%- resourceName %>HdrSqsDLQ
|
|
25
25
|
- Arn
|
|
26
26
|
maxReceiveCount: 3
|
|
27
27
|
VisibilityTimeout: 120
|
|
28
28
|
##==== [QueueDLQ]
|
|
29
|
-
<%-
|
|
29
|
+
<%- resourceName %>HdrSqsDLQ:
|
|
30
30
|
Type: AWS::SQS::Queue
|
|
31
31
|
Properties:
|
|
32
32
|
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>HdrSqsDLQ
|
|
33
33
|
##==== [QueuePolicy]
|
|
34
|
-
<%-
|
|
34
|
+
<%- resourceName %>HdrSqsPolicy:
|
|
35
35
|
Type: AWS::SQS::QueuePolicy
|
|
36
36
|
Properties:
|
|
37
37
|
PolicyDocument:
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
Resource:
|
|
44
44
|
# !GetAtt
|
|
45
45
|
Fn::GetAtt:
|
|
46
|
-
- <%-
|
|
46
|
+
- <%- resourceName %>HdrSqs
|
|
47
47
|
- Arn
|
|
48
48
|
Action: "SQS:SendMessage"
|
|
49
49
|
Queues:
|
|
50
|
-
- Ref: <%-
|
|
50
|
+
- Ref: <%- resourceName %>HdrSqs
|
|
51
51
|
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
52
52
|
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
53
53
|
|
|
@@ -386,30 +386,30 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
// statusType enum [storedCache, statusField]
|
|
389
|
-
if (flowSchema.statusType === "storedCache") {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
} else if (flowSchema.statusType === "statusField") {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
389
|
+
// if (flowSchema.statusType === "storedCache") {
|
|
390
|
+
// const flowSchemaDynamoDb = createAwaitingMultipleStepDynamoDbData(_izContext, flowSchema, allLocalObjectSchemas, saveFilePath)
|
|
391
|
+
// console.log("generated code storedCache flowSchema")
|
|
392
|
+
// createSourceParams.push(...flowSchemaDynamoDb);
|
|
393
|
+
// } else if (flowSchema.statusType === "statusField") {
|
|
394
|
+
// wait
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
// if (flowSchema.statusType === "statusField") {
|
|
398
|
+
// const createRecordCompleteFunctionYaml = createCreateObjectCompleteFuntionYaml(_izContext, flowSchema, saveFilePath);
|
|
399
|
+
// const createRecordCompleteHandler = createCreateObjectCompleteHandler(_izContext, flowSchema, saveFilePath);
|
|
400
|
+
// const createRecordCompleteMainFunction = createCreateObjectCompleteMainFunction(_izContext, flowSchema, saveFilePath);
|
|
401
|
+
// const createRecordCompleteQueue = createCreateObjectCompleteQueue(_izContext, flowSchema, saveFilePath);
|
|
402
|
+
|
|
403
|
+
// const recordCompleteResources = [
|
|
404
|
+
// ...createRecordCompleteFunctionYaml,
|
|
405
|
+
// ...createRecordCompleteHandler,
|
|
406
|
+
// ...createRecordCompleteMainFunction,
|
|
407
|
+
// ...createRecordCompleteQueue
|
|
408
|
+
// ];
|
|
409
|
+
// console.log("generated Code createRecordComplete")
|
|
410
|
+
// createSourceParams.push(...recordCompleteResources);
|
|
411
|
+
// }
|
|
412
|
+
// }
|
|
413
413
|
const flowSchemaFlowStepYml = createFlowSchemaFlowStepFunctionYaml(_izContext, flowSchema, saveFilePath);
|
|
414
414
|
const flowSchemaFlowStepHandler = createFlowSchemaFlowStepHandler(_izContext, flowSchema, saveFilePath);
|
|
415
415
|
const flowSchemaFlowStepMainFunction = createFlowSchemaFlowStepMainFunction(_izContext, flowSchema, saveFilePath);
|