@izara_project/izara-market-library-service-schemas 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +6 -6
- package/src/GenerateCodeLibs/index.js +1 -0
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +65 -22
- package/src/MainLibs/index.js +2 -1
- package/src/MainLibs/src/Consts.js +485 -0
- package/src/MainLibs/src/GenerateCodeUtils.js +59 -0
- package/src/SourceManager/src/CreateSource.js +11 -1
- package/src/TemplateManager/src/FindData/mainFunction/data.js +3 -2
- package/src/TemplateManager/src/GenerateCode.js +1 -0
- package/src/TemplateManager/src/GenerateSchema.js +20 -5
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogical/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/attributeTree/objectSchema/data.js +23 -20
- package/src/TemplateManager/src/attributeTree/objectSchema/template.ejs +6 -5
- package/src/TemplateManager/src/attributeTree/relationshipSchema/data.js +169 -55
- package/src/TemplateManager/src/attributeTree/relationshipSchema/template.ejs +5 -38
- package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +2 -3
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +1 -1
- package/src/reStructure/GenerateCode.js +151 -0
- package/src/reStructure/TemplateConfig.js +31 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +162 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/template.ejs +14 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +31 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/templateYaml.ejs +10 -0
- package/src/reStructure/TemplateData/externalService/generateTemplateData.js +59 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +435 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/request.json +18 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +57 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +177 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/request.json +12 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +28 -0
- package/src/reStructure/TemplateData/findData/GetByStorage/getByDynamo.ejs +53 -0
- package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +100 -0
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +195 -0
- package/src/reStructure/TemplateData/findData/findDataYaml/template.ejs +14 -0
- package/src/reStructure/TemplateData/findData/generateTemplateData.js +65 -0
- package/src/reStructure/TemplateData/findData/handler/data.js +63 -0
- package/src/reStructure/TemplateData/findData/handler/template.ejs +140 -0
- package/src/reStructure/TemplateData/findData/mainFunction/data.js +297 -0
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +151 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/data.js +76 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/template.ejs +37 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/handler/data.js +46 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/handler/template.ejs +103 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/mainFunction/data.js +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/data.js +35 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +118 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +56 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +126 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +121 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +140 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +37 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +74 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +120 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +133 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +115 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +70 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +103 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +86 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +72 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/data.js +93 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateAsyncHandler.ejs +110 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateSyncHandler.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/hookLogic/data.js +43 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/data.js +65 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/template.ejs +7 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/data.js +72 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/functionYaml/data.js +102 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/functionYaml/template.ejs +27 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/template.ejs +120 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/template.ejs +164 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/sqs/data.js +65 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/sqs/template.ejs +53 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +131 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +126 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +254 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/queue/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/queue/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrDsq/data.js +87 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml → reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml}/HdrDsq/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +127 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml → reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3}/template.ejs +11 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerDsq/data.js +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerDsq/template.ejs +151 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +58 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +68 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +58 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +392 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/data.js +77 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/dsqTemplatePath.ejs +32 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/template.ejs +13 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +42 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +137 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +73 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +29 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +68 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +62 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +62 -0
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +210 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/data.js +101 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/template.ejs +43 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/data.js +93 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateAsyncHandler.ejs +110 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateSyncHandler.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/hookLogic/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/data.js +66 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/data.js +124 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +276 -0
- package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +58 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +172 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/data.js +65 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +170 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/data.js +73 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +130 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/data.js +66 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +93 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +62 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-out/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +124 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +126 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js → reStructure/TemplateData/perActionComplete/get/handler/data.js} +20 -14
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/data.js +52 -0
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +130 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns → reStructure/TemplateData/perActionComplete/get/sns-in-sqs}/data.js +12 -12
- package/src/reStructure/TemplateData/perActionComplete/get/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/get/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +105 -0
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/update/handler/data.js +65 -0
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/data.js +58 -0
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/data.js +66 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +73 -0
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +132 -0
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionEndpoint/generateTemplateData.js +101 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/data.js +93 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +76 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/data.js +95 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +127 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/data.js +88 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/template.ejs +81 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/data.js +94 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/data.js +75 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +141 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +55 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +55 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction → reStructure/TemplateData/perActionEndpoint/libs}/data.js +25 -13
- package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +46 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/data.js +74 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/request.json +0 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +629 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/data.js +74 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +192 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/data.js +76 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/request.json +5 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +265 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/testParam.json +5 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/data.js +70 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/request.json +0 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +351 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/data.js +198 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/request.json +14 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/data.js +207 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/request.json +19 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/data.js +189 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/example req.js +15 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/request.json +14 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/data.js +208 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/request.json +19 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/data.js +170 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/request.json +19 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs → reStructure/TemplateData/perActionEndpoint/yaml/wbs}/template.ejs +2 -3
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +59 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/template.ejs +10 -0
- package/src/reStructure/TemplateData/processLogical/generateTemplateData.js +57 -0
- package/src/reStructure/TemplateData/processLogical/handler/data.js +50 -0
- package/src/reStructure/TemplateData/processLogical/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/processLogical/mainFunction/data.js +47 -0
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +429 -0
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +160 -0
- package/src/reStructure/TemplateData/processLogical/yaml/template.ejs +12 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sns-out → reStructure/TemplateData/processLogicalPagination/DsqYaml}/data.js +16 -13
- package/src/reStructure/TemplateData/processLogicalPagination/DsqYaml/template.ejs +32 -0
- package/src/reStructure/TemplateData/processLogicalPagination/generateTemplateData.js +64 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +163 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +146 -0
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/template.ejs +212 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +154 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +12 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +157 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +12 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +98 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +97 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +110 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/data.js +57 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +138 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq → reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq}/data.js +18 -20
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +126 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs → reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs}/data.js +16 -16
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +163 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +380 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs → reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml}/data.js +48 -29
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +141 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +98 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +97 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +57 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +138 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +58 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +126 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +162 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +337 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq → reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml}/data.js +49 -30
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +140 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +72 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +238 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +120 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +131 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +124 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +135 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +140 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +75 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/request.json +5 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +145 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +74 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +163 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +72 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/request.json +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +340 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +92 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +110 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +61 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +127 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +63 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/request.json +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +143 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/template.ejs +46 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/resourceYaml/CreateSourceData.js +73 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +146 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +178 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/request.json +7 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +31 -0
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +99 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +96 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/request.json +4 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +108 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +88 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +75 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/template.ejs +10 -0
- package/src/reStructure/test.bash +192 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +0 -94
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +0 -192
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +0 -299
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +0 -155
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +0 -163
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/data.js +0 -61
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +0 -145
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/dynamoDb/data.js +0 -120
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/sns-sqs/data.js +0 -75
- package/src/TemplateManager/src/reStructureExample/GenerateCodeTest.js +0 -31
- package/src/TemplateManager/src/reStructureExample/TemplateConfig.js +0 -11
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +0 -1
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +0 -5
- /package/src/{TemplateManager/src/reStructureExample/TemplateData/perAction → reStructure/TemplateData/flowSchema/components/schema/inProcess/mainFunction}/template.ejs +0 -0
- /package/src/{TemplateManager/src/reStructureExample/TemplateData/perAction/data.js → reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/template.ejs} +0 -0
- /package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns/template.ejs → reStructure/TemplateData/flowSchema/components/upload/hook/queue/sqsTemplate.ejs} +0 -0
|
@@ -0,0 +1,351 @@
|
|
|
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
|
|
16
|
+
<http: //www.gnu.org/licenses />.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
const hash = require("object-hash");
|
|
22
|
+
const {
|
|
23
|
+
getObjSchemaS3WithHierarchy,
|
|
24
|
+
} = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const consts = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
dynamoDbIdentifiersByStorageResource,
|
|
32
|
+
createFieldForUpdateDynamoDb
|
|
33
|
+
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
34
|
+
|
|
35
|
+
const izaraShared = require('@izara_project/izara-shared');
|
|
36
|
+
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
37
|
+
const snsSharedLib = izaraShared.snsSharedLib;
|
|
38
|
+
const asyncFlowSharedLib = izaraShared.asyncFlowSharedLib;
|
|
39
|
+
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
40
|
+
const lambdaSharedLib = izaraShared.lambdaSharedLib
|
|
41
|
+
|
|
42
|
+
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
43
|
+
const sns = externalRequest.sns
|
|
44
|
+
|
|
45
|
+
const { createUpdateDataDetail } = require("@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs")
|
|
46
|
+
const { PREFIX, TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
47
|
+
const coreConsts = require('@izara_project/izara-core-library-core/src/Consts')
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* description of function.
|
|
53
|
+
* @param {Object} _izContext
|
|
54
|
+
* @param {CorrelationIds} _izContext.correlationIds - property of _izContext
|
|
55
|
+
* @param {Logger} _izContext.logger - property of _izContext
|
|
56
|
+
* @param {Object} requestParams - request params
|
|
57
|
+
* @param {Object} requestParams.identifiers - identifiers for get data
|
|
58
|
+
* @param {Object} requestParams.additionalRequest - additionalRequest
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* @returns {object} description of return value
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
module.exports.<%- functionName %>Main = async (
|
|
65
|
+
_izContext,
|
|
66
|
+
requestParams,
|
|
67
|
+
callingFlowConfig = {},
|
|
68
|
+
//(<additionalParams>)
|
|
69
|
+
//(</additionalParams>)
|
|
70
|
+
) => {
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
_izContext.logger.debug("<%- functionName %> _izContext", _izContext)
|
|
74
|
+
_izContext.logger.debug("<%- functionName %> requestParams", requestParams)
|
|
75
|
+
_izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
|
|
76
|
+
|
|
77
|
+
let errorFounds = [];
|
|
78
|
+
const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
|
|
79
|
+
const targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID);
|
|
80
|
+
|
|
81
|
+
if (!userId) {
|
|
82
|
+
errorFounds.push("Not have userId")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const OBJECT_TYPE = "<%- objectType %>"
|
|
86
|
+
const SERVICE_TAG = process.env.iz_serviceTag;
|
|
87
|
+
//(<beforeQuery>)
|
|
88
|
+
//(</beforeQuery>)
|
|
89
|
+
|
|
90
|
+
const identifiers = requestParams.objInstanceFull.identifiers;
|
|
91
|
+
const fields = requestParams.objInstanceFull.fields
|
|
92
|
+
let versionedDataIds = requestParams.versionedDataIds || {}
|
|
93
|
+
|
|
94
|
+
_izContext.logger.debug("explode requestParams", {
|
|
95
|
+
identifiers: identifiers,
|
|
96
|
+
fields: fields,
|
|
97
|
+
versionedDataIds: versionedDataIds
|
|
98
|
+
})
|
|
99
|
+
let objectSchema = await getObjSchemaS3WithHierarchy(
|
|
100
|
+
_izContext,
|
|
101
|
+
{
|
|
102
|
+
objectType: OBJECT_TYPE,
|
|
103
|
+
serviceTag: SERVICE_TAG
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
_izContext.logger.debug("objectSchema", objectSchema);
|
|
107
|
+
|
|
108
|
+
if (objectSchema.hasOwnProperty("belongTo") && !targetId) {
|
|
109
|
+
errorFounds.push('not have targetId')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let updateDataDetails = await createUpdateDataDetail(_izContext, objectSchema);
|
|
113
|
+
|
|
114
|
+
_izContext.logger.debug("updateDataDetails", updateDataDetails);
|
|
115
|
+
|
|
116
|
+
let originTimestamp = Date.now();
|
|
117
|
+
|
|
118
|
+
let haveVersionedDataIdsToUpdate = (requestParams.versionedDataIds && Object.keys(requestParams.versionedDataIds).length) ? true : false
|
|
119
|
+
if (haveVersionedDataIdsToUpdate) {
|
|
120
|
+
|
|
121
|
+
let updateMainNodeData = {};
|
|
122
|
+
let updateVersionedData = {};
|
|
123
|
+
_izContext.logger.debug("have versionedDataIds to update")
|
|
124
|
+
for (const fieldProp in requestParams.objInstanceFull.fields) {
|
|
125
|
+
const fieldSetting = objectSchema.fieldNames[fieldProp];
|
|
126
|
+
// collect updateData
|
|
127
|
+
if (fieldSetting.hasOwnProperty("versionedDataLabel")) {
|
|
128
|
+
if (!updateVersionedData.hasOwnProperty(fieldSetting.versionedDataLabel)) {
|
|
129
|
+
updateVersionedData[fieldSetting.versionedDataLabel] = {};
|
|
130
|
+
}
|
|
131
|
+
Object.assign(updateVersionedData[fieldSetting.versionedDataLabel], {
|
|
132
|
+
[fieldProp]: requestParams.objInstanceFull.fields[fieldProp]
|
|
133
|
+
})
|
|
134
|
+
} else {
|
|
135
|
+
Object.assign(updateMainNodeData, {
|
|
136
|
+
[fieldProp]: requestParams.objInstanceFull.fields[fieldProp]
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
_izContext.logger.debug("updateMainNodeData::", updateMainNodeData);
|
|
141
|
+
_izContext.logger.debug("updateVersionedData::", updateVersionedData);
|
|
142
|
+
|
|
143
|
+
const versionedDataIdLabelKeys = Object.keys(requestParams.versionedDataIds);
|
|
144
|
+
const updateVersionedDataLabelKeys = Object.keys(updateVersionedData);
|
|
145
|
+
|
|
146
|
+
_izContext.logger.debug("versionedDataIdLabelKeys:: ", versionedDataIdLabelKeys);
|
|
147
|
+
_izContext.logger.debug("updateVersionedDataLabelKeys:: ", updateVersionedDataLabelKeys);
|
|
148
|
+
//check missing versionedDataIds
|
|
149
|
+
const missingVersionedDataIdLabels = updateVersionedDataLabelKeys.filter(label => !versionedDataIdLabelKeys.includes(label));
|
|
150
|
+
_izContext.logger.debug("missingVersionedDataIdLabels:: ", missingVersionedDataIdLabels);
|
|
151
|
+
|
|
152
|
+
if (missingVersionedDataIdLabels.length) {
|
|
153
|
+
errorFounds.push(`missing versionedDataIds of versionedDataLabel '${missingVersionedDataIdLabels.join(", ")}'`)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// check missing update data of versionedDataLabels
|
|
157
|
+
const missingDataVersionedDataLabels = versionedDataIdLabelKeys.filter(label => !versionedDataIdLabelKeys.includes(label))
|
|
158
|
+
if (missingDataVersionedDataLabels.length) {
|
|
159
|
+
errorFounds.push(`missing data of versionedDataLabels '${missingDataVersionedDataLabels.join(", ")}'`);
|
|
160
|
+
}
|
|
161
|
+
// check mainNode Data should not exists
|
|
162
|
+
if (Object.keys(updateMainNodeData).length) {
|
|
163
|
+
errorFounds.push("cannot update mainNode if have versionedDataIds");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
let messageAttributes
|
|
168
|
+
|
|
169
|
+
if (errorFounds.length) {
|
|
170
|
+
let updateNodeCompleteMessage = {
|
|
171
|
+
objType: {
|
|
172
|
+
objecType: OBJECT_TYPE,
|
|
173
|
+
serviceTag: SERVICE_TAG
|
|
174
|
+
},
|
|
175
|
+
objInstanceFull: {
|
|
176
|
+
identifiers: identifiers,
|
|
177
|
+
fields: fields,
|
|
178
|
+
},
|
|
179
|
+
versionedDataIds: versionedDataIds,
|
|
180
|
+
status: 'error',
|
|
181
|
+
errorFounds: errorFounds
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
updateNodeCompleteMessage = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, updateNodeCompleteMessage);
|
|
186
|
+
messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {})
|
|
187
|
+
|
|
188
|
+
let messageParams = {
|
|
189
|
+
Message: JSON.stringify(updateNodeCompleteMessage),
|
|
190
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
191
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateNodeComplete),
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
_izContext.logger.debug("messageParams OutUpdateNodeComplete ::::::: ", messageParams);
|
|
195
|
+
await sns.publishAsync(_izContext, messageParams);
|
|
196
|
+
|
|
197
|
+
return updateNodeCompleteMessage
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
let awaitingStepIds = [];
|
|
201
|
+
|
|
202
|
+
// start update data
|
|
203
|
+
await Promise.all(
|
|
204
|
+
Object.entries(updateDataDetails).map(
|
|
205
|
+
async ([storageTag, updateDataDetail]) => {
|
|
206
|
+
if (updateDataDetail.storageType === consts.STORAGE_TYPES.graph) {
|
|
207
|
+
// let graphServiceName = await getGraphServiceTagWithCache(_izContext, getDataDetail.graphServiceTag)
|
|
208
|
+
|
|
209
|
+
awaitingStepIds.push( // createAwaitingstepId if updateGraph
|
|
210
|
+
asyncFlowSharedLib.createAwaitingStepId(
|
|
211
|
+
hash({
|
|
212
|
+
objectType: OBJECT_TYPE,
|
|
213
|
+
serviceTag: SERVICE_TAG,
|
|
214
|
+
identifiers: identifiers,
|
|
215
|
+
fields: fields,
|
|
216
|
+
// correlationIds: _izContext.correlationIds.get("id")
|
|
217
|
+
}),
|
|
218
|
+
PREFIX.updateNode
|
|
219
|
+
)
|
|
220
|
+
)
|
|
221
|
+
_izContext.logger.debug("awaitingStepIds", awaitingStepIds)
|
|
222
|
+
|
|
223
|
+
if (awaitingStepIds.length) {
|
|
224
|
+
let awaitingMultipleStep = await asyncFlowSharedLib.createAwaitingMultipleSteps(
|
|
225
|
+
_izContext,
|
|
226
|
+
awaitingStepIds,
|
|
227
|
+
asyncFlowSharedLib.createPendingStepId(
|
|
228
|
+
hash(
|
|
229
|
+
{
|
|
230
|
+
identifiers,
|
|
231
|
+
fields,
|
|
232
|
+
})
|
|
233
|
+
)
|
|
234
|
+
)
|
|
235
|
+
_izContext.logger.debug("awaitingMultipleStep", awaitingMultipleStep)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
let updateNodeParams = {
|
|
239
|
+
objType: {
|
|
240
|
+
objectType: OBJECT_TYPE,
|
|
241
|
+
serviceTag: SERVICE_TAG
|
|
242
|
+
},
|
|
243
|
+
objInstanceFull: {
|
|
244
|
+
identifiers: identifiers,
|
|
245
|
+
fields: fields,
|
|
246
|
+
},
|
|
247
|
+
versionedDataIds: versionedDataIds,
|
|
248
|
+
originTimestamp
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
updateNodeParams = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
252
|
+
updateNodeParams,
|
|
253
|
+
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
254
|
+
callingFlowConfig,
|
|
255
|
+
callingFlowSharedLib.createCallingFlowConfig(
|
|
256
|
+
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.updateNodeComplete), {}
|
|
257
|
+
)
|
|
258
|
+
)
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
_izContext.logger.debug("messageObject before send message:", updateNodeParams);
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
let updateNodeMessageBody = {
|
|
265
|
+
Message: JSON.stringify(updateNodeParams),
|
|
266
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
267
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag, )
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
_izContext.logger.debug('requset param before send to topic InUpdateNode:::', updateNodeMessageBody);
|
|
271
|
+
|
|
272
|
+
let resSNS = await sns.publishAsync(_izContext, updateNodeMessageBody)
|
|
273
|
+
_izContext.logger.debug('resSNS send to topic InUpdateNode finish!', resSNS);
|
|
274
|
+
|
|
275
|
+
} else if (updateDataDetail.storageType === consts.STORAGE_TYPES.dynamoDB) {
|
|
276
|
+
|
|
277
|
+
let identifiersForUpdateData = await dynamoDbIdentifiersByStorageResource(
|
|
278
|
+
_izContext,
|
|
279
|
+
objectSchema,
|
|
280
|
+
updateDataDetail,
|
|
281
|
+
identifiers
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
let fieldForUpdateTableDynamo = createFieldForUpdateDynamoDb(_izContext, objectSchema, updateDataDetail, fields)
|
|
285
|
+
|
|
286
|
+
_izContext.logger.debug("identifiersForUpdateData", identifiersForUpdateData)
|
|
287
|
+
_izContext.logger.debug("fieldForUpdateTableDynamo", fieldForUpdateTableDynamo)
|
|
288
|
+
|
|
289
|
+
let updateItem = await dynamodbSharedLib.updateItem(
|
|
290
|
+
_izContext,
|
|
291
|
+
await dynamodbSharedLib.tableName(_izContext, updateDataDetail.tableName),
|
|
292
|
+
identifiersForUpdateData,
|
|
293
|
+
fieldForUpdateTableDynamo,
|
|
294
|
+
{
|
|
295
|
+
returnValues: "ALL_NEW"
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
_izContext.logger.debug("updateItem:", updateItem);
|
|
299
|
+
|
|
300
|
+
if (awaitingStepIds.length == 0) {
|
|
301
|
+
let messageObject = {
|
|
302
|
+
objType: {
|
|
303
|
+
objectType: OBJECT_TYPE,
|
|
304
|
+
serviceTag: SERVICE_TAG
|
|
305
|
+
},
|
|
306
|
+
updateItem
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (callingFlowConfig[callingFlowSharedLib.consts.CALLINGFLOWPROPERTIES_PROPERTYNAME]) {
|
|
310
|
+
_izContext.logger.debug("HAVE CALLINGFLOW");
|
|
311
|
+
|
|
312
|
+
messageObject = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObject);
|
|
313
|
+
let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
|
|
314
|
+
|
|
315
|
+
_izContext.logger.debug("after create callingFlow", messageObject)
|
|
316
|
+
let outUpdateNodeCompleteTopic = await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateNodeComplete);
|
|
317
|
+
let messageParams = {
|
|
318
|
+
Message: JSON.stringify(messageObject),
|
|
319
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
320
|
+
TopicArn: outUpdateNodeCompleteTopic
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
_izContext.logger.debug("message params OutUpdateNodeComplete :::", messageParams);
|
|
324
|
+
await sns.publishAsync(_izContext, messageParams);
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
)
|
|
332
|
+
return {
|
|
333
|
+
returnValues: {
|
|
334
|
+
objType: {
|
|
335
|
+
objectType: OBJECT_TYPE,
|
|
336
|
+
serviceTag: SERVICE_TAG
|
|
337
|
+
},
|
|
338
|
+
objInstanceFull: {
|
|
339
|
+
identifiers: identifiers,
|
|
340
|
+
fields: fields,
|
|
341
|
+
},
|
|
342
|
+
versionedDataIds: versionedDataIds
|
|
343
|
+
},
|
|
344
|
+
status: "complete",
|
|
345
|
+
errorFounds
|
|
346
|
+
}
|
|
347
|
+
} catch (err) {
|
|
348
|
+
_izContext.logger.error('error AddressUpdate: ', err)
|
|
349
|
+
throw (err)
|
|
350
|
+
}
|
|
351
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../#utils");
|
|
25
|
+
// const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, SNS_RESOURCE, FUNCTION_NAME, defaultIamRolePerAction, awaitingMultipleStepsRole, shortNameHandler } = require("../#const");
|
|
26
|
+
const {
|
|
27
|
+
firstLetterLowerCase: lowerCase,
|
|
28
|
+
firstLetterUpperCase: upperCase,
|
|
29
|
+
} = require("../../../../../MainLibs/index.js").utils;
|
|
30
|
+
const {
|
|
31
|
+
DEFAULT_HANDLER_PER_ACTION,
|
|
32
|
+
createIamRole,
|
|
33
|
+
resourceNames,
|
|
34
|
+
RESOURCE_CLASSES,
|
|
35
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
36
|
+
SOURCE_PATH,
|
|
37
|
+
SAVE_FILE_NAME,
|
|
38
|
+
DYNAMO_RESOURCE,
|
|
39
|
+
SNS_RESOURCE,
|
|
40
|
+
FUNCTION_NAME,
|
|
41
|
+
defaultIamRolePerAction,
|
|
42
|
+
awaitingMultipleStepsRole,
|
|
43
|
+
shortNameHandler
|
|
44
|
+
} = require("../../../../../MainLibs/index.js").consts;
|
|
45
|
+
|
|
46
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* receive objectSchema
|
|
50
|
+
* create data for hdrInv template
|
|
51
|
+
*
|
|
52
|
+
* @param {Object} objectSchema
|
|
53
|
+
* @return {{ templatePath, templateData, setting } }
|
|
54
|
+
*/
|
|
55
|
+
function data(_izContext, objectSchema, srcPath) {
|
|
56
|
+
let createSourceArray = [];
|
|
57
|
+
for (const action of Object.values(ACTIONS)) {
|
|
58
|
+
if (objectSchema.overWriteHandlers?.[action]) {
|
|
59
|
+
// if have overWriteHander of action check hdrApi inside
|
|
60
|
+
if (objectSchema.overWriteHandlers[action].includes(HANDLER.hdrApi)) {
|
|
61
|
+
// create template data
|
|
62
|
+
const createSourceParam = createParamForCreateSource(objectSchema, action, srcPath)
|
|
63
|
+
createSourceArray.push(createSourceParam)
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
// if not have overWriteHander of action will use default handler
|
|
67
|
+
const defaultHandler = DEFAULT_HANDLER_PER_ACTION[action]
|
|
68
|
+
if (defaultHandler.includes(HANDLER.hdrApi)) {
|
|
69
|
+
// create template data and object for create source
|
|
70
|
+
const createSourceParam = createParamForCreateSource(objectSchema, action, srcPath)
|
|
71
|
+
createSourceArray.push(createSourceParam)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return createSourceArray;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
79
|
+
// let objectType = objectSchema.objectType
|
|
80
|
+
let objectType = objectSchema.objectType;
|
|
81
|
+
let groupBy = objectSchema?.shortNameObjectType ? objectSchema.shortNameObjectType : objectSchema.objectType;
|
|
82
|
+
let functionName = upperCase(objectType) + upperCase(action);
|
|
83
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
84
|
+
let tableForGetItem = [];
|
|
85
|
+
let hasGraphStorage = false;
|
|
86
|
+
let functionNameObjectType = objectSchema?.shortNameObjectType ? objectSchema.shortNameObjectType : objectSchema.objectType
|
|
87
|
+
let functionNameConfig = upperCase(functionNameObjectType) + upperCase(action) + upperCase(shortNameHandler(HANDLER.hdrApi))
|
|
88
|
+
|
|
89
|
+
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
90
|
+
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
91
|
+
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
92
|
+
tableForGetItem.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
93
|
+
|
|
94
|
+
} else if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
95
|
+
// find graph serviceName from graphServerTag or *GetNodeHdrInv ?
|
|
96
|
+
|
|
97
|
+
if (hasGraphStorage) {
|
|
98
|
+
continue;
|
|
99
|
+
} else {
|
|
100
|
+
hasGraphStorage = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (tableForGetItem.length) {
|
|
106
|
+
additionalResourcePermission.push(
|
|
107
|
+
createIamRole(
|
|
108
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: [DEFAULT_LAMBDA_ROLE_PER_ACTION[action].dynamoDbPermission] },
|
|
109
|
+
tableForGetItem
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function httpEvent(lambdaAction) {
|
|
115
|
+
return {
|
|
116
|
+
create: "put",
|
|
117
|
+
update: "post",
|
|
118
|
+
get: "post",
|
|
119
|
+
delete: "delete"
|
|
120
|
+
}[lambdaAction]
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let event = httpEvent(action)
|
|
124
|
+
// console.log("event:", event)
|
|
125
|
+
|
|
126
|
+
if (action == ACTIONS.update) {
|
|
127
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
128
|
+
additionalResourcePermission.push(
|
|
129
|
+
createIamRole(
|
|
130
|
+
{
|
|
131
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
132
|
+
},
|
|
133
|
+
[
|
|
134
|
+
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(FUNCTION_NAME.updateNodeComplete))
|
|
135
|
+
]
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
} else if (action == ACTIONS.create) {
|
|
139
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
140
|
+
|
|
141
|
+
additionalResourcePermission.push(
|
|
142
|
+
createIamRole(
|
|
143
|
+
{
|
|
144
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
145
|
+
},
|
|
146
|
+
[
|
|
147
|
+
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(FUNCTION_NAME.createObjectComplete))
|
|
148
|
+
]
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
} else if (action == ACTIONS.delete) {
|
|
152
|
+
// additionalResourcePermission.push(
|
|
153
|
+
// createIamRole(
|
|
154
|
+
// {
|
|
155
|
+
// [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
156
|
+
// },
|
|
157
|
+
// [
|
|
158
|
+
// resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(FUNCTION_NAME.createObjectComplete))
|
|
159
|
+
// ]
|
|
160
|
+
// )
|
|
161
|
+
// )
|
|
162
|
+
} else if (action === ACTIONS.get) {
|
|
163
|
+
additionalResourcePermission.push(
|
|
164
|
+
createIamRole(
|
|
165
|
+
{
|
|
166
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
167
|
+
},
|
|
168
|
+
[
|
|
169
|
+
resourceNames(RESOURCE_CLASSES.sns, "OutGetNodeComplete")
|
|
170
|
+
]
|
|
171
|
+
)
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
templatePath: templatePath,
|
|
177
|
+
templateData: {
|
|
178
|
+
functionName: functionName,
|
|
179
|
+
resourceLocation: SOURCE_PATH.resourceLocationPerAction,
|
|
180
|
+
handlerType: upperCase(HANDLER.hdrApi),
|
|
181
|
+
additionalResourcePermission,
|
|
182
|
+
event: event,
|
|
183
|
+
objectType: objectType,
|
|
184
|
+
roleName: groupBy,
|
|
185
|
+
action: action,
|
|
186
|
+
functionNameConfig,
|
|
187
|
+
},
|
|
188
|
+
setting: {
|
|
189
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
190
|
+
saveFileName: SAVE_FILE_NAME.functionPerActionYaml,
|
|
191
|
+
fileExtension: '.yml',
|
|
192
|
+
isAppend: true
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
module.exports = data;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<%_ const join = require('path').join; _%>
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
|
+
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
events:
|
|
6
|
+
- http:
|
|
7
|
+
path: <%- firstLetterUpperCase(objectType) %>/<%- firstLetterUpperCase(action) %>
|
|
8
|
+
method: <%- event %>
|
|
9
|
+
cors: true
|
|
10
|
+
#<#<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>Authorizer#>
|
|
11
|
+
#<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>Authorizer#>
|
|
12
|
+
role: <%- firstLetterUpperCase(roleName) %>Role
|
|
13
|
+
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
+
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
|
+
<%_ function firstLetterUpperCase(text){
|
|
16
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
|
+
} _%>
|
|
18
|
+
<%_ function firstLetterLowerCase(str) {
|
|
19
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
20
|
+
} _%>
|