@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
package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
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 configSharedLib = izaraShared.configSharedLib;
|
|
22
|
-
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
23
|
-
const lambdaSharedLib = izaraShared.lambdaSharedLib;
|
|
24
|
-
const graphSharedLib = izaraShared.graphSharedLib;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const translateIdsSharedLib = require('@izara_project/izara-translateids/src/TranslateIdsLib');
|
|
28
|
-
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
29
|
-
const lambda = require('@izara_project/izara-core-library-external-request/src/resources/Lambda');
|
|
30
|
-
const serviceSchemas = require("@izara_project/izara-core-library-service-schemas");
|
|
31
|
-
const identifiersObject = require('@izara_project/izara-core-library-service-schemas/src/IdentifiersObject');
|
|
32
|
-
const getObjectSchema = require("@izara_project/izara-core-library-service-schemas/src/GetObjectSchema")
|
|
33
|
-
const { firstLetterUpperCase: upperCase } = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils')
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* translate ids from one object to another related object
|
|
37
|
-
* @param {Object} _izContext
|
|
38
|
-
* @param {object} fromObjType - the type of object we are translating ids from
|
|
39
|
-
* @param {Object[]} identifiers
|
|
40
|
-
* @param {string} fromTypeId - the type of object we are translating ids from
|
|
41
|
-
* @param {string} fromTable - table name
|
|
42
|
-
* @param {string} fromPartitionKeyId - partition key value
|
|
43
|
-
* @param {string} fromPartitionKeyFieldName - partition key field/attribute name
|
|
44
|
-
* @param {string} fromDataFieldName - data field/attribute name
|
|
45
|
-
* @param {object} toObjType - the type of object we are translating ids to
|
|
46
|
-
* @param {Object} [additionalData={}] - additional data to send back in completed message
|
|
47
|
-
* @param {Object} [startKey={}] - first invoke will be empty
|
|
48
|
-
* @param {Nummic} invocationCount
|
|
49
|
-
* @param {string[]} passOnStatus
|
|
50
|
-
* @param {string[]} passOnErrorsFound
|
|
51
|
-
* @param {string} callingFlow
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
module.exports.processTranslateIds = async (
|
|
55
|
-
_izContext,
|
|
56
|
-
fromObjType,
|
|
57
|
-
fromTypeId,
|
|
58
|
-
identifiers,
|
|
59
|
-
fromTable,
|
|
60
|
-
fromPartitionKeyId,
|
|
61
|
-
fromPartitionKeyFieldName,
|
|
62
|
-
fromDataFieldName,
|
|
63
|
-
toObjType,
|
|
64
|
-
relType,
|
|
65
|
-
translateIdsCacheId,
|
|
66
|
-
uniqueRequestId,
|
|
67
|
-
startKey = {},
|
|
68
|
-
invocationCount,
|
|
69
|
-
passOnStatus,
|
|
70
|
-
passOnErrorsFound,
|
|
71
|
-
callingFlow = "",
|
|
72
|
-
) => {
|
|
73
|
-
try {
|
|
74
|
-
_izContext.logger.debug("=== Function:ProcessTranslateIds ===", {
|
|
75
|
-
fromObjType: fromObjType,
|
|
76
|
-
fromTypeId: fromTypeId,
|
|
77
|
-
identifiers: identifiers,
|
|
78
|
-
fromTable: fromTable,
|
|
79
|
-
fromPartitionKeyId: fromPartitionKeyId,
|
|
80
|
-
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
81
|
-
fromDataFieldName: fromDataFieldName,
|
|
82
|
-
toObjType: toObjType,
|
|
83
|
-
relType: relType,
|
|
84
|
-
translateIdsCacheId: translateIdsCacheId,
|
|
85
|
-
uniqueRequestId: uniqueRequestId,
|
|
86
|
-
startKey,
|
|
87
|
-
invocationCount,
|
|
88
|
-
passOnStatus,
|
|
89
|
-
passOnErrorsFound,
|
|
90
|
-
callingFlow: callingFlow
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
let errorsFound = [];
|
|
94
|
-
|
|
95
|
-
let resultDatas;
|
|
96
|
-
let lastEvaluatedKeyResultDatas;
|
|
97
|
-
|
|
98
|
-
// incase didn't send identifiers
|
|
99
|
-
if (!identifiers) {
|
|
100
|
-
|
|
101
|
-
let getFromObjectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, fromObjType);
|
|
102
|
-
_izContext.logger.debug("getFromObjectSchema", getFromObjectSchema);
|
|
103
|
-
|
|
104
|
-
// create Full tableName
|
|
105
|
-
let tableName = await dynamodbSharedLib.tableName(_izContext, fromTable, upperCase(getFromObjectSchema.complexFilterServiceTag));
|
|
106
|
-
_izContext.logger.debug("tableName", tableName);
|
|
107
|
-
resultDatas = await translateIdsSharedLib.translateIdsGetResultIds(
|
|
108
|
-
_izContext,
|
|
109
|
-
tableName,
|
|
110
|
-
fromPartitionKeyId,
|
|
111
|
-
fromPartitionKeyFieldName,
|
|
112
|
-
startKey
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
_izContext.logger.debug("resultDatas query fromtable =>", resultDatas);
|
|
116
|
-
if (!resultDatas && identifiers === undefined) {
|
|
117
|
-
errorsFound.push(`Can not get resultDatas form Table${fromTable} and not have concatinateIdentifier to TranslateIds`)
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
async function processOneRecord(
|
|
122
|
-
_izContext,
|
|
123
|
-
translateIdsCacheId,
|
|
124
|
-
fromObjType,
|
|
125
|
-
toObjType,
|
|
126
|
-
relType,
|
|
127
|
-
identifier
|
|
128
|
-
) {
|
|
129
|
-
_izContext.logger.debug("==== Function processOneRecord =====:", {
|
|
130
|
-
translateIdsCacheId: translateIdsCacheId,
|
|
131
|
-
fromObjType: fromObjType,
|
|
132
|
-
toObjType: toObjType,
|
|
133
|
-
relType: relType,
|
|
134
|
-
identifiers: identifier
|
|
135
|
-
});
|
|
136
|
-
//if true return becase has cache per FromdataId ,eles false found toDataId;
|
|
137
|
-
/*
|
|
138
|
-
check cache from each dataId
|
|
139
|
-
*/
|
|
140
|
-
let [cacheExist, errorsFoundPerIdentifier, translateIdsCacheFromId] = await translateIdsSharedLib.translateIdsCheckCacheFromId(
|
|
141
|
-
_izContext,
|
|
142
|
-
fromObjType,
|
|
143
|
-
identifier,
|
|
144
|
-
toObjType,
|
|
145
|
-
relType,
|
|
146
|
-
translateIdsCacheId,
|
|
147
|
-
uniqueRequestId
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
_izContext.logger.debug('After check translateIdsCheckCacheFromId', {
|
|
152
|
-
cacheExist: cacheExist,
|
|
153
|
-
errorsFoundPerIdentifier: errorsFoundPerIdentifier,
|
|
154
|
-
translateIdsCacheFromId: translateIdsCacheFromId
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
if (cacheExist) {
|
|
158
|
-
if (errorsFoundPerIdentifier.length > 0) {
|
|
159
|
-
errorsFound = errorsFound.concat(errorsFoundPerIdentifier)
|
|
160
|
-
}
|
|
161
|
-
return;
|
|
162
|
-
};
|
|
163
|
-
// toDataIds from string to Object using function
|
|
164
|
-
let toDataIds = []
|
|
165
|
-
|
|
166
|
-
// let identifierObject = await identifiersObject.identifiersFromIdentifiersConcat(
|
|
167
|
-
// _izContext,
|
|
168
|
-
// fromObjType,
|
|
169
|
-
// identifier
|
|
170
|
-
// )
|
|
171
|
-
// _izContext.logger.debug("identifierObject", identifierObject)
|
|
172
|
-
|
|
173
|
-
let dataIdFromGetNodeAndRelationship = await graphSharedLib.getNodeAndRelationshipsV2(
|
|
174
|
-
_izContext,
|
|
175
|
-
"GraphHandler",
|
|
176
|
-
fromObjType,
|
|
177
|
-
identifier,
|
|
178
|
-
relType
|
|
179
|
-
)
|
|
180
|
-
_izContext.logger.debug("dataIdFromGetNodeAndRelationship: ", dataIdFromGetNodeAndRelationship);
|
|
181
|
-
|
|
182
|
-
await Promise.all(
|
|
183
|
-
dataIdFromGetNodeAndRelationship[0].relNodes.map(async (getNodeAndRelResult) => {
|
|
184
|
-
let dataIdFromIdentifiersObject = await identifiersObject.identifiersConcatFromIdentifiers(
|
|
185
|
-
_izContext,
|
|
186
|
-
toObjType,
|
|
187
|
-
getNodeAndRelResult.properties
|
|
188
|
-
)
|
|
189
|
-
_izContext.logger.debug("dataIdFromIdentifiersObject", dataIdFromIdentifiersObject)
|
|
190
|
-
toDataIds.push(dataIdFromIdentifiersObject);
|
|
191
|
-
})
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
_izContext.logger.debug("---------toDataIds---------", toDataIds)
|
|
195
|
-
//-------------------complete TranslateIdsCacheFromIdMain Per fromdataId------------
|
|
196
|
-
let status = 'complete';
|
|
197
|
-
|
|
198
|
-
if (passOnStatus) {
|
|
199
|
-
status = passOnStatus;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (errorsFoundPerIdentifier.length > 0) {
|
|
203
|
-
status = 'error';
|
|
204
|
-
passOnErrorsFound = passOnErrorsFound.concat(errorsFoundPerIdentifier);
|
|
205
|
-
|
|
206
|
-
} else {
|
|
207
|
-
_izContext.logger.debug('saveTranslateIdsCacheBothDataTables')
|
|
208
|
-
// invoke translateIdsChache lib that saves all toDataIds into both cache Data tables
|
|
209
|
-
await translateIdsSharedLib.saveTranslateIdsCacheBothDataTables(
|
|
210
|
-
_izContext,
|
|
211
|
-
toDataIds,
|
|
212
|
-
translateIdsCacheFromId,
|
|
213
|
-
translateIdsCacheId
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
//complete TranslateIdsCacheFromIdDataMain
|
|
218
|
-
await translateIdsSharedLib.completeTranslateIdsCacheFromIdMain(
|
|
219
|
-
_izContext,
|
|
220
|
-
translateIdsCacheFromId,
|
|
221
|
-
status,
|
|
222
|
-
errorsFoundPerIdentifier
|
|
223
|
-
);
|
|
224
|
-
} // end processOneRecord
|
|
225
|
-
|
|
226
|
-
let resultPromises = [];
|
|
227
|
-
/*
|
|
228
|
-
check concatinateIdentifier
|
|
229
|
-
if not use data from resultDatas that query from dynamo
|
|
230
|
-
*/
|
|
231
|
-
if (!identifiers.length) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
for (let resultData of resultDatas.Items) {
|
|
235
|
-
|
|
236
|
-
_izContext.logger.debug("+++++iterate resultDatas++++++", resultData);
|
|
237
|
-
resultPromises.push(
|
|
238
|
-
processOneRecord(
|
|
239
|
-
_izContext,
|
|
240
|
-
translateIdsCacheId, //fromPartitionKeyId, toType
|
|
241
|
-
fromObjType,
|
|
242
|
-
toObjType,
|
|
243
|
-
relType,
|
|
244
|
-
resultData[fromDataFieldName], //value of DataId
|
|
245
|
-
)
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
} else {
|
|
252
|
-
for (const identifier of identifiers) {
|
|
253
|
-
resultPromises.push(
|
|
254
|
-
processOneRecord(
|
|
255
|
-
_izContext,
|
|
256
|
-
translateIdsCacheId, //fromPartitionKeyId, toType
|
|
257
|
-
fromObjType,
|
|
258
|
-
toObjType,
|
|
259
|
-
relType,
|
|
260
|
-
identifier, //value of DataId
|
|
261
|
-
)
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
await Promise.all(resultPromises);
|
|
267
|
-
|
|
268
|
-
_izContext.logger.debug('============start translateIdsContinueProcessing============')
|
|
269
|
-
//complete TranslateIdsCacheFromIdMain {cache per filterMain}
|
|
270
|
-
let translateStatus = 'complete'
|
|
271
|
-
if (errorsFound.length > 0) {
|
|
272
|
-
translateStatus = 'error'
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
await translateIdsSharedLib.translateIdsContinueProcessing( //translateIdsCheckCache the rest next frsit resultDatas fininsh
|
|
277
|
-
_izContext,
|
|
278
|
-
fromObjType,
|
|
279
|
-
identifiers,
|
|
280
|
-
fromTable,
|
|
281
|
-
fromPartitionKeyId,
|
|
282
|
-
fromPartitionKeyFieldName,
|
|
283
|
-
fromDataFieldName,
|
|
284
|
-
toObjType,
|
|
285
|
-
relType,
|
|
286
|
-
translateIdsCacheId,
|
|
287
|
-
lastEvaluatedKeyResultDatas,
|
|
288
|
-
invocationCount,
|
|
289
|
-
translateStatus,
|
|
290
|
-
'ProcessTranslateIdsHdrDsq', // send from calling -- for pagination // e.g,TranslateIdsRequestHdrDsq
|
|
291
|
-
errorsFound,
|
|
292
|
-
callingFlow
|
|
293
|
-
);
|
|
294
|
-
|
|
295
|
-
} catch (err) {
|
|
296
|
-
_izContext.logger.error('error TranslateIdsRequest: ', err)
|
|
297
|
-
throw (err)
|
|
298
|
-
}
|
|
299
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
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
|
-
const izara = require("@izara_project/izara-middleware");
|
|
20
|
-
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
|
|
22
|
-
const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib;
|
|
23
|
-
const {
|
|
24
|
-
validateSchemaMiddleware
|
|
25
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
26
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
|
-
const translateIdsRequest = require('./TranslateIdsRequest_Main')
|
|
28
|
-
const perRecordsValidatorSchema = {
|
|
29
|
-
type: "object",
|
|
30
|
-
required: [
|
|
31
|
-
"fromObjType",
|
|
32
|
-
"toObjType",
|
|
33
|
-
"relType",
|
|
34
|
-
],
|
|
35
|
-
properties: {
|
|
36
|
-
fromObjType: {
|
|
37
|
-
type: "object",
|
|
38
|
-
required: ["objectType", "serviceTag"],
|
|
39
|
-
properties: {
|
|
40
|
-
objectType: izara.validatorSchema.stringNotEmpty(),
|
|
41
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
fromTypeId: {
|
|
45
|
-
type: "string",
|
|
46
|
-
},
|
|
47
|
-
identifiers: {
|
|
48
|
-
type: "array",
|
|
49
|
-
},
|
|
50
|
-
fromTable: {
|
|
51
|
-
type: "string",
|
|
52
|
-
},
|
|
53
|
-
fromPartitionKeyId: {
|
|
54
|
-
type: "string",
|
|
55
|
-
},
|
|
56
|
-
fromPartitionKeyFieldName: {
|
|
57
|
-
type: "string",
|
|
58
|
-
},
|
|
59
|
-
fromDataFieldName: {
|
|
60
|
-
type: "string",
|
|
61
|
-
},
|
|
62
|
-
toObjType: {
|
|
63
|
-
type: "object",
|
|
64
|
-
required: ["objectType", "serviceTag"],
|
|
65
|
-
properties: {
|
|
66
|
-
objectType: izara.validatorSchema.stringNotEmpty(),
|
|
67
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
toTypeId: {
|
|
71
|
-
type: "string",
|
|
72
|
-
},
|
|
73
|
-
relType: {
|
|
74
|
-
type: "object",
|
|
75
|
-
required: ["relationshipTag", "serviceTag"],
|
|
76
|
-
properties: {
|
|
77
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
78
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
invocationCount: {
|
|
82
|
-
type: "number",
|
|
83
|
-
default: 0,
|
|
84
|
-
},
|
|
85
|
-
callingFlow: {
|
|
86
|
-
type: "string",
|
|
87
|
-
default: "",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
//(<globalVarible>)
|
|
92
|
-
//(</globalVarible>)
|
|
93
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
let recordPromises = []; // final return
|
|
97
|
-
|
|
98
|
-
// loop each record and send to mainFunction
|
|
99
|
-
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
100
|
-
|
|
101
|
-
// --- reforming record.body for Dsq request
|
|
102
|
-
record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
|
|
103
|
-
record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
|
|
104
|
-
|
|
105
|
-
let passOnProperties = []
|
|
106
|
-
|
|
107
|
-
// --- validate message (and MessageAttributes)
|
|
108
|
-
await recordHandlerSharedLib.validateRecord(
|
|
109
|
-
record, // one record will send to mainFunction
|
|
110
|
-
"TranslateIdsRequestHdrDsq", // queue name that need to retry or send to dlq
|
|
111
|
-
perRecordsValidatorSchema, // schema for record.Message
|
|
112
|
-
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
116
|
-
passOnProperties.push(record.body.Message.fromObjType)
|
|
117
|
-
passOnProperties.push(record.body.Message.fromTypeId)
|
|
118
|
-
passOnProperties.push(record.body.Message.identifiers)
|
|
119
|
-
passOnProperties.push(record.body.Message.fromTable)
|
|
120
|
-
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
121
|
-
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
|
122
|
-
passOnProperties.push(record.body.Message.fromDataFieldName)
|
|
123
|
-
passOnProperties.push(record.body.Message.toObjType)
|
|
124
|
-
passOnProperties.push(record.body.Message.toTypeId)
|
|
125
|
-
passOnProperties.push(record.body.Message.relType)
|
|
126
|
-
passOnProperties.push(record.body.Message.callingFlow)
|
|
127
|
-
//(<afterSendParamIntoTranslateIdMainByHandlerDsq>)
|
|
128
|
-
//(</afterSendParamIntoTranslateIdMainByHandlerDsq>)
|
|
129
|
-
|
|
130
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
131
|
-
|
|
132
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
133
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
134
|
-
record, // one record will send to mainFunction
|
|
135
|
-
translateIdsRequest.translateIdsRequest, // mainFunction that need to invoke.
|
|
136
|
-
"TranslateIdsRequestHdrDsq", // queue name that need to retry or send to dlq
|
|
137
|
-
passOnProperties, // all parameters that mainFunction needed.
|
|
138
|
-
);
|
|
139
|
-
record._izContext.logger.debug('after recordPromise in handler');
|
|
140
|
-
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
141
|
-
})) //end record
|
|
142
|
-
|
|
143
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
144
|
-
try {
|
|
145
|
-
await Promise.all(recordPromises); // await all promises
|
|
146
|
-
return event.Records // return all for local test
|
|
147
|
-
} catch {
|
|
148
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
149
|
-
}
|
|
150
|
-
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
151
|
-
} catch (err) {
|
|
152
|
-
Logger.error('Unhandled error, TranslateIdsRequestHdrDsq:', err);
|
|
153
|
-
throw (err)
|
|
154
|
-
}
|
|
155
|
-
})
|
|
@@ -1,163 +0,0 @@
|
|
|
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
|
-
const izara = require("@izara_project/izara-middleware");
|
|
20
|
-
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
22
|
-
const {
|
|
23
|
-
validateSchemaMiddleware
|
|
24
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
25
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
|
-
const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib
|
|
27
|
-
|
|
28
|
-
const translateIdsRequest = require('./TranslateIdsRequest_Main');
|
|
29
|
-
|
|
30
|
-
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
31
|
-
|
|
32
|
-
// validate event params in middleware before send into main function
|
|
33
|
-
let validatorSchema = {
|
|
34
|
-
type: "object",
|
|
35
|
-
required: [
|
|
36
|
-
"fromObjType",
|
|
37
|
-
"toObjType",
|
|
38
|
-
"relType",
|
|
39
|
-
],
|
|
40
|
-
properties: {
|
|
41
|
-
fromObjType: {
|
|
42
|
-
type: "object",
|
|
43
|
-
required: ["objectType", "serviceTag"],
|
|
44
|
-
properties: {
|
|
45
|
-
objectType: izara.validatorSchema.stringNotEmpty(),
|
|
46
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
fromTypeId: {
|
|
50
|
-
type: "string",
|
|
51
|
-
},
|
|
52
|
-
identifiers: {
|
|
53
|
-
type: "array",
|
|
54
|
-
},
|
|
55
|
-
fromTable: {
|
|
56
|
-
type: "string",
|
|
57
|
-
},
|
|
58
|
-
fromPartitionKeyId: {
|
|
59
|
-
type: "string",
|
|
60
|
-
},
|
|
61
|
-
fromPartitionKeyFieldName: {
|
|
62
|
-
type: "string",
|
|
63
|
-
},
|
|
64
|
-
fromDataFieldName: {
|
|
65
|
-
type: "string",
|
|
66
|
-
},
|
|
67
|
-
toObjType: {
|
|
68
|
-
type: "object",
|
|
69
|
-
required: ["objectType", "serviceTag"],
|
|
70
|
-
properties: {
|
|
71
|
-
objectType: izara.validatorSchema.stringNotEmpty(),
|
|
72
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
toTypeId: {
|
|
76
|
-
type: "string",
|
|
77
|
-
},
|
|
78
|
-
relType: {
|
|
79
|
-
type: "object",
|
|
80
|
-
required: ["relationshipTag", "serviceTag"],
|
|
81
|
-
properties: {
|
|
82
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
83
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
invocationCount: {
|
|
87
|
-
type: "number",
|
|
88
|
-
default: 0,
|
|
89
|
-
},
|
|
90
|
-
callingFlow: {
|
|
91
|
-
type: "string",
|
|
92
|
-
default: "",
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
//(<globalVarible>)
|
|
98
|
-
//(</globalVarible>)
|
|
99
|
-
|
|
100
|
-
//validate event params in middleware
|
|
101
|
-
validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
|
|
102
|
-
|
|
103
|
-
//(<afterValidate>)
|
|
104
|
-
//(</afterValidate>)
|
|
105
|
-
|
|
106
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
107
|
-
try {
|
|
108
|
-
let recordPromises = []; // final return
|
|
109
|
-
|
|
110
|
-
// loop each record and send to mainFunction
|
|
111
|
-
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
112
|
-
|
|
113
|
-
let passOnProperties = []
|
|
114
|
-
|
|
115
|
-
// --- validate message (and MessageAttributes)
|
|
116
|
-
await recordHandlerSharedLib.validateRecord(
|
|
117
|
-
record, // one record will send to mainFunction
|
|
118
|
-
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
119
|
-
validatorSchema, // schema for record.Message
|
|
120
|
-
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
124
|
-
passOnProperties.push(record.body.Message.fromObjType)
|
|
125
|
-
passOnProperties.push(record.body.Message.fromTypeId)
|
|
126
|
-
passOnProperties.push(record.body.Message.identifiers)
|
|
127
|
-
passOnProperties.push(record.body.Message.fromTable)
|
|
128
|
-
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
129
|
-
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
|
130
|
-
passOnProperties.push(record.body.Message.fromDataFieldName)
|
|
131
|
-
passOnProperties.push(record.body.Message.toObjType)
|
|
132
|
-
passOnProperties.push(record.body.Message.toTypeId)
|
|
133
|
-
passOnProperties.push(record.body.Message.relType)
|
|
134
|
-
passOnProperties.push(record.body.Message.callingFlow)
|
|
135
|
-
//(<afterPutParamIntoMainFunction>)
|
|
136
|
-
//(</afterPutParamIntoMainFunction>)
|
|
137
|
-
|
|
138
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
139
|
-
|
|
140
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
141
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
142
|
-
record, // one record will send to mainFunction
|
|
143
|
-
translateIdsRequest.translateIdsRequest, // mainFunction that need to invoke.
|
|
144
|
-
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
145
|
-
passOnProperties, // all parameters that mainFunction needed.
|
|
146
|
-
);
|
|
147
|
-
record._izContext.logger.debug('after recordPromise in handler');
|
|
148
|
-
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
149
|
-
})) //end record
|
|
150
|
-
|
|
151
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
152
|
-
try {
|
|
153
|
-
await Promise.all(recordPromises); // await all promises
|
|
154
|
-
return event.Records // return all for local test
|
|
155
|
-
} catch {
|
|
156
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
157
|
-
}
|
|
158
|
-
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
159
|
-
} catch (err) {
|
|
160
|
-
Logger.error('Unhandled Error, TranslateIdsRequest:', err);
|
|
161
|
-
throw (err);
|
|
162
|
-
}
|
|
163
|
-
})
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
const path = require('path');
|
|
20
|
-
const fs = require('fs');
|
|
21
|
-
|
|
22
|
-
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
-
const { createGetDataDetails } = require('../../../../../GenerateCodeLibs/src/GenerateCodeLibs')
|
|
24
|
-
|
|
25
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
|
|
26
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../libs/Consts");
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const templatePath = path.join(__dirname, "./template.ejs")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* receive objectSchema
|
|
34
|
-
* create data for TranslateedMain
|
|
35
|
-
*
|
|
36
|
-
* @param {object} objectSchema
|
|
37
|
-
* @return {{templatePath, templateData, setting}}
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
async function createTranslateIdRequestMainFunction(_izContext, objectSchema, srcPath) {
|
|
41
|
-
return [await createSourceParams(_izContext, objectSchema, srcPath)];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async function createSourceParams(_izContext, objectSchema, srcPath) {
|
|
45
|
-
let functionName = FUNCTION_NAME.translateId
|
|
46
|
-
let getDataDetail = await createGetDataDetails(_izContext, objectSchema);
|
|
47
|
-
return {
|
|
48
|
-
templatePath: templatePath,
|
|
49
|
-
templateData: {
|
|
50
|
-
getDataDetail: JSON.stringify(getDataDetail),
|
|
51
|
-
functionName
|
|
52
|
-
},
|
|
53
|
-
setting: {
|
|
54
|
-
savePath: path.join(srcPath, SOURCE_PATH.translateIdsRequestFile),
|
|
55
|
-
saveFileName: `${SAVE_FILE_NAME.translateId}_Main`,
|
|
56
|
-
fileExtension: '.js',
|
|
57
|
-
isAppend: false
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
module.exports = createTranslateIdRequestMainFunction
|