@izara_project/izara-core-generate-service-code 1.0.1 → 1.0.3
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/index.js +41 -0
- package/package.json +10 -10
- package/src/GenerateCode.js +185 -0
- package/src/GenerateResources.js +122 -0
- package/src/GenerateSchema.js +165 -0
- package/src/GenerateTests.js +137 -0
- package/src/IntTestConfig.js +23 -0
- package/src/SchemaConfig.js +23 -0
- package/src/SourceManager/CreateSource.js +226 -0
- package/src/TemplateConfig.js +55 -0
- package/src/TemplateData/Auth/generateAuthYml/data.js +47 -0
- package/src/TemplateData/Auth/generateAuthYml/template.ejs +16 -0
- package/src/TemplateData/Auth/generateTemplateData.js +48 -0
- package/src/TemplateData/EndpointPerService/generateTemplateData.js +127 -0
- package/src/TemplateData/EndpointPerService/handler/api/data.js +72 -0
- package/src/TemplateData/EndpointPerService/handler/api/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/api/template.ejs +73 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/data.js +76 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/template.ejs +129 -0
- package/src/TemplateData/EndpointPerService/handler/inv/data.js +78 -0
- package/src/TemplateData/EndpointPerService/handler/inv/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/inv/template.ejs +73 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/data.js +76 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/template.ejs +131 -0
- package/src/TemplateData/EndpointPerService/mainFunction/create/data.js +51 -0
- package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +616 -0
- package/src/TemplateData/EndpointPerService/mainFunction/delete/data.js +51 -0
- package/src/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +158 -0
- package/src/TemplateData/EndpointPerService/mainFunction/get/data.js +52 -0
- package/src/TemplateData/EndpointPerService/mainFunction/get/template.ejs +270 -0
- package/src/TemplateData/EndpointPerService/mainFunction/update/data.js +52 -0
- package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +434 -0
- package/src/TemplateData/EndpointPerService/yaml/data.js +311 -0
- package/src/TemplateData/EndpointPerService/yaml/template.ejs +35 -0
- package/src/TemplateData/IntTest/generateResources/generateResources.js +113 -0
- package/src/TemplateData/IntTest/generateResources/templateResources.ejs +33 -0
- package/src/TemplateData/IntTest/generateTests/events/data.js +137 -0
- package/src/TemplateData/IntTest/generateTests/events/templateEvents.ejs +11 -0
- package/src/TemplateData/IntTest/generateTests/generateTemplate.js +69 -0
- package/src/TemplateData/IntTest/generateTests/pathIntTest/data.js +56 -0
- package/src/TemplateData/IntTest/generateTests/pathIntTest/template.ejs +5 -0
- package/src/TemplateData/IntTest/generateTests/tests/data.js +212 -0
- package/src/TemplateData/IntTest/generateTests/tests/templateTests.ejs +3 -0
- package/src/TemplateData/IntTest/libs/libs.js +385 -0
- package/src/TemplateData/IntTest/upload/uploadIntTest.js +96 -0
- package/src/TemplateData/externalService/functionNameConfig/data.js +178 -0
- package/src/TemplateData/externalService/functionNameConfig/template.ejs +14 -0
- package/src/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +31 -0
- package/src/TemplateData/externalService/functionNameConfig/templateYaml.ejs +10 -0
- package/src/TemplateData/externalService/generateTemplateData.js +79 -0
- package/src/TemplateData/externalService/lambdaRole/data.js +448 -0
- package/src/TemplateData/externalService/lambdaRole/request.json +18 -0
- package/src/TemplateData/externalService/lambdaRole/template.ejs +57 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/data.js +271 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/request.json +12 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/template.ejs +33 -0
- package/src/TemplateData/findData/GetByStorage/getByDynamo.ejs +54 -0
- package/src/TemplateData/findData/GetByStorage/getByGraph.ejs +81 -0
- package/src/TemplateData/findData/findDataYaml/data.js +188 -0
- package/src/TemplateData/findData/findDataYaml/template.ejs +14 -0
- package/src/TemplateData/findData/generateTemplateData.js +69 -0
- package/src/TemplateData/findData/handler/data.js +51 -0
- package/src/TemplateData/findData/handler/template.ejs +136 -0
- package/src/TemplateData/findData/mainFunction/data.js +316 -0
- package/src/TemplateData/findData/mainFunction/template.ejs +149 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +133 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +68 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +84 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +71 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +118 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +73 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/queue/template.ejs +49 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +131 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +123 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +58 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +129 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +63 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/template.ejs +45 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +120 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/handler/data.js +67 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +83 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +68 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +131 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +120 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +99 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +63 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +81 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +69 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +142 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +18 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +123 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +262 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +64 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/template.ejs +45 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +150 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +14 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +121 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +62 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +172 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +53 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +144 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/template.ejs +25 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +53 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +50 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +182 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +52 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +66 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/data.js +77 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/dsqTemplatePath.ejs +32 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +59 -0
- package/src/TemplateData/flowSchema/components/upload/relate/S3/data.js +60 -0
- package/src/TemplateData/flowSchema/components/upload/relate/S3/template.ejs +13 -0
- package/src/TemplateData/flowSchema/components/upload/relate/libs/data.js +53 -0
- package/src/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +97 -0
- package/src/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +67 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +96 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/handler/data.js +58 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +72 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +68 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +69 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ttlDynamoTemplate.ejs +32 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +61 -0
- package/src/TemplateData/flowSchema/dynamoDb/data.js +117 -0
- package/src/TemplateData/flowSchema/eventBridge/functionYaml/data.js +172 -0
- package/src/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/data.js +70 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/request.json +7 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +60 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/data.js +68 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/request.json +5 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +59 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +114 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +76 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +81 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +70 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +163 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/handler/data.js +68 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +101 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +79 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-out/data.js +71 -0
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +116 -0
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +92 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +116 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +70 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +81 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +70 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +61 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +152 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/DsqHandlerTemplate.ejs +91 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/SqsHandlerTemplate.ejs +87 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +83 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +116 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +18 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +107 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +67 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +106 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +100 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/sqsTemplate.ejs +43 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +74 -0
- package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +157 -0
- package/src/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/flowStep/handler/data.js +102 -0
- package/src/TemplateData/flowSchema/flowStep/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +101 -0
- package/src/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +98 -0
- package/src/TemplateData/flowSchema/flowStep/sns-in/template.ejs +59 -0
- package/src/TemplateData/flowSchema/generateTemplateData.js +803 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +92 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/template.ejs +28 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +69 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +86 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +80 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/template.ejs +13 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +52 -0
- package/src/TemplateData/flowSchema/register/complete/functionYaml/data.js +119 -0
- package/src/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/register/complete/handler/data.js +59 -0
- package/src/TemplateData/flowSchema/register/complete/handler/template.ejs +85 -0
- package/src/TemplateData/flowSchema/register/complete/mainFunction/data.js +63 -0
- package/src/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +176 -0
- package/src/TemplateData/flowSchema/register/dynamoDB/register.js +71 -0
- package/src/TemplateData/flowSchema/register/sns-in/data.js +57 -0
- package/src/TemplateData/flowSchema/register/sns-in/template.ejs +45 -0
- package/src/TemplateData/flowSchema/register/subscriptionOutAll/data.js +82 -0
- package/src/TemplateData/flowSchema/register/subscriptionOutAll/template.ejs +13 -0
- package/src/TemplateData/flowSchema/register/wbs/functionYaml/data.js +112 -0
- package/src/TemplateData/flowSchema/register/wbs/functionYaml/template.ejs +19 -0
- package/src/TemplateData/flowSchema/register/wbs/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/register/wbs/handler/template.ejs +83 -0
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +57 -0
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +165 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +151 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +70 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +86 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +63 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +80 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/sns/data.js +63 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/sns/template.ejs +59 -0
- package/src/TemplateData/flowSchema/templateByStatusType/statusFieldTemplate.ejs +30 -0
- package/src/TemplateData/flowSchema/templateByStatusType/storedCacheTemplate.ejs +26 -0
- package/src/TemplateData/flowSchema/templateByStatusType/triggerCacheTemplate.ejs +44 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +139 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +70 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +72 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/template.ejs +85 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +145 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +74 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +70 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +134 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +70 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +88 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +69 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +74 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +83 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/template.ejs +49 -0
- package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +140 -0
- package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +62 -0
- package/src/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +85 -0
- package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +55 -0
- package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +134 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/data.js +100 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/template.ejs +43 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/templateSub.ejs +7 -0
- package/src/TemplateData/generateRole/createSharedResource.js +469 -0
- package/src/TemplateData/generateRole/data.js +97 -0
- package/src/TemplateData/generateRole/sharedResourceTemplate.ejs +32 -0
- package/src/TemplateData/generateRole/template.ejs +33 -0
- package/src/TemplateData/perActionComplete/create/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/create/handler/template.ejs +126 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +196 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/template.ejs +187 -0
- package/src/TemplateData/perActionComplete/create/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/create/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/create/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/create/sns-out/template.ejs +10 -0
- package/src/TemplateData/perActionComplete/create/yaml/data.js +110 -0
- package/src/TemplateData/perActionComplete/create/yaml/template.ejs +21 -0
- package/src/TemplateData/perActionComplete/delete/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/delete/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/delete/mainFunction/data.js +54 -0
- package/src/TemplateData/perActionComplete/delete/mainFunction/template.ejs +87 -0
- package/src/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +63 -0
- package/src/TemplateData/perActionComplete/delete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/delete/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/delete/yaml/data.js +108 -0
- package/src/TemplateData/perActionComplete/delete/yaml/template.ejs +20 -0
- package/src/TemplateData/perActionComplete/generateTemplateData.js +162 -0
- package/src/TemplateData/perActionComplete/get/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/get/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/get/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/get/mainFunction/template.ejs +131 -0
- package/src/TemplateData/perActionComplete/get/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/get/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/get/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/get/yaml/data.js +111 -0
- package/src/TemplateData/perActionComplete/get/yaml/template.ejs +21 -0
- package/src/TemplateData/perActionComplete/update/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/update/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/update/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/update/mainFunction/template.ejs +133 -0
- package/src/TemplateData/perActionComplete/update/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/update/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/update/sns-out/data.js +64 -0
- package/src/TemplateData/perActionComplete/update/yaml/data.js +111 -0
- package/src/TemplateData/perActionComplete/update/yaml/template.ejs +20 -0
- package/src/TemplateData/processLogical/generateTemplateData.js +60 -0
- package/src/TemplateData/processLogical/handler/data.js +50 -0
- package/src/TemplateData/processLogical/handler/template.ejs +127 -0
- package/src/TemplateData/processLogical/mainFunction/data.js +50 -0
- package/src/TemplateData/processLogical/mainFunction/template.ejs +424 -0
- package/src/TemplateData/processLogical/yaml/data.js +175 -0
- package/src/TemplateData/processLogical/yaml/template.ejs +12 -0
- package/src/TemplateData/processLogicalPagination/DsqYaml/data.js +50 -0
- package/src/TemplateData/processLogicalPagination/DsqYaml/template.ejs +32 -0
- package/src/TemplateData/processLogicalPagination/generateTemplateData.js +68 -0
- package/src/TemplateData/processLogicalPagination/handler/dsq/data.js +50 -0
- package/src/TemplateData/processLogicalPagination/handler/dsq/template.ejs +160 -0
- package/src/TemplateData/processLogicalPagination/handler/sqs/data.js +49 -0
- package/src/TemplateData/processLogicalPagination/handler/sqs/template.ejs +143 -0
- package/src/TemplateData/processLogicalPagination/mainFunction/data.js +49 -0
- package/src/TemplateData/processLogicalPagination/mainFunction/template.ejs +210 -0
- package/src/TemplateData/processLogicalPagination/yaml/dsq/data.js +166 -0
- package/src/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +12 -0
- package/src/TemplateData/processLogicalPagination/yaml/sqs/data.js +174 -0
- package/src/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +166 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +153 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +197 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +141 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +59 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +377 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +75 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +120 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +151 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +206 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +137 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +179 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +123 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +58 -0
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +443 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +76 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +121 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +152 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +206 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +139 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +182 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +124 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +162 -0
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +58 -0
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +365 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +76 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +119 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +61 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +142 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/generateTemplateData.js +547 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +205 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +137 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +178 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +122 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +57 -0
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +320 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +76 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +120 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +127 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +56 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +144 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +65 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +65 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +172 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +198 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +143 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +182 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +59 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +382 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +75 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +119 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +58 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +156 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +196 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/dsqTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/data.js +73 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +138 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +180 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +124 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/request.json +1 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +387 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +84 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-out/data.js +67 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-out/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +120 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +128 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +56 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/request.json +1 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +146 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +145 -0
- package/src/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +115 -0
- package/src/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +166 -0
- package/src/TemplateData/resourceYaml/dynamodb/template.ejs +29 -0
- package/src/TemplateData/resourceYaml/filterGenerateResource/data.js +126 -0
- package/src/TemplateData/resourceYaml/generateTemplateData.js +149 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +91 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/request.json +4 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +85 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/resourceYaml/sns-out/data.js +78 -0
- package/src/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +65 -0
- package/src/TemplateData/resourceYaml/sns-out/request.json +3 -0
- package/src/TemplateData/resourceYaml/sns-out/template.ejs +10 -0
- package/src/libs/Consts.js +432 -0
- package/src/libs/GenerateCodeLibs.js +32 -0
- package/src/libs/Libs.js +379 -0
- package/src/libs/Utils.js +140 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
|
+
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
|
+
import { recordHandlerSharedLib } from "@izara_project/izara-core-library-record-handler";
|
|
23
|
+
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
24
|
+
|
|
25
|
+
import createObjectComplete from './CreateObjectComplete_Main.js';
|
|
26
|
+
|
|
27
|
+
// validate event properties in body.Message of sqs event
|
|
28
|
+
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
29
|
+
// set schema for record.body.Message
|
|
30
|
+
let perRecordsValidatorSchema = {
|
|
31
|
+
type: "object",
|
|
32
|
+
required: [
|
|
33
|
+
'returnValue',
|
|
34
|
+
'status',
|
|
35
|
+
'errorsFound',
|
|
36
|
+
'graphServiceTag'
|
|
37
|
+
],
|
|
38
|
+
properties: {
|
|
39
|
+
returnValue: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
},
|
|
42
|
+
status: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
},
|
|
45
|
+
errorsFound: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
default: []
|
|
48
|
+
},
|
|
49
|
+
graphServiceTag: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// set schema for record.body.MessageAttributes
|
|
56
|
+
// const messageAttributeValidatorSchema = {
|
|
57
|
+
// type: "object",
|
|
58
|
+
// required: ['msgAtrrParam1', 'msgAtrrParam2'],
|
|
59
|
+
// properties: {
|
|
60
|
+
// msgAtrrParam1: {
|
|
61
|
+
// type: "string"
|
|
62
|
+
// },
|
|
63
|
+
// msgAtrrParam2: {
|
|
64
|
+
// type: "object"
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
// };
|
|
68
|
+
|
|
69
|
+
perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema); // is Ok passBackProperties
|
|
70
|
+
export const main = middleware.wrap(async (event, context) => {
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
|
|
74
|
+
let recordPromises = [];
|
|
75
|
+
|
|
76
|
+
// loop each record and send to mainFunction
|
|
77
|
+
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
78
|
+
|
|
79
|
+
let passOnProperties = []
|
|
80
|
+
record._izContext.logger.debug('record ReceiveMsgOutHdrSqs', record);
|
|
81
|
+
|
|
82
|
+
//validate message (and MessageAttributes)
|
|
83
|
+
await recordHandlerSharedLib.validateRecord(
|
|
84
|
+
record, // one record will send to mainFunction
|
|
85
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
86
|
+
perRecordsValidatorSchema, // schema for record.Message
|
|
87
|
+
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// add argument (to invoke lambda) to passOnProperties[]
|
|
91
|
+
passOnProperties.push(record.body.Message.returnValue)
|
|
92
|
+
passOnProperties.push(record.body.Message.status)
|
|
93
|
+
passOnProperties.push(record.body.Message.errorsFound)
|
|
94
|
+
passOnProperties.push(record.body.Message.graphServiceTag)
|
|
95
|
+
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
96
|
+
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
97
|
+
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
98
|
+
|
|
99
|
+
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
100
|
+
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
101
|
+
record, // one record will send to mainFunction
|
|
102
|
+
createObjectComplete, // mainFunction that need to invoke.
|
|
103
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
104
|
+
passOnProperties, // all parameters that mainFunction needed.
|
|
105
|
+
);
|
|
106
|
+
record._izContext.logger.debug('after recordPromise in handler');
|
|
107
|
+
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
108
|
+
}))
|
|
109
|
+
|
|
110
|
+
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
111
|
+
try {
|
|
112
|
+
// --- main await all promises
|
|
113
|
+
await Promise.all(recordPromises); // await all promises
|
|
114
|
+
|
|
115
|
+
return event.Records // return all for local testing
|
|
116
|
+
|
|
117
|
+
} catch {
|
|
118
|
+
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
119
|
+
}
|
|
120
|
+
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
121
|
+
|
|
122
|
+
} catch (err) {
|
|
123
|
+
Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
|
|
124
|
+
throw (err);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const asyncFlowSharedLib = require('@izara_project/izara-shared/src/AsyncFlowSharedLib');
|
|
19
|
+
const dynamodbSharedLib = require('@izara_project/izara-shared/src/DynamodbSharedLib');
|
|
20
|
+
const snsSharedLib = require('@izara_project/izara-shared/src/SnsSharedLib');
|
|
21
|
+
const sns = require('@izara_project/izara-core-library-external-request/src/resources/Sns');
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
|
|
23
|
+
const _ = require('lodash');
|
|
24
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
25
|
+
|
|
26
|
+
const PREFIX = {
|
|
27
|
+
CREATE_OBJECT_ASYNC: 'createObjectAsync',
|
|
28
|
+
CREATE_OBJECT_ASYNC_COMPLETE: 'createObjectAsyncComplete'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {*} _izContext
|
|
34
|
+
* @param {*} returnValue
|
|
35
|
+
* @param {*} status
|
|
36
|
+
* @param {*} errorsFounds
|
|
37
|
+
* @param {*} graphServiceTag
|
|
38
|
+
* @param {*} passBackProperties
|
|
39
|
+
* @param {*} callingFlowConfig
|
|
40
|
+
returnValue = {
|
|
41
|
+
queryResult: returnCreateNode,
|
|
42
|
+
objType,
|
|
43
|
+
objInstance,
|
|
44
|
+
relationships,
|
|
45
|
+
settings
|
|
46
|
+
}
|
|
47
|
+
*/
|
|
48
|
+
module.exports.createObjectComplete = async (
|
|
49
|
+
_izContext,
|
|
50
|
+
returnValue,
|
|
51
|
+
status,
|
|
52
|
+
errorsFound,
|
|
53
|
+
graphServiceTag,
|
|
54
|
+
passBackProperties,
|
|
55
|
+
callingFlowConfig
|
|
56
|
+
) => {
|
|
57
|
+
try {
|
|
58
|
+
_izContext.logger.debug('function createObjectComplete:', {
|
|
59
|
+
returnValue,
|
|
60
|
+
status,
|
|
61
|
+
errorsFound,
|
|
62
|
+
graphServiceTag,
|
|
63
|
+
passBackProperties,
|
|
64
|
+
callingFlowConfig
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
let errorFounds = [];
|
|
68
|
+
|
|
69
|
+
if (_.isEmpty(returnValue)) {
|
|
70
|
+
_izContext.logger.debug('message callingFlowProperties is empty');
|
|
71
|
+
throw new NoRetryError('message not an object');
|
|
72
|
+
}
|
|
73
|
+
// validate.
|
|
74
|
+
if (!returnValue.hasOwnProperty('queryResult')) {
|
|
75
|
+
errorFounds.push(
|
|
76
|
+
'message is not have property queryResult, should be not happen'
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (!returnValue.hasOwnProperty('objType')) {
|
|
80
|
+
errorFounds.push(
|
|
81
|
+
'message is not have property objType, should be not happen'
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (!returnValue.hasOwnProperty('objInstance')) {
|
|
85
|
+
errorFounds.push(
|
|
86
|
+
'message is not have property objInstance, should be not objInstance'
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (status == 'error' && errorsFound.length > 0) {
|
|
91
|
+
errorFounds.push(errorsFound);
|
|
92
|
+
} else if (status == 'error' && errorsFound.length == 0) {
|
|
93
|
+
errorFounds.push(
|
|
94
|
+
'[invalid]statur is error not have errorfound form graphService'
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
if (status === 'complete' && errorsFound.length > 0) {
|
|
98
|
+
errorFounds.push(
|
|
99
|
+
'[Invalid] status is commplete should be not have errorsFound'
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (graphServiceTag == '') {
|
|
103
|
+
errorFounds.push('[Invalid] graphServiceTag is not empty string');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (errorsFound.length > 0) {
|
|
107
|
+
_izContext.logger.debug('Have error form grapService:', errorsFound);
|
|
108
|
+
errorFounds = errorFounds.concat(errorsFound);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// check and remove awaitngStep finish.
|
|
112
|
+
let awaitingStepId = asyncFlowSharedLib.createAwaitingStepId(
|
|
113
|
+
hash({
|
|
114
|
+
objType: returnValue.objType,
|
|
115
|
+
graphServerTag: graphServiceTag,
|
|
116
|
+
identifiers: returnValue.objInstance.identifiers
|
|
117
|
+
}),
|
|
118
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
119
|
+
);
|
|
120
|
+
_izContext.logger.debug('awaitingStepId:', awaitingStepId);
|
|
121
|
+
|
|
122
|
+
let recordAwaitingSteps = await dynamodbSharedLib.query(
|
|
123
|
+
_izContext,
|
|
124
|
+
await dynamodbSharedLib.tableName(_izContext, 'AwaitingMultipleSteps'),
|
|
125
|
+
{
|
|
126
|
+
awaitingStepId: awaitingStepId
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
_izContext.logger.debug('record awaitingSteps::', recordAwaitingSteps);
|
|
130
|
+
|
|
131
|
+
nextAwaitingAteps: for (let listRecordAwaitingStep of recordAwaitingSteps.Items) {
|
|
132
|
+
_izContext.logger.debug(
|
|
133
|
+
'iterate RecordAwaitingStep:',
|
|
134
|
+
listRecordAwaitingStep
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
if (
|
|
138
|
+
!(await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
139
|
+
_izContext,
|
|
140
|
+
listRecordAwaitingStep.pendingStepId,
|
|
141
|
+
awaitingStepId
|
|
142
|
+
))
|
|
143
|
+
) {
|
|
144
|
+
_izContext.logger.debug('!Waiting record form other graph::');
|
|
145
|
+
// **** add step of remove awaitingMultiplestep!! ??
|
|
146
|
+
continue nextAwaitingAteps;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
150
|
+
_izContext,
|
|
151
|
+
awaitingStepId,
|
|
152
|
+
listRecordAwaitingStep.pendingStepId
|
|
153
|
+
);
|
|
154
|
+
_izContext.logger.debug('Remove awaitingStep finish');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// seagame: problem about lambdaComplete is will missing errorsFound from request if have 2 request
|
|
158
|
+
// one send with errorsFound and one send without errorsFound
|
|
159
|
+
// this scenario can complete with or without errorsFound
|
|
160
|
+
let messageObject = {
|
|
161
|
+
objType: returnValue.objType,
|
|
162
|
+
identifierId: returnValue.objInstance.identifiers,
|
|
163
|
+
errorFounds: errorFounds
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
messageObject =
|
|
167
|
+
callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(
|
|
168
|
+
passBackProperties,
|
|
169
|
+
messageObject
|
|
170
|
+
);
|
|
171
|
+
let messageAttributes =
|
|
172
|
+
callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(
|
|
173
|
+
passBackProperties,
|
|
174
|
+
{}
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
let sendMessageOutCreateObjectComplete = {
|
|
178
|
+
Message: JSON.stringify(messageObject),
|
|
179
|
+
MessageAttributes: sns.createStringMessageAttributes(
|
|
180
|
+
_izContext,
|
|
181
|
+
messageAttributes
|
|
182
|
+
),
|
|
183
|
+
TopicArn: await snsSharedLib.snsTopicArn(
|
|
184
|
+
_izContext,
|
|
185
|
+
'OutCreateObjectComplete'
|
|
186
|
+
)
|
|
187
|
+
};
|
|
188
|
+
_izContext.logger.debug(
|
|
189
|
+
'Send message to OutCreateObjectComplete :::>',
|
|
190
|
+
sendMessageOutCreateObjectComplete
|
|
191
|
+
);
|
|
192
|
+
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
193
|
+
} catch (err) {
|
|
194
|
+
throw err;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import { fileURLToPath } from 'url';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = path.dirname(__filename);
|
|
22
|
+
import consts from '../../../../libs/Consts.js';
|
|
23
|
+
import utils from '../../../../libs/Utils.js';
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
|
|
25
|
+
const { SOURCE_PATH, FUNCTION_NAME } = consts;
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, 'template.ejs');
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* receive objectSchema
|
|
31
|
+
* create data for hdrInv template
|
|
32
|
+
*
|
|
33
|
+
* @return {{ templatePath, templateData, setting } }
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
function data(_izContext, srcPath) {
|
|
37
|
+
return [createMainFunctionCreateComplete(_izContext, srcPath)];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function createMainFunctionCreateComplete(_izContext, srcPath) {
|
|
41
|
+
return {
|
|
42
|
+
templatePath: templatePath,
|
|
43
|
+
templateData: {},
|
|
44
|
+
setting: {
|
|
45
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
46
|
+
saveFileName: `${upperCase(FUNCTION_NAME.createObjectComplete)}_Main`,
|
|
47
|
+
fileExtension: '.js',
|
|
48
|
+
isAppend: false
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default data;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
|
|
19
|
+
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
20
|
+
import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
|
|
21
|
+
import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
22
|
+
import { sns } from '@izara_project/izara-core-library-external-request';
|
|
23
|
+
import _ from 'lodash';
|
|
24
|
+
import { objectHash as hash } from '@izara_project/izara-shared-core';
|
|
25
|
+
import { consts as generateCodeConsts } from '@izara_project/izara-code-generate-code-service';
|
|
26
|
+
const { TOPIC_NAME_GENERATE_CODE, } = generateCodeConsts;
|
|
27
|
+
const PREFIX = {
|
|
28
|
+
CREATE_OBJECT_ASYNC: "createObjectAsync",
|
|
29
|
+
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
|
|
30
|
+
}
|
|
31
|
+
//(<optionalRequire>)
|
|
32
|
+
//(</optionalRequire>)
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {*} _izContext
|
|
37
|
+
* @param {*} returnValue
|
|
38
|
+
* @param {*} status
|
|
39
|
+
* @param {*} errorsFounds
|
|
40
|
+
* @param {*} graphServiceTag
|
|
41
|
+
* @param {*} passBackProperties
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
export default async function createObjectComplete (
|
|
45
|
+
_izContext,
|
|
46
|
+
returnValue,
|
|
47
|
+
status,
|
|
48
|
+
errorsFound,
|
|
49
|
+
graphServiceTag,
|
|
50
|
+
passBackProperties,
|
|
51
|
+
) {
|
|
52
|
+
try {
|
|
53
|
+
_izContext.logger.debug("function createObjectComplete:", {
|
|
54
|
+
returnValue,
|
|
55
|
+
status,
|
|
56
|
+
errorsFound,
|
|
57
|
+
graphServiceTag,
|
|
58
|
+
passBackProperties,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (_.isEmpty(returnValue.requestParams)) {
|
|
62
|
+
_izContext.logger.debug("message callingFlowProperties is empty");
|
|
63
|
+
throw new NoRetryError("message not an object")
|
|
64
|
+
};
|
|
65
|
+
// validate.
|
|
66
|
+
if (!returnValue.hasOwnProperty("queryResult")) {
|
|
67
|
+
errorsFound.push("message is not have property queryResult, should be not happen");
|
|
68
|
+
};
|
|
69
|
+
if (!returnValue.requestParams.hasOwnProperty("objType")) {
|
|
70
|
+
errorsFound.push("message is not have property objType, should be not happen");
|
|
71
|
+
};
|
|
72
|
+
if (!returnValue.requestParams.hasOwnProperty("objInstanceFull")) {
|
|
73
|
+
errorsFound.push("message is not have property objInstance, should be not objInstance");
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
if (status == "error" && errorsFound.length > 0) {
|
|
77
|
+
errorsFound.push("error before validate");
|
|
78
|
+
} else if (status == "error" && errorsFound.length == 0) {
|
|
79
|
+
errorsFound.push("[invalid]status is error not have errorsFound form graphService");
|
|
80
|
+
|
|
81
|
+
};
|
|
82
|
+
if (status === "complete" && errorsFound.length > 0) {
|
|
83
|
+
errorsFound.push("[Invalid] status is complete should be not have errorsFound");
|
|
84
|
+
};
|
|
85
|
+
if (graphServiceTag == null) {
|
|
86
|
+
errorsFound.push("[Invalid] graphServerTag is not empty string");
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
if (errorsFound.length > 0) {
|
|
90
|
+
_izContext.logger.debug("Have error form graphServerTag:", errorsFound);
|
|
91
|
+
errorsFound = errorsFound.concat(errorsFound.join(","));
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
let existsNode = null;
|
|
95
|
+
|
|
96
|
+
if (Object.keys(returnValue.queryResult.returnCreateNode.existsNode).length) {
|
|
97
|
+
existsNode = {
|
|
98
|
+
objType: {
|
|
99
|
+
objectType: returnValue.requestParams.objType.objectType,
|
|
100
|
+
serviceTag: returnValue.requestParams.objType.serviceTag
|
|
101
|
+
},
|
|
102
|
+
objInstanceFull: returnValue.queryResult.returnCreateNode.existsNode.objInstanceFull
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
|
|
107
|
+
(hash({
|
|
108
|
+
objType: returnValue.requestParams.objType,
|
|
109
|
+
graphServerTag: graphServiceTag,
|
|
110
|
+
identifiers: returnValue.requestParams.objInstanceFull.identifiers,
|
|
111
|
+
callingFlowProperties: passBackProperties.passBackProperties.parentPassBackProperties.callingFlowProperties || {}
|
|
112
|
+
})),
|
|
113
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
114
|
+
)
|
|
115
|
+
_izContext.logger.debug("awaitingStepId:", awaitingStepId);
|
|
116
|
+
|
|
117
|
+
let recordAwaitingSteps = await dynamodbSharedLib.query(
|
|
118
|
+
_izContext,
|
|
119
|
+
await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
|
|
120
|
+
{
|
|
121
|
+
awaitingStepId: awaitingStepId
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
_izContext.logger.debug("record awaitingSteps::", recordAwaitingSteps);
|
|
125
|
+
|
|
126
|
+
await Promise.all(
|
|
127
|
+
recordAwaitingSteps.Items.map(async ({ pendingStepId }) => {
|
|
128
|
+
if (await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
129
|
+
_izContext,
|
|
130
|
+
pendingStepId,
|
|
131
|
+
awaitingStepId,
|
|
132
|
+
errorsFound
|
|
133
|
+
)) {
|
|
134
|
+
_izContext.logger.debug("finish all awaitingStep");
|
|
135
|
+
|
|
136
|
+
let messageObject = {
|
|
137
|
+
objType: {
|
|
138
|
+
objectType: returnValue.requestParams.objType.objectType,
|
|
139
|
+
serviceTag: returnValue.requestParams.objType.serviceTag
|
|
140
|
+
},
|
|
141
|
+
objInstanceFull: returnValue.queryResult.returnCreateNode.objInstanceFull,
|
|
142
|
+
relationships: returnValue.queryResult.returnCreateNode.relationships,
|
|
143
|
+
existsNode: existsNode,
|
|
144
|
+
status: status,
|
|
145
|
+
errorsFound: errorsFound
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//(<beforeSendMessage>)
|
|
149
|
+
//(</beforeSendMessage>)
|
|
150
|
+
|
|
151
|
+
messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
|
|
152
|
+
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {})
|
|
153
|
+
|
|
154
|
+
let sendMessageOutCreateObjectComplete = {
|
|
155
|
+
Message: JSON.stringify(messageObject),
|
|
156
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
157
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete)
|
|
158
|
+
};
|
|
159
|
+
_izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
|
|
160
|
+
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
//(<afterSendMessage>)
|
|
164
|
+
//(</afterSendMessage>)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
168
|
+
_izContext,
|
|
169
|
+
awaitingStepId,
|
|
170
|
+
pendingStepId,
|
|
171
|
+
errorsFound
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
})
|
|
175
|
+
)
|
|
176
|
+
//(<beforeReturn>)
|
|
177
|
+
//(</beforeReturn>)
|
|
178
|
+
return {
|
|
179
|
+
returnValue: returnValue,
|
|
180
|
+
status: status,
|
|
181
|
+
errorsFound: errorsFound
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
} catch (err) {
|
|
185
|
+
throw (err)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import { fileURLToPath } from 'url';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = path.dirname(__filename);
|
|
22
|
+
import consts from '../../../../libs/Consts.js';
|
|
23
|
+
import utils from '../../../../libs/Utils.js';
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
|
|
25
|
+
const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = consts;
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, 'template.ejs');
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* create data for dynamoDbYaml tempalte from objectSchema
|
|
31
|
+
* return array of dynamoDb data
|
|
32
|
+
* because one objectSchema can create multiple dynamoDb table
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} _izContext
|
|
35
|
+
* @param {String} saveFilePath
|
|
36
|
+
* @returns {Object[]} - data of multiple dynamoDb template
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
function data(_izContext, srcPath) {
|
|
40
|
+
let createUpdateNodeCompleteQueues = [];
|
|
41
|
+
const createCreateUpdatenodeCompleteQueueNames = [
|
|
42
|
+
{
|
|
43
|
+
queueName: upperCase(FUNCTION_NAME.createObjectComplete)
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
for (let createUpdateNodeCompleteQueueName of createCreateUpdatenodeCompleteQueueNames) {
|
|
47
|
+
createUpdateNodeCompleteQueues.push({
|
|
48
|
+
templatePath: templatePath,
|
|
49
|
+
templateData: createUpdateNodeCompleteQueueName,
|
|
50
|
+
setting: {
|
|
51
|
+
initialData: 'Resource\n',
|
|
52
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
53
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
54
|
+
fileExtension: '.yml',
|
|
55
|
+
isAppend: true
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return createUpdateNodeCompleteQueues;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default data;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
##===== [Queue]
|
|
2
|
+
<%- queueName %>:
|
|
3
|
+
Type: "AWS::SQS::Queue"
|
|
4
|
+
Properties:
|
|
5
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
6
|
+
RedrivePolicy:
|
|
7
|
+
deadLetterTargetArn:
|
|
8
|
+
# !GetAtt
|
|
9
|
+
Fn::GetAtt:
|
|
10
|
+
- <%- queueName %>DLQ
|
|
11
|
+
- Arn
|
|
12
|
+
maxReceiveCount: 3
|
|
13
|
+
VisibilityTimeout: 120
|
|
14
|
+
##==== [QueueDLQ]
|
|
15
|
+
<%- queueName %>DLQ:
|
|
16
|
+
Type: AWS::SQS::Queue
|
|
17
|
+
Properties:
|
|
18
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
19
|
+
##==== [QueuePolicy]
|
|
20
|
+
<%- queueName %>Policy:
|
|
21
|
+
Type: AWS::SQS::QueuePolicy
|
|
22
|
+
Properties:
|
|
23
|
+
PolicyDocument:
|
|
24
|
+
Version: "2012-10-17"
|
|
25
|
+
Statement:
|
|
26
|
+
- Sid: "allow-sns-messages"
|
|
27
|
+
Effect: Allow
|
|
28
|
+
Principal: "*"
|
|
29
|
+
Resource:
|
|
30
|
+
# !GetAtt
|
|
31
|
+
Fn::GetAtt:
|
|
32
|
+
- <%- queueName %>
|
|
33
|
+
- Arn
|
|
34
|
+
Action: "SQS:SendMessage"
|
|
35
|
+
Queues:
|
|
36
|
+
- Ref: <%- queueName %>
|
|
37
|
+
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
38
|
+
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<%_ function firstLetterUpperCase(text){
|
|
42
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
43
|
+
} _%>
|
|
44
|
+
<%_ function firstLetterLowerCase(str) {
|
|
45
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
46
|
+
} _%>
|
|
47
|
+
|