@izara_project/izara-market-library-service-schemas 1.0.23 → 1.0.25
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 +4 -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 +1 -2
- 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,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../#utils");
|
|
25
|
+
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../#const");
|
|
26
|
+
const {
|
|
27
|
+
firstLetterLowerCase: lowerCase,
|
|
28
|
+
firstLetterUpperCase: upperCase,
|
|
29
|
+
firstLetterUpperCase,
|
|
30
|
+
} = require("../../../../../MainLibs/index.js").utils;
|
|
31
|
+
const {
|
|
32
|
+
DEFAULT_HANDLER_PER_ACTION,
|
|
33
|
+
SOURCE_PATH,
|
|
34
|
+
FUNCTION_NAME,
|
|
35
|
+
} = require("../../../../../MainLibs/index.js").consts;
|
|
36
|
+
|
|
37
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* receive objectSchema
|
|
41
|
+
* create data for hdrInv template
|
|
42
|
+
*
|
|
43
|
+
* @return {{ templatePath, templateData, setting } }
|
|
44
|
+
*/
|
|
45
|
+
function data(_izContext, srcPath) {
|
|
46
|
+
const createSourceParams = createParamForCreateSource(srcPath)
|
|
47
|
+
return [createSourceParams];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function createParamForCreateSource(srcPath) {
|
|
51
|
+
const functionName = FUNCTION_NAME.createObjectComplete;
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
templatePath: templatePath,
|
|
55
|
+
templateData: {
|
|
56
|
+
functionName,
|
|
57
|
+
queueName: upperCase(functionName),
|
|
58
|
+
functionName,
|
|
59
|
+
},
|
|
60
|
+
setting: {
|
|
61
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
62
|
+
saveFileName: `${upperCase(functionName)}_${upperCase(HANDLER.hdrSqs)}`,
|
|
63
|
+
fileExtension: ".js",
|
|
64
|
+
isAppend: false
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = data
|
|
@@ -0,0 +1,130 @@
|
|
|
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 AWS = require('aws-sdk');
|
|
21
|
+
// const sqs = new AWS.SQS({ apiVersion: '2012-11-05' });
|
|
22
|
+
|
|
23
|
+
const izara = require("@izara_project/izara-middleware");
|
|
24
|
+
const middleware = izara.middlewareHandler;
|
|
25
|
+
const izaraShared = require('@izara_project/izara-shared');
|
|
26
|
+
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
27
|
+
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
28
|
+
|
|
29
|
+
const createObjectComplete = require('./CreateObjectComplete_Main');
|
|
30
|
+
const Logger = require('@izara_project/izara-core-library-logger');
|
|
31
|
+
// validate event properties in body.Message of sqs event
|
|
32
|
+
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
33
|
+
// set schema for record.body.Message
|
|
34
|
+
let perRecordsValidatorSchema = {
|
|
35
|
+
type: "object",
|
|
36
|
+
required: [
|
|
37
|
+
'returnValue',
|
|
38
|
+
'status',
|
|
39
|
+
'errorFounds',
|
|
40
|
+
'graphServiceTag'
|
|
41
|
+
],
|
|
42
|
+
properties: {
|
|
43
|
+
returnValue: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
},
|
|
46
|
+
status: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
},
|
|
49
|
+
errorFounds: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
default: []
|
|
52
|
+
},
|
|
53
|
+
graphServiceTag: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// set schema for record.body.MessageAttributes
|
|
60
|
+
// const messageAttributeValidatorSchema = {
|
|
61
|
+
// type: "object",
|
|
62
|
+
// required: ['msgAtrrParam1', 'msgAtrrParam2'],
|
|
63
|
+
// properties: {
|
|
64
|
+
// msgAtrrParam1: {
|
|
65
|
+
// type: "string"
|
|
66
|
+
// },
|
|
67
|
+
// msgAtrrParam2: {
|
|
68
|
+
// type: "object"
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
// };
|
|
72
|
+
|
|
73
|
+
perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema); // is Ok passBackProperties
|
|
74
|
+
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
|
|
78
|
+
let recordPromises = [];
|
|
79
|
+
|
|
80
|
+
// loop each record and send to mainFunction
|
|
81
|
+
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
82
|
+
|
|
83
|
+
let passOnProperties = []
|
|
84
|
+
record._izContext.logger.debug('record ReceiveMsgOutHdrSqs', record);
|
|
85
|
+
|
|
86
|
+
//validate message (and MessageAttributes)
|
|
87
|
+
await recordHandlerSharedLib.validateRecord(
|
|
88
|
+
record, // one record will send to mainFunction
|
|
89
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
90
|
+
perRecordsValidatorSchema, // schema for record.Message
|
|
91
|
+
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// add argument (to invoke lambda) to passOnProperties[]
|
|
95
|
+
passOnProperties.push(record.body.Message.returnValue)
|
|
96
|
+
passOnProperties.push(record.body.Message.status)
|
|
97
|
+
passOnProperties.push(record.body.Message.errorFounds)
|
|
98
|
+
passOnProperties.push(record.body.Message.graphServiceTag)
|
|
99
|
+
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
100
|
+
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
101
|
+
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
102
|
+
|
|
103
|
+
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
104
|
+
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
105
|
+
record, // one record will send to mainFunction
|
|
106
|
+
createObjectComplete.createObjectComplete, // mainFunction that need to invoke.
|
|
107
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
108
|
+
passOnProperties, // all parameters that mainFunction needed.
|
|
109
|
+
);
|
|
110
|
+
record._izContext.logger.debug('after recordPromise in handler');
|
|
111
|
+
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
112
|
+
}))
|
|
113
|
+
|
|
114
|
+
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
115
|
+
try {
|
|
116
|
+
// --- main await all promises
|
|
117
|
+
await Promise.all(recordPromises); // await all promises
|
|
118
|
+
|
|
119
|
+
return event.Records // return all for local testing
|
|
120
|
+
|
|
121
|
+
} catch {
|
|
122
|
+
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
123
|
+
}
|
|
124
|
+
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
125
|
+
|
|
126
|
+
} catch (err) {
|
|
127
|
+
Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
|
|
128
|
+
throw (err);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
'use strict';
|
|
18
|
+
const asyncFlowSharedLib = require('@izara_project/izara-shared/src/AsyncFlowSharedLib');
|
|
19
|
+
const dynamodbSharedLib = require('@izara_project/izara-shared/src/DynamodbSharedLib');
|
|
20
|
+
const snsSharedLib = require('@izara_project/izara-shared/src/SnsSharedLib');
|
|
21
|
+
const sns = require('@izara_project/izara-core-library-external-request/src/resources/Sns');
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
|
|
23
|
+
const _ = require('lodash');
|
|
24
|
+
const hash = require("object-hash")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const PREFIX = {
|
|
28
|
+
CREATE_OBJECT_ASYNC: "createObjectAsync",
|
|
29
|
+
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {*} _izContext
|
|
35
|
+
* @param {*} returnValue
|
|
36
|
+
* @param {*} status
|
|
37
|
+
* @param {*} errorsFounds
|
|
38
|
+
* @param {*} graphServiceTag
|
|
39
|
+
* @param {*} passBackProperties
|
|
40
|
+
* @param {*} callingFlowConfig
|
|
41
|
+
returnValue = {
|
|
42
|
+
queryResult: returnCreateNode,
|
|
43
|
+
objType,
|
|
44
|
+
objInstance,
|
|
45
|
+
relationships,
|
|
46
|
+
settings
|
|
47
|
+
}
|
|
48
|
+
*/
|
|
49
|
+
module.exports.createObjectComplete = async (
|
|
50
|
+
_izContext,
|
|
51
|
+
returnValue,
|
|
52
|
+
status,
|
|
53
|
+
errorsFound,
|
|
54
|
+
graphServiceTag,
|
|
55
|
+
passBackProperties,
|
|
56
|
+
callingFlowConfig
|
|
57
|
+
) => {
|
|
58
|
+
try {
|
|
59
|
+
_izContext.logger.debug("function createObjectComplete:", {
|
|
60
|
+
returnValue,
|
|
61
|
+
status,
|
|
62
|
+
errorsFound,
|
|
63
|
+
graphServiceTag,
|
|
64
|
+
passBackProperties,
|
|
65
|
+
callingFlowConfig
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
let errorFounds = [];
|
|
69
|
+
|
|
70
|
+
if (_.isEmpty(returnValue)) {
|
|
71
|
+
_izContext.logger.debug("message callingFlowProperties is empty");
|
|
72
|
+
throw new NoRetryError("message not an object")
|
|
73
|
+
};
|
|
74
|
+
// validate.
|
|
75
|
+
if (!returnValue.hasOwnProperty("queryResult")) {
|
|
76
|
+
errorFounds.push("message is not have property queryResult, should be not happen");
|
|
77
|
+
};
|
|
78
|
+
if (!returnValue.hasOwnProperty("objType")) {
|
|
79
|
+
errorFounds.push("message is not have property objType, should be not happen");
|
|
80
|
+
};
|
|
81
|
+
if (!returnValue.hasOwnProperty("objInstance")) {
|
|
82
|
+
errorFounds.push("message is not have property objInstance, should be not objInstance");
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
if (status == "error" && errorsFound.length > 0) {
|
|
86
|
+
errorFounds.push(errorsFound);
|
|
87
|
+
} else if (status == "error" && errorsFound.length == 0) {
|
|
88
|
+
errorFounds.push("[invalid]statur is error not have errorfound form graphService");
|
|
89
|
+
|
|
90
|
+
};
|
|
91
|
+
if (status === "complete" && errorsFound.length > 0) {
|
|
92
|
+
errorFounds.push("[Invalid] status is commplete should be not have errorsFound");
|
|
93
|
+
};
|
|
94
|
+
if (graphServiceTag == "") {
|
|
95
|
+
errorFounds.push("[Invalid] graphServiceTag is not empty string");
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
if (errorsFound.length > 0) {
|
|
99
|
+
_izContext.logger.debug("Have error form grapService:", errorsFound);
|
|
100
|
+
errorFounds = errorFounds.concat(errorsFound);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// check and remove awaitngStep finish.
|
|
104
|
+
let awaitingStepId = asyncFlowSharedLib.createAwaitingStepId((hash(
|
|
105
|
+
{
|
|
106
|
+
objType: returnValue.objType,
|
|
107
|
+
graphServerTag: graphServiceTag,
|
|
108
|
+
identifiers: returnValue.objInstance.identifiers
|
|
109
|
+
}
|
|
110
|
+
)),
|
|
111
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
112
|
+
)
|
|
113
|
+
_izContext.logger.debug("awaitingStepId:", awaitingStepId);
|
|
114
|
+
|
|
115
|
+
let recordAwaitingSteps = await dynamodbSharedLib.query(
|
|
116
|
+
_izContext,
|
|
117
|
+
await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
|
|
118
|
+
{
|
|
119
|
+
awaitingStepId: awaitingStepId
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
_izContext.logger.debug("record awaitingSteps::", recordAwaitingSteps);
|
|
123
|
+
|
|
124
|
+
nextAwaitingAteps:
|
|
125
|
+
for (let listRecordAwaitingStep of recordAwaitingSteps.Items) {
|
|
126
|
+
|
|
127
|
+
_izContext.logger.debug("iterate RecordAwaitingStep:", listRecordAwaitingStep);
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
if (!await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
131
|
+
_izContext,
|
|
132
|
+
listRecordAwaitingStep.pendingStepId,
|
|
133
|
+
awaitingStepId
|
|
134
|
+
)) {
|
|
135
|
+
_izContext.logger.debug("!Waiting record form other graph::")
|
|
136
|
+
// **** add step of remove awaitingMultiplestep!! ??
|
|
137
|
+
continue nextAwaitingAteps
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
141
|
+
_izContext,
|
|
142
|
+
awaitingStepId,
|
|
143
|
+
listRecordAwaitingStep.pendingStepId,
|
|
144
|
+
);
|
|
145
|
+
_izContext.logger.debug("Remove awaitingStep finish")
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// seagame: problem about lambdaComplete is will missing errorsFound from request if have 2 request
|
|
149
|
+
// one send with errorsFound and one send without errorsFound
|
|
150
|
+
// this scenario can complete with or without errorsFound
|
|
151
|
+
let messageObject = {
|
|
152
|
+
objType: returnValue.objType,
|
|
153
|
+
identifierId: returnValue.objInstance.identifiers,
|
|
154
|
+
errorFounds: errorFounds
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
|
|
158
|
+
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {})
|
|
159
|
+
|
|
160
|
+
let sendMessageOutCreateObjectComplete = {
|
|
161
|
+
Message: JSON.stringify(messageObject),
|
|
162
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
163
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "OutCreateObjectComplete")
|
|
164
|
+
};
|
|
165
|
+
_izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
|
|
166
|
+
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
} catch (err) {
|
|
170
|
+
throw (err)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../#utils");
|
|
25
|
+
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require("../#const");
|
|
26
|
+
const {
|
|
27
|
+
firstLetterLowerCase: lowerCase,
|
|
28
|
+
firstLetterUpperCase: upperCase,
|
|
29
|
+
firstLetterUpperCase,
|
|
30
|
+
} = require("../../../../../MainLibs/index.js").utils;
|
|
31
|
+
const {
|
|
32
|
+
DEFAULT_HANDLER_PER_ACTION,
|
|
33
|
+
SOURCE_PATH,
|
|
34
|
+
FUNCTION_NAME,
|
|
35
|
+
SAVE_FILE_NAME,
|
|
36
|
+
} = require("../../../../../MainLibs/index.js").consts;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* receive objectSchema
|
|
43
|
+
* create data for hdrInv template
|
|
44
|
+
*
|
|
45
|
+
* @return {{ templatePath, templateData, setting } }
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
function data(_izContext, srcPath) {
|
|
49
|
+
return [createMainFunctionCreateComplete(_izContext, srcPath)]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function createMainFunctionCreateComplete(_izContext, srcPath) {
|
|
53
|
+
return {
|
|
54
|
+
templatePath: templatePath,
|
|
55
|
+
templateData: {},
|
|
56
|
+
setting: {
|
|
57
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
58
|
+
saveFileName: `${upperCase(FUNCTION_NAME.createObjectComplete)}_Main`,
|
|
59
|
+
fileExtension: ".js",
|
|
60
|
+
isAppend: false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = data
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
'use strict';
|
|
18
|
+
const asyncFlowSharedLib = require('@izara_project/izara-shared/src/AsyncFlowSharedLib');
|
|
19
|
+
const dynamodbSharedLib = require('@izara_project/izara-shared/src/DynamodbSharedLib');
|
|
20
|
+
const snsSharedLib = require('@izara_project/izara-shared/src/SnsSharedLib');
|
|
21
|
+
const sns = require('@izara_project/izara-core-library-external-request/src/resources/Sns');
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
|
|
23
|
+
const _ = require('lodash');
|
|
24
|
+
const hash = require("object-hash")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const PREFIX = {
|
|
28
|
+
CREATE_OBJECT_ASYNC: "createObjectAsync",
|
|
29
|
+
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {*} _izContext
|
|
35
|
+
* @param {*} returnValue
|
|
36
|
+
* @param {*} status
|
|
37
|
+
* @param {*} errorsFounds
|
|
38
|
+
* @param {*} graphServiceTag
|
|
39
|
+
* @param {*} passBackProperties
|
|
40
|
+
returnValue = {
|
|
41
|
+
queryResult: returnCreateNode,
|
|
42
|
+
objType,
|
|
43
|
+
objInstance,
|
|
44
|
+
relationships,
|
|
45
|
+
settings
|
|
46
|
+
}
|
|
47
|
+
*/
|
|
48
|
+
module.exports.createObjectComplete = async (
|
|
49
|
+
_izContext,
|
|
50
|
+
returnValue,
|
|
51
|
+
status,
|
|
52
|
+
errorsFound,
|
|
53
|
+
graphServiceTag,
|
|
54
|
+
passBackProperties,
|
|
55
|
+
) => {
|
|
56
|
+
try {
|
|
57
|
+
_izContext.logger.debug("function createObjectComplete:", {
|
|
58
|
+
returnValue,
|
|
59
|
+
status,
|
|
60
|
+
errorsFound,
|
|
61
|
+
graphServiceTag,
|
|
62
|
+
passBackProperties,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
if (_.isEmpty(returnValue)) {
|
|
66
|
+
_izContext.logger.debug("message callingFlowProperties is empty");
|
|
67
|
+
throw new NoRetryError("message not an object")
|
|
68
|
+
};
|
|
69
|
+
// validate.
|
|
70
|
+
if (!returnValue.hasOwnProperty("queryResult")) {
|
|
71
|
+
errorsFound.push("message is not have property queryResult, should be not happen");
|
|
72
|
+
};
|
|
73
|
+
if (!returnValue.hasOwnProperty("objType")) {
|
|
74
|
+
errorsFound.push("message is not have property objType, should be not happen");
|
|
75
|
+
};
|
|
76
|
+
if (!returnValue.hasOwnProperty("objInstanceFull")) {
|
|
77
|
+
errorsFound.push("message is not have property objInstance, should be not objInstance");
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
if (status == "error" && errorsFound.length > 0) {
|
|
81
|
+
errorsFound.push(errorsFound);
|
|
82
|
+
} else if (status == "error" && errorsFound.length == 0) {
|
|
83
|
+
errorsFound.push("[invalid]statur is error not have errorfound form graphService");
|
|
84
|
+
|
|
85
|
+
};
|
|
86
|
+
if (status === "complete" && errorsFound.length > 0) {
|
|
87
|
+
errorsFound.push("[Invalid] status is commplete should be not have errorsFound");
|
|
88
|
+
};
|
|
89
|
+
if (graphServiceTag == null) {
|
|
90
|
+
errorsFound.push("[Invalid] graphServerTag is not empty string");
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (errorsFound.length > 0) {
|
|
94
|
+
_izContext.logger.debug("Have error form grapService:", errorsFound);
|
|
95
|
+
errorsFound = errorsFound.concat(errorsFound);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
|
|
99
|
+
(hash({
|
|
100
|
+
objType: returnValue.objType,
|
|
101
|
+
graphServerTag: graphServiceTag,
|
|
102
|
+
identifiers: returnValue.objInstanceFull.identifiers
|
|
103
|
+
})),
|
|
104
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
105
|
+
)
|
|
106
|
+
_izContext.logger.debug("awaitingStepId:", awaitingStepId);
|
|
107
|
+
|
|
108
|
+
let recordAwaitingSteps = await dynamodbSharedLib.query(
|
|
109
|
+
_izContext,
|
|
110
|
+
await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
|
|
111
|
+
{
|
|
112
|
+
awaitingStepId: awaitingStepId
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
_izContext.logger.debug("record awaitingSteps::", recordAwaitingSteps);
|
|
116
|
+
|
|
117
|
+
nextAwaitingAteps:
|
|
118
|
+
for (let listRecordAwaitingStep of recordAwaitingSteps.Items) {
|
|
119
|
+
|
|
120
|
+
_izContext.logger.debug("iterate RecordAwaitingStep:", listRecordAwaitingStep);
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
if (!await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
124
|
+
_izContext,
|
|
125
|
+
listRecordAwaitingStep.pendingStepId,
|
|
126
|
+
awaitingStepId
|
|
127
|
+
)) {
|
|
128
|
+
_izContext.logger.debug("!Waiting record form other graph::")
|
|
129
|
+
// **** add step of remove awaitingMultiplestep!! ??
|
|
130
|
+
continue nextAwaitingAteps
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
134
|
+
_izContext,
|
|
135
|
+
awaitingStepId,
|
|
136
|
+
listRecordAwaitingStep.pendingStepId,
|
|
137
|
+
);
|
|
138
|
+
_izContext.logger.debug("Remove awaitingStep finish")
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// seagame: problem about lambdaComplete is will missing errorsFound from request if have 2 request
|
|
142
|
+
// one send with errorsFound and one send without errorsFound
|
|
143
|
+
// this scenario can complete with or without errorsFound
|
|
144
|
+
let messageObject = {
|
|
145
|
+
objType: returnValue.objType,
|
|
146
|
+
objInstanceFull: returnValue.objInstanceFull,
|
|
147
|
+
errorsFound: errorsFound
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
|
|
151
|
+
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {})
|
|
152
|
+
|
|
153
|
+
let sendMessageOutCreateObjectComplete = {
|
|
154
|
+
Message: JSON.stringify(messageObject),
|
|
155
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
156
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "OutCreateObjectComplete")
|
|
157
|
+
};
|
|
158
|
+
_izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
|
|
159
|
+
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
returnValue: returnValue,
|
|
163
|
+
status: status,
|
|
164
|
+
errorsFound: errorsFound
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
} catch (err) {
|
|
168
|
+
throw (err)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 {
|
|
25
|
+
firstLetterLowerCase: lowerCase,
|
|
26
|
+
firstLetterUpperCase: upperCase,
|
|
27
|
+
firstLetterUpperCase,
|
|
28
|
+
} = require("../../../../../MainLibs/index.js").utils;
|
|
29
|
+
const {
|
|
30
|
+
DEFAULT_HANDLER_PER_ACTION,
|
|
31
|
+
SOURCE_PATH,
|
|
32
|
+
FUNCTION_NAME,
|
|
33
|
+
SAVE_FILE_NAME,
|
|
34
|
+
} = require("../../../../../MainLibs/index.js").consts;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* create data for dynamoDbYaml tempalte from objectSchema
|
|
38
|
+
* return array of dynamoDb data
|
|
39
|
+
* because one objectSchema can create multiple dynamoDb table
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} _izContext
|
|
42
|
+
* @param {String} saveFilePath
|
|
43
|
+
* @returns {Object[]} - data of multiple dynamoDb template
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
function data(_izContext, srcPath) {
|
|
47
|
+
let createUpdateNodeCompleteQueues = [];
|
|
48
|
+
const createCreateUpdatenodeCompleteQueueNames = [
|
|
49
|
+
{
|
|
50
|
+
queueName: upperCase(FUNCTION_NAME.createObjectComplete)
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
for (let createUpdateNodeCompleteQueueName of createCreateUpdatenodeCompleteQueueNames) {
|
|
54
|
+
createUpdateNodeCompleteQueues.push({
|
|
55
|
+
templatePath: templatePath,
|
|
56
|
+
templateData: createUpdateNodeCompleteQueueName,
|
|
57
|
+
setting: {
|
|
58
|
+
initialData: "Resource\n",
|
|
59
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
60
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
61
|
+
fileExtension: ".yml",
|
|
62
|
+
isAppend: true
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
return createUpdateNodeCompleteQueues
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = data
|