@izara_project/izara-market-library-service-schemas 1.0.23 → 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 +2 -2
- package/src/GenerateCodeLibs/index.js +1 -0
- 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/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/externalService/FunctionNameConfig/data.js +2 -3
- 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 -15
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +0 -1
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +0 -12
- /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,429 @@
|
|
|
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 izaraShared = require('@izara_project/izara-shared');
|
|
21
|
+
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
22
|
+
const graphSharedLib = izaraShared.graphSharedLib;
|
|
23
|
+
const searchResultSharedLib = izaraShared.searchResultSharedLib;
|
|
24
|
+
const logicalResultsSharedLib = izaraShared.logicalResultsSharedLib;
|
|
25
|
+
const snsSharedLib = izaraShared.snsSharedLib;
|
|
26
|
+
|
|
27
|
+
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
28
|
+
const getObjectSchemas = serviceSchemas.getObjectSchema;
|
|
29
|
+
const serviceConfig = serviceSchemas.serviceConfig;
|
|
30
|
+
const { STORAGE_TYPES } = serviceSchemas.consts;
|
|
31
|
+
const { getUsedFieldNamesOfIdentifiers } = serviceSchemas.utils;
|
|
32
|
+
|
|
33
|
+
const sns = require('@izara_project/izara-core-library-external-request').sns;
|
|
34
|
+
|
|
35
|
+
//(<additionalModule>)
|
|
36
|
+
//(</additionalModule>)
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* performs the logical operation/filter/search in the element, saves into LogicalResultsData table
|
|
40
|
+
* @param {Object} _izContext
|
|
41
|
+
* @param {Object} objType - contain objectType and serviceTag
|
|
42
|
+
* @param {Object} element - logical element
|
|
43
|
+
* @param {Object} element.type - "logical"
|
|
44
|
+
* @param {string} element.logicalType - contain "identifier" | "partitionKey"
|
|
45
|
+
* @param {string} [element.partitionKey] - value of fieldNames that is partitionKey. send if logicalType is "partitionKey"
|
|
46
|
+
* @param {string} [element.sortKey] - value of fieldNames that is sortKey. send if logicalType is "partitionKey"
|
|
47
|
+
* @param {string} [element.comparison] - use for query in queryElements.sortKeyCondition. send if logicalType is "partitionKey"
|
|
48
|
+
* @param {Object} [element.identifiers] - object that have identifier. send if logicalType is "identifier"
|
|
49
|
+
*
|
|
50
|
+
* @returns {string} description of return value
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
module.exports.processLogical = async (
|
|
54
|
+
_izContext,
|
|
55
|
+
objType,
|
|
56
|
+
element,
|
|
57
|
+
callingFlow
|
|
58
|
+
) => {
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
|
|
62
|
+
_izContext.logger.debug('----- ProcessLogical event params -----', {
|
|
63
|
+
objType: objType,
|
|
64
|
+
element: element,
|
|
65
|
+
callingFlow: callingFlow
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
let removeAttributes = ["paginateProcessLogicalUniqueRequestId"];
|
|
69
|
+
|
|
70
|
+
//(<removeAttributes>)
|
|
71
|
+
//(</removeAttributes>)
|
|
72
|
+
|
|
73
|
+
// Check/Create logicalResultsMain
|
|
74
|
+
let [logicalResultsMainStatus, logicalResultId, logicalResultMain] = await logicalResultsSharedLib.checkLogicalMainStatus(
|
|
75
|
+
_izContext,
|
|
76
|
+
element, // for create logicalResultId
|
|
77
|
+
objType,
|
|
78
|
+
callingFlow,
|
|
79
|
+
removeAttributes
|
|
80
|
+
);
|
|
81
|
+
_izContext.logger.debug("After check logicalMainStatus: ", {
|
|
82
|
+
logicalResultsMainStatus: logicalResultsMainStatus,
|
|
83
|
+
logicalResultId: logicalResultId,
|
|
84
|
+
logicalResultMain: logicalResultMain
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (logicalResultsMainStatus !== "process") {
|
|
88
|
+
_izContext.logger.debug(`logicalResultsMainStatus status isn't process :${logicalResultsMainStatus}`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let errorsFound = [];
|
|
93
|
+
|
|
94
|
+
let standardErrorParams = [
|
|
95
|
+
_izContext,
|
|
96
|
+
logicalResultId,
|
|
97
|
+
logicalResultMain.logicalElement,
|
|
98
|
+
logicalResultMain.objType,
|
|
99
|
+
"error"
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
if (element.logicalType === "identifier") {
|
|
103
|
+
_izContext.logger.debug("logicalType: ", element.logicalType)
|
|
104
|
+
|
|
105
|
+
if (!element.hasOwnProperty("identifiers")) {
|
|
106
|
+
errorsFound.push("element don't have identifier")
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (typeof element.identifiers !== "object") {
|
|
110
|
+
errorsFound.push("type of element isn't object")
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const objectSchemas = await getObjectSchemas.getObjSchemaS3WithHierarchy(_izContext, objType);
|
|
114
|
+
_izContext.logger.debug("objectSchemas: ", objectSchemas)
|
|
115
|
+
|
|
116
|
+
let identifiersFieldName = null;
|
|
117
|
+
let graphServerTag = null;
|
|
118
|
+
let fieldNameFindStorageTags = null;
|
|
119
|
+
|
|
120
|
+
const storageResources = objectSchemas.storageResources;
|
|
121
|
+
const fieldNames = objectSchemas.fieldNames;
|
|
122
|
+
|
|
123
|
+
for (const schemasIdentifier of objectSchemas.identifiers) {
|
|
124
|
+
|
|
125
|
+
if (schemasIdentifier.type === "identifier" || schemasIdentifier.type === "partitionKey") {
|
|
126
|
+
|
|
127
|
+
identifiersFieldName = schemasIdentifier.fieldName ?
|
|
128
|
+
schemasIdentifier.fieldName :
|
|
129
|
+
schemasIdentifier.name
|
|
130
|
+
|
|
131
|
+
if (identifiersFieldName == schemasIdentifier.name) {
|
|
132
|
+
fieldNameFindStorageTags = schemasIdentifier.fieldNames[0];
|
|
133
|
+
} else {
|
|
134
|
+
fieldNameFindStorageTags = identifiersFieldName;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let storageResourceTags = fieldNames[fieldNameFindStorageTags].storageResourceTags; // array
|
|
138
|
+
_izContext.logger.debug(`storageResourceTags of fieldNameForFindGraph ${fieldNameFindStorageTags}: `, storageResourceTags)
|
|
139
|
+
|
|
140
|
+
for (const storageResourceTag of storageResourceTags) {
|
|
141
|
+
_izContext.logger.debug("check storageResourceTag: ", storageResourceTag)
|
|
142
|
+
|
|
143
|
+
if (Object.keys(storageResources).includes(storageResourceTag) &&
|
|
144
|
+
storageResources[storageResourceTag].storageType === STORAGE_TYPES.graph) {
|
|
145
|
+
graphServerTag = storageResources[storageResourceTag].graphServerTag;
|
|
146
|
+
_izContext.logger.debug("found graphServerTag: ", graphServerTag)
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (!graphServerTag) {
|
|
154
|
+
errorsFound.push("can't get graphServerTag")
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const identifiersNames = getUsedFieldNamesOfIdentifiers(_izContext, objectSchemas.identifiers);
|
|
158
|
+
_izContext.logger.debug("identifiersNames: ", identifiersNames);
|
|
159
|
+
|
|
160
|
+
for (const identifierName of identifiersNames) {
|
|
161
|
+
if (!element.identifiers.hasOwnProperty(identifierName)) {
|
|
162
|
+
errorsFound.push(`Missing property: ${identifierName} in element`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (errorsFound.length > 0) {
|
|
167
|
+
_izContext.logger.debug("Have errorsFound: ", errorsFound)
|
|
168
|
+
standardErrorParams.push(errorsFound)
|
|
169
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
170
|
+
return errorsFound;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const graphHandlerServiceTag = await serviceConfig.getGraphServiceTagWithCache(
|
|
174
|
+
_izContext,
|
|
175
|
+
graphServerTag
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
if (!graphHandlerServiceTag) {
|
|
179
|
+
_izContext.logger.debug("can't get graphServerTag")
|
|
180
|
+
errorsFound.push("can't get graphServerTag")
|
|
181
|
+
standardErrorParams.push(errorsFound)
|
|
182
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
let getNodeByIdentifiers = await graphSharedLib.getNodeV2(
|
|
187
|
+
_izContext,
|
|
188
|
+
graphHandlerServiceTag,
|
|
189
|
+
objType,
|
|
190
|
+
{
|
|
191
|
+
identifiers: element.identifiers
|
|
192
|
+
},
|
|
193
|
+
);
|
|
194
|
+
_izContext.logger.debug("getNodeByIdentifiers: ", getNodeByIdentifiers)
|
|
195
|
+
|
|
196
|
+
if (!getNodeByIdentifiers) {
|
|
197
|
+
errorsFound.push(`can not get node by identifiers`);
|
|
198
|
+
standardErrorParams.push(errorsFound)
|
|
199
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
await logicalResultsSharedLib.saveLogicalData(
|
|
204
|
+
_izContext,
|
|
205
|
+
logicalResultId,
|
|
206
|
+
objType,
|
|
207
|
+
element.identifiers
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(
|
|
211
|
+
_izContext,
|
|
212
|
+
logicalResultId,
|
|
213
|
+
element,
|
|
214
|
+
objType,
|
|
215
|
+
"complete",
|
|
216
|
+
[],
|
|
217
|
+
callingFlow
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
} else if (element.logicalType === "partitionKey") {
|
|
221
|
+
_izContext.logger.debug("logicalType: ", element.logicalType)
|
|
222
|
+
|
|
223
|
+
if (!element.hasOwnProperty("partitionKey")) {
|
|
224
|
+
errorsFound.push("element don't have partitionKey")
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (element.comparison && !searchResultSharedLib.consts.POSSIBLE_COMPARISON_SORTID.includes(element.comparison)) {
|
|
228
|
+
errorsFound.push("comparison isn't possible comparison")
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const objectSchemas = await getObjectSchemas.getObjSchemaS3WithHierarchy(_izContext, objType);
|
|
232
|
+
_izContext.logger.debug("objectSchemas: ", objectSchemas)
|
|
233
|
+
|
|
234
|
+
let identifiersFieldName = null;
|
|
235
|
+
let tableName = null;
|
|
236
|
+
let fieldNameFindStorageTags = null; // AKA partitionKeyFieldName
|
|
237
|
+
let sortKeyFieldName = null;
|
|
238
|
+
let haveSortKey = false;
|
|
239
|
+
|
|
240
|
+
const storageResources = objectSchemas.storageResources;
|
|
241
|
+
const fieldNames = objectSchemas.fieldNames;
|
|
242
|
+
|
|
243
|
+
for (const schemasIdentifier of objectSchemas.identifiers) {
|
|
244
|
+
|
|
245
|
+
if (schemasIdentifier.type === "partitionKey") {
|
|
246
|
+
|
|
247
|
+
identifiersFieldName = schemasIdentifier.fieldName ?
|
|
248
|
+
schemasIdentifier.fieldName :
|
|
249
|
+
schemasIdentifier.name
|
|
250
|
+
|
|
251
|
+
if (identifiersFieldName == schemasIdentifier.name) {
|
|
252
|
+
fieldNameFindStorageTags = schemasIdentifier.fieldNames[0];
|
|
253
|
+
} else {
|
|
254
|
+
fieldNameFindStorageTags = identifiersFieldName;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let storageResourceTags = fieldNames[fieldNameFindStorageTags].storageResourceTags; // array
|
|
258
|
+
_izContext.logger.debug(`storageResourceTags of fieldNameForFindGraph ${fieldNameFindStorageTags}: `, storageResourceTags)
|
|
259
|
+
|
|
260
|
+
for (const storageResourceTag of storageResourceTags) {
|
|
261
|
+
_izContext.logger.debug("check storageResourceTag: ", storageResourceTag)
|
|
262
|
+
|
|
263
|
+
if (Object.keys(storageResources).includes(storageResourceTag) &&
|
|
264
|
+
storageResources[storageResourceTag].storageType === STORAGE_TYPES.dynamoDB
|
|
265
|
+
) {
|
|
266
|
+
tableName = storageResources[storageResourceTag].tableName;
|
|
267
|
+
_izContext.logger.debug("found tableName: ", tableName)
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (schemasIdentifier.type === "sortKey") {
|
|
274
|
+
haveSortKey = true;
|
|
275
|
+
|
|
276
|
+
sortKeyFieldName = schemasIdentifier.fieldName ?
|
|
277
|
+
schemasIdentifier.fieldName :
|
|
278
|
+
schemasIdentifier.name
|
|
279
|
+
_izContext.logger.debug("have sortKeyFieldName: ", sortKeyFieldName)
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (!tableName) {
|
|
284
|
+
errorsFound.push("can't get tableName")
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (errorsFound.length > 0) {
|
|
288
|
+
_izContext.logger.debug("Have errorsFound: ", errorsFound)
|
|
289
|
+
standardErrorParams.push(errorsFound)
|
|
290
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (element.hasOwnProperty("sortKey")) {
|
|
295
|
+
|
|
296
|
+
if (!sortKeyFieldName) {
|
|
297
|
+
_izContext.logger.debug("element have sortKey but can't find sortKey in object schemas")
|
|
298
|
+
errorsFound.push("element have sortKey but can't find sortKey in object schemas")
|
|
299
|
+
standardErrorParams.push(errorsFound)
|
|
300
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
let comparison = "equals";
|
|
305
|
+
|
|
306
|
+
if (element.comparison && element.comparison !== "equals") {
|
|
307
|
+
comparison = element.comparison;
|
|
308
|
+
|
|
309
|
+
let sentMessageToPaginateProcessLogical = {
|
|
310
|
+
Message: JSON.stringify({
|
|
311
|
+
logicalResultId: logicalResultId,
|
|
312
|
+
tableName: tableName,
|
|
313
|
+
partitionKeyFieldName: fieldNameFindStorageTags,
|
|
314
|
+
sortKeyFieldName: sortKeyFieldName,
|
|
315
|
+
comparison: comparison,
|
|
316
|
+
callingFlow: callingFlow
|
|
317
|
+
}),
|
|
318
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "InPaginateProcessLogical")
|
|
319
|
+
};
|
|
320
|
+
_izContext.logger.debug('Request params before send to topic InPaginateProcessLogical: ', sentMessageToPaginateProcessLogical);
|
|
321
|
+
|
|
322
|
+
let resSNS = await sns.publishAsync(_izContext, sentMessageToPaginateProcessLogical);
|
|
323
|
+
_izContext.logger.debug('resSNS send to topic ProcessSortResult finish!', resSNS);
|
|
324
|
+
|
|
325
|
+
return "Send message to InPaginateProcessLogical";
|
|
326
|
+
|
|
327
|
+
} else {
|
|
328
|
+
|
|
329
|
+
let queryDatas = await dynamodbSharedLib.query(
|
|
330
|
+
_izContext,
|
|
331
|
+
await dynamodbSharedLib.tableName(_izContext, tableName),
|
|
332
|
+
{
|
|
333
|
+
[fieldNameFindStorageTags]: element.partitionKey
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
sortKeyCondition: {
|
|
337
|
+
comparison: comparison,
|
|
338
|
+
name: sortKeyFieldName,
|
|
339
|
+
value: element.sortKey
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
_izContext.logger.debug("queryDatas result: ", queryDatas)
|
|
344
|
+
|
|
345
|
+
if (queryDatas.Items.length == 0) {
|
|
346
|
+
_izContext.logger.debug(`can't find data in table ${tableName} by query`)
|
|
347
|
+
errorsFound.push(`can't find data in table ${tableName} by query`)
|
|
348
|
+
standardErrorParams.push(errorsFound)
|
|
349
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
350
|
+
return errorsFound;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
for (const objInstanceBase of queryDatas.Items) {
|
|
354
|
+
|
|
355
|
+
await logicalResultsSharedLib.saveLogicalData(
|
|
356
|
+
_izContext,
|
|
357
|
+
logicalResultId,
|
|
358
|
+
logicalResultMain.objType,
|
|
359
|
+
objInstanceBase
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
} else { // element don't have sortKey
|
|
365
|
+
|
|
366
|
+
if (haveSortKey) {
|
|
367
|
+
_izContext.logger.debug("identifiers have sortKey: query dynamo")
|
|
368
|
+
|
|
369
|
+
let sentMessageToPaginateProcessLogical = {
|
|
370
|
+
Message: JSON.stringify({
|
|
371
|
+
logicalResultId: logicalResultId,
|
|
372
|
+
tableName: tableName,
|
|
373
|
+
partitionKeyFieldName: fieldNameFindStorageTags,
|
|
374
|
+
sortKeyFieldName: sortKeyFieldName,
|
|
375
|
+
callingFlow: callingFlow
|
|
376
|
+
}),
|
|
377
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "InPaginateProcessLogical")
|
|
378
|
+
};
|
|
379
|
+
_izContext.logger.debug('Request params before send to topic InPaginateProcessLogical: ', sentMessageToPaginateProcessLogical);
|
|
380
|
+
|
|
381
|
+
let resSNS = await sns.publishAsync(_izContext, sentMessageToPaginateProcessLogical);
|
|
382
|
+
_izContext.logger.debug('resSNS send to topic ProcessSortResult finish!', resSNS);
|
|
383
|
+
|
|
384
|
+
return "Send message to InPaginateProcessLogical";
|
|
385
|
+
|
|
386
|
+
} else {
|
|
387
|
+
_izContext.logger.debug("identifiers don't have sortKey: save dataId")
|
|
388
|
+
|
|
389
|
+
await logicalResultsSharedLib.saveLogicalData(
|
|
390
|
+
_izContext,
|
|
391
|
+
logicalResultId,
|
|
392
|
+
objType,
|
|
393
|
+
{
|
|
394
|
+
[fieldNameFindStorageTags]: element.partitionKey
|
|
395
|
+
}
|
|
396
|
+
)
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// complete processLogical and send message Out
|
|
401
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(
|
|
402
|
+
_izContext,
|
|
403
|
+
logicalResultId,
|
|
404
|
+
element,
|
|
405
|
+
objType,
|
|
406
|
+
"complete",
|
|
407
|
+
[],
|
|
408
|
+
callingFlow
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
}
|
|
412
|
+
//(<additionalProcessLogical>)
|
|
413
|
+
//(</additionalProcessLogical>)
|
|
414
|
+
|
|
415
|
+
else {
|
|
416
|
+
_izContext.logger.debug("unrecognised logicalType");
|
|
417
|
+
errorsFound.push("unrecognised logicalType")
|
|
418
|
+
standardErrorParams.push(errorsFound)
|
|
419
|
+
await logicalResultsSharedLib.completeLogicalResultsMain(...standardErrorParams);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return "Function ProcessLogical is Finished"
|
|
424
|
+
|
|
425
|
+
} catch (err) {
|
|
426
|
+
_izContext.logger.error('error ProcessLogicalMain: ', err);
|
|
427
|
+
throw (err)
|
|
428
|
+
}
|
|
429
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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 templatePath = path.join(__dirname, "./template.ejs")
|
|
23
|
+
|
|
24
|
+
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
25
|
+
const serviceConfig = serviceSchemas.serviceConfig;
|
|
26
|
+
|
|
27
|
+
const { HANDLER, STORAGE_TYPES, ACTIONS } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
28
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/index.js").utils;
|
|
29
|
+
const {
|
|
30
|
+
createIamRole,
|
|
31
|
+
resourceNames,
|
|
32
|
+
RESOURCE_CLASSES,
|
|
33
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
34
|
+
SQS_RESOURCE,
|
|
35
|
+
SOURCE_PATH,
|
|
36
|
+
SAVE_FILE_NAME,
|
|
37
|
+
LAMBDA_RESOURCE,
|
|
38
|
+
FUNCTION_NAME,
|
|
39
|
+
DYNAMO_RESOURCE,
|
|
40
|
+
SNS_RESOURCE,
|
|
41
|
+
defaultIamRolePerAction,
|
|
42
|
+
shortNameHandler,
|
|
43
|
+
SHORT_FUNCTION_NAME,
|
|
44
|
+
SOURCE_GENERATE_IAM_ROLE } = require("../../../../MainLibs/index.js").consts;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* receive objectSchema
|
|
48
|
+
* create data for FindData Main template
|
|
49
|
+
*
|
|
50
|
+
* @param {Object} objectSchemas
|
|
51
|
+
* @return {{ templatePath, templateData, setting } }
|
|
52
|
+
*/
|
|
53
|
+
async function data(_izContext, objectSchemas, srcPath) {
|
|
54
|
+
|
|
55
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
56
|
+
let functionName = upperCase(FUNCTION_NAME.processLogical);
|
|
57
|
+
let tableForQuery = [];
|
|
58
|
+
|
|
59
|
+
for (let objectSchema of objectSchemas.records) {
|
|
60
|
+
// console.log("objectSchema", objectSchemas)
|
|
61
|
+
|
|
62
|
+
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
63
|
+
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
64
|
+
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
65
|
+
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (tableForQuery.length) {
|
|
71
|
+
additionalResourcePermission.push(
|
|
72
|
+
createIamRole(
|
|
73
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: DYNAMO_RESOURCE.query },
|
|
74
|
+
tableForQuery
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
additionalResourcePermission.push(
|
|
80
|
+
createIamRole({
|
|
81
|
+
[RESOURCE_CLASSES.sqs]:
|
|
82
|
+
[
|
|
83
|
+
SQS_RESOURCE.deleteMessage,
|
|
84
|
+
SQS_RESOURCE.getQueueAttributes,
|
|
85
|
+
SQS_RESOURCE.receiveMessage,
|
|
86
|
+
SQS_RESOURCE.sendMessage,
|
|
87
|
+
SQS_RESOURCE.deleteMessageBatch,
|
|
88
|
+
SQS_RESOURCE.getQueueUrl
|
|
89
|
+
]
|
|
90
|
+
}, [
|
|
91
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs)),
|
|
92
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs) + "DLQ")
|
|
93
|
+
]
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
additionalResourcePermission.push(
|
|
98
|
+
createIamRole(
|
|
99
|
+
{
|
|
100
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
101
|
+
},
|
|
102
|
+
[
|
|
103
|
+
resourceNames(RESOURCE_CLASSES.sns, "InProcessLogical"),
|
|
104
|
+
resourceNames(RESOURCE_CLASSES.sns, "InPaginateProcessLogical"),
|
|
105
|
+
resourceNames(RESOURCE_CLASSES.sns, "OutProcessLogicalComplete")
|
|
106
|
+
]
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
additionalResourcePermission.push(
|
|
111
|
+
createIamRole(
|
|
112
|
+
{
|
|
113
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
114
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.get].dynamoDbPermission,
|
|
115
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.update].dynamoDbPermission,
|
|
116
|
+
DYNAMO_RESOURCE.query
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
[
|
|
120
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "LogicalResultsMain")
|
|
121
|
+
]
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
additionalResourcePermission.push(
|
|
126
|
+
createIamRole(
|
|
127
|
+
{
|
|
128
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
129
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.get].dynamoDbPermission,
|
|
130
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.delete].dynamoDbPermission,
|
|
131
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.create].dynamoDbPermission,
|
|
132
|
+
DYNAMO_RESOURCE.query
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
[
|
|
136
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "LogicalResultsData")
|
|
137
|
+
]
|
|
138
|
+
)
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
templatePath: templatePath,
|
|
143
|
+
templateData: {
|
|
144
|
+
functionName: functionName,
|
|
145
|
+
resourceLocation: SOURCE_PATH.resourceLocationProcessLogical,
|
|
146
|
+
handlerType: HANDLER.hdrSqs,
|
|
147
|
+
additionalResourcePermission,
|
|
148
|
+
functionNameConfig: upperCase(SHORT_FUNCTION_NAME.processLogical) + upperCase(shortNameHandler(HANDLER.hdrSqs)),
|
|
149
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole
|
|
150
|
+
},
|
|
151
|
+
setting: {
|
|
152
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
153
|
+
saveFileName: upperCase(SAVE_FILE_NAME.processLogicalYaml),
|
|
154
|
+
fileExtension: '.yml',
|
|
155
|
+
isAppend: true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports = data;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%_ const join = require('path').join; _%>
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
|
+
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
events:
|
|
6
|
+
- sqs:
|
|
7
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
|
+
batchSize: 10
|
|
9
|
+
role: <%- roleName %>Role
|
|
10
|
+
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
11
|
+
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
12
|
+
<%_ function firstLetterUpperCase(text){ return text.charAt(0).toUpperCase() + text.slice(1) } _%>
|
|
@@ -16,32 +16,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const path = require("path");
|
|
20
19
|
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const { SOURCE_PATH, SAVE_FILE_NAME } = require("../../../../MainLibs/src/Consts");
|
|
22
|
+
const templatePath = path.join(__dirname, "./template.ejs");
|
|
21
23
|
|
|
22
|
-
const { HANDLER, ACTIONS } = require("@izara_project/izara-core-library-service-schemas/src/Consts")
|
|
23
|
-
const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require('../../../libs/Consts')
|
|
24
|
-
const { firstLetterUpperCase: uppercase, fristLetterLowerCase: lowerCase } = require('../../../../../MainLibs/src/Utils')
|
|
25
|
-
const templatePath = path.join(__dirname, '../../../ResourceYaml/sns-out/template.ejs');
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
/**
|
|
26
|
+
* receive srcPath
|
|
27
|
+
* not create data for ProcessLogical Main template
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} srcPath
|
|
30
|
+
* @return {{ templatePath, templateData, setting } }
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
async function data(_izContext, srcPath) {
|
|
30
34
|
|
|
31
|
-
function createResourceData(_izContext, srcPath) {
|
|
32
|
-
let queueName = uppercase(FUNCTION_NAME.outTranslateIds)
|
|
33
35
|
return {
|
|
34
36
|
templatePath: templatePath,
|
|
35
37
|
templateData: {
|
|
36
|
-
queueName
|
|
38
|
+
queueName: "PaginateProcessLogicalHdrDsq"
|
|
37
39
|
},
|
|
38
40
|
setting: {
|
|
41
|
+
initialData: "Resources:\n",
|
|
39
42
|
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
40
|
-
saveFileName: SAVE_FILE_NAME.
|
|
43
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
41
44
|
fileExtension: ".yml",
|
|
42
45
|
isAppend: true
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
module.exports = data
|
|
50
|
+
module.exports = data;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#------- queue ---------
|
|
2
|
+
<%- queueName %>:
|
|
3
|
+
Type: "AWS::SQS::Queue"
|
|
4
|
+
Properties:
|
|
5
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
6
|
+
RedrivePolicy:
|
|
7
|
+
deadLetterTargetArn: #!GetAtt
|
|
8
|
+
Fn::GetAtt:
|
|
9
|
+
- <%- queueName %>DLQ
|
|
10
|
+
- Arn
|
|
11
|
+
maxReceiveCount: 3
|
|
12
|
+
VisibilityTimeout: 120
|
|
13
|
+
<%- queueName %>DLQ:
|
|
14
|
+
Type: AWS::SQS::Queue
|
|
15
|
+
Properties:
|
|
16
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
17
|
+
<%- queueName %>Policy:
|
|
18
|
+
Type: AWS::SQS::QueuePolicy
|
|
19
|
+
Properties:
|
|
20
|
+
PolicyDocument:
|
|
21
|
+
Version: "2012-10-17"
|
|
22
|
+
Statement:
|
|
23
|
+
- Sid: "allow-sns-messages"
|
|
24
|
+
Effect: Allow
|
|
25
|
+
Principal: "*"
|
|
26
|
+
Resource: #!GetAtt
|
|
27
|
+
Fn::GetAtt:
|
|
28
|
+
- <%- queueName %>
|
|
29
|
+
- Arn
|
|
30
|
+
Action: "SQS:SendMessage"
|
|
31
|
+
Queues:
|
|
32
|
+
- Ref: <%- queueName %>
|