@izara_project/izara-market-library-service-schemas 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +6 -6
- package/src/GenerateCodeLibs/index.js +1 -0
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +65 -22
- package/src/MainLibs/index.js +2 -1
- package/src/MainLibs/src/Consts.js +485 -0
- package/src/MainLibs/src/GenerateCodeUtils.js +59 -0
- package/src/SourceManager/src/CreateSource.js +11 -1
- package/src/TemplateManager/src/FindData/mainFunction/data.js +3 -2
- package/src/TemplateManager/src/GenerateCode.js +1 -0
- package/src/TemplateManager/src/GenerateSchema.js +20 -5
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogical/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/attributeTree/objectSchema/data.js +23 -20
- package/src/TemplateManager/src/attributeTree/objectSchema/template.ejs +6 -5
- package/src/TemplateManager/src/attributeTree/relationshipSchema/data.js +169 -55
- package/src/TemplateManager/src/attributeTree/relationshipSchema/template.ejs +5 -38
- package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +2 -3
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +1 -1
- package/src/reStructure/GenerateCode.js +151 -0
- package/src/reStructure/TemplateConfig.js +31 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +162 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/template.ejs +14 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +31 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/templateYaml.ejs +10 -0
- package/src/reStructure/TemplateData/externalService/generateTemplateData.js +59 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +435 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/request.json +18 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +57 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +177 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/request.json +12 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +28 -0
- package/src/reStructure/TemplateData/findData/GetByStorage/getByDynamo.ejs +53 -0
- package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +100 -0
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +195 -0
- package/src/reStructure/TemplateData/findData/findDataYaml/template.ejs +14 -0
- package/src/reStructure/TemplateData/findData/generateTemplateData.js +65 -0
- package/src/reStructure/TemplateData/findData/handler/data.js +63 -0
- package/src/reStructure/TemplateData/findData/handler/template.ejs +140 -0
- package/src/reStructure/TemplateData/findData/mainFunction/data.js +297 -0
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +151 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/data.js +76 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/template.ejs +37 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/handler/data.js +46 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/handler/template.ejs +103 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/mainFunction/data.js +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/data.js +35 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/data.js +34 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +118 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +56 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +126 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +121 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +140 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +37 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +74 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +120 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +133 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +115 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +70 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +103 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +86 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +72 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/data.js +93 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateAsyncHandler.ejs +110 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateSyncHandler.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/hookLogic/data.js +43 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/data.js +65 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/template.ejs +7 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/data.js +72 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/functionYaml/data.js +102 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/functionYaml/template.ejs +27 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/template.ejs +120 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/template.ejs +164 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/sqs/data.js +65 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/sqs/template.ejs +53 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +131 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +126 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +254 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/queue/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/queue/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrDsq/data.js +87 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml → reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml}/HdrDsq/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +127 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml → reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3}/template.ejs +11 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerDsq/data.js +45 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerDsq/template.ejs +151 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +58 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +68 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +58 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +392 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/data.js +77 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/dsqTemplatePath.ejs +32 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +51 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/template.ejs +13 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +42 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +137 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +73 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +29 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +54 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +68 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +62 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +62 -0
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +210 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/data.js +101 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/template.ejs +43 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/data.js +93 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateAsyncHandler.ejs +110 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateSyncHandler.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/hookLogic/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/data.js +66 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/template.ejs +30 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/data.js +124 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +276 -0
- package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +58 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +172 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/data.js +65 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +170 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/data.js +73 -0
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +130 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/data.js +66 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +93 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +62 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-out/data.js +69 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +124 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +126 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js → reStructure/TemplateData/perActionComplete/get/handler/data.js} +20 -14
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/data.js +52 -0
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +130 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns → reStructure/TemplateData/perActionComplete/get/sns-in-sqs}/data.js +12 -12
- package/src/reStructure/TemplateData/perActionComplete/get/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/get/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +105 -0
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionComplete/update/handler/data.js +65 -0
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/data.js +58 -0
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/data.js +66 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +73 -0
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +132 -0
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionEndpoint/generateTemplateData.js +101 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/data.js +93 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +76 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/data.js +95 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +127 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/data.js +88 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/template.ejs +81 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/data.js +94 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +130 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/data.js +75 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +141 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +55 -0
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +55 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction → reStructure/TemplateData/perActionEndpoint/libs}/data.js +25 -13
- package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +46 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/data.js +74 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/request.json +0 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +629 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/data.js +74 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +192 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/data.js +76 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/request.json +5 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +265 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/testParam.json +5 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/data.js +70 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/request.json +0 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +351 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/data.js +198 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/request.json +14 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/data.js +207 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/request.json +19 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/data.js +189 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/example req.js +15 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/request.json +14 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/data.js +208 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/request.json +19 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/data.js +170 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/request.json +19 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs → reStructure/TemplateData/perActionEndpoint/yaml/wbs}/template.ejs +2 -3
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +59 -0
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/template.ejs +10 -0
- package/src/reStructure/TemplateData/processLogical/generateTemplateData.js +57 -0
- package/src/reStructure/TemplateData/processLogical/handler/data.js +50 -0
- package/src/reStructure/TemplateData/processLogical/handler/template.ejs +129 -0
- package/src/reStructure/TemplateData/processLogical/mainFunction/data.js +47 -0
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +429 -0
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +160 -0
- package/src/reStructure/TemplateData/processLogical/yaml/template.ejs +12 -0
- package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sns-out → reStructure/TemplateData/processLogicalPagination/DsqYaml}/data.js +16 -13
- package/src/reStructure/TemplateData/processLogicalPagination/DsqYaml/template.ejs +32 -0
- package/src/reStructure/TemplateData/processLogicalPagination/generateTemplateData.js +64 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +163 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +146 -0
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/data.js +48 -0
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/template.ejs +212 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +154 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +12 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +157 -0
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +12 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +98 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +97 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +110 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/data.js +57 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +138 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq → reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq}/data.js +18 -20
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +126 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs → reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs}/data.js +16 -16
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +163 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +380 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs → reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml}/data.js +48 -29
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +141 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +98 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +97 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +111 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +57 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +138 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +58 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +126 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +162 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +337 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/{TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq → reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml}/data.js +49 -30
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +140 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +72 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +238 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +120 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +131 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +124 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +135 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +140 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +75 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +184 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/request.json +5 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +145 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +74 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +163 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +72 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/request.json +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +340 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +92 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +110 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +61 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +127 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +63 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/request.json +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +143 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/template.ejs +46 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +70 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/resourceYaml/CreateSourceData.js +73 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +146 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +178 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/request.json +7 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +31 -0
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +99 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +96 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/request.json +4 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +108 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +88 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +75 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/request.json +3 -0
- package/src/reStructure/TemplateData/resourceYaml/sns-out/template.ejs +10 -0
- package/src/reStructure/test.bash +192 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +0 -94
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +0 -192
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +0 -299
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +0 -155
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +0 -163
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/data.js +0 -61
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +0 -145
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/dynamoDb/data.js +0 -120
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/sns-sqs/data.js +0 -75
- package/src/TemplateManager/src/reStructureExample/GenerateCodeTest.js +0 -31
- package/src/TemplateManager/src/reStructureExample/TemplateConfig.js +0 -11
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +0 -1
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +0 -5
- /package/src/{TemplateManager/src/reStructureExample/TemplateData/perAction → reStructure/TemplateData/flowSchema/components/schema/inProcess/mainFunction}/template.ejs +0 -0
- /package/src/{TemplateManager/src/reStructureExample/TemplateData/perAction/data.js → reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/template.ejs} +0 -0
- /package/src/{TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns/template.ejs → reStructure/TemplateData/flowSchema/components/upload/hook/queue/sqsTemplate.ejs} +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
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 { SOURCE_PATH, FUNCTION_NAME, ADD_ON_DATA_STRUCTURE_TYPE } = require("../../../../MainLibs/src/Consts");
|
|
23
|
+
// const { firstLetterUpperCase: upperCase } = require("../../../../MainLibs/index.js").utils;
|
|
24
|
+
const {
|
|
25
|
+
firstLetterLowerCase: lowerCase,
|
|
26
|
+
firstLetterUpperCase: upperCase,
|
|
27
|
+
} = require("../../../../MainLibs/index.js").utils;
|
|
28
|
+
const {
|
|
29
|
+
createIamRole,
|
|
30
|
+
resourceNames,
|
|
31
|
+
RESOURCE_CLASSES,
|
|
32
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
33
|
+
SQS_RESOURCE,
|
|
34
|
+
SOURCE_PATH,
|
|
35
|
+
SAVE_FILE_NAME,
|
|
36
|
+
FUNCTION_NAME,
|
|
37
|
+
shortNameHandler,
|
|
38
|
+
HANDLER,
|
|
39
|
+
ADD_ON_DATA_STRUCTURE_TYPE
|
|
40
|
+
} = require("../../../../MainLibs/src/Consts");
|
|
41
|
+
|
|
42
|
+
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
43
|
+
const STORAGE_TYPES = serviceSchemas.consts.STORAGE_TYPES;
|
|
44
|
+
const getObjectSchemas = serviceSchemas.getObjectSchema;
|
|
45
|
+
const { getUsedFieldNamesOfIdentifiers } = serviceSchemas.utils;
|
|
46
|
+
|
|
47
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
48
|
+
const getByDynamoTemplate = path.join(__dirname, "../GetByStorage/getByDynamo.ejs")
|
|
49
|
+
const getByGraphTemplate = path.join(__dirname, "../GetByStorage/getByGraph.ejs")
|
|
50
|
+
|
|
51
|
+
const NoRetryError = require("@izara_project/izara-core-library-core/src/NoRetryError");
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* receive objectSchema
|
|
55
|
+
* create data for FindDataMain template
|
|
56
|
+
*
|
|
57
|
+
* @param {Object} objectSchema
|
|
58
|
+
* @return {{ templatePath, templateData, setting } }
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
async function data(_izContext, srcPath) {
|
|
62
|
+
|
|
63
|
+
let schemaPath = path.join(srcPath, "schemas")
|
|
64
|
+
let datas = [];
|
|
65
|
+
|
|
66
|
+
// 1. get objectTypes for check objType param
|
|
67
|
+
let getObjectTypes = await getObjectSchemas.getAllLocalObjectSchemas(_izContext, schemaPath);
|
|
68
|
+
// console.log(("getObjectTypes: ", getObjectTypes.fieldLookup)
|
|
69
|
+
|
|
70
|
+
for (const objectType of Object.keys(getObjectTypes.fieldLookup)) {
|
|
71
|
+
// console.log(("objectType: ", objectType)
|
|
72
|
+
|
|
73
|
+
// 2. get local object schema
|
|
74
|
+
let objectSchemaRecord = await getObjectSchemas.getLocalObjectSchemasWithHierarchy(
|
|
75
|
+
_izContext,
|
|
76
|
+
objectType,
|
|
77
|
+
schemaPath
|
|
78
|
+
);
|
|
79
|
+
// console.log("objectSchemaRecord: ", objectSchemaRecord)
|
|
80
|
+
|
|
81
|
+
let objectSchema = objectSchemaRecord.records[0];
|
|
82
|
+
// console.log(("objectSchema: ", objectSchema)
|
|
83
|
+
|
|
84
|
+
const identifiersNames = getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers);
|
|
85
|
+
_izContext.logger.debug("identifiersNames: ", identifiersNames);
|
|
86
|
+
|
|
87
|
+
let storageResources = objectSchema.storageResources;
|
|
88
|
+
let fieldNames = objectSchema.fieldNames; // object
|
|
89
|
+
let fieldNameDatas = [];
|
|
90
|
+
|
|
91
|
+
// loop for each main fieldNames
|
|
92
|
+
Object.entries(fieldNames).map(([field, schemas]) => {
|
|
93
|
+
// console.log(("field: ", field)
|
|
94
|
+
// console.log(("schemas: ", schemas)
|
|
95
|
+
|
|
96
|
+
let getInIdentifiers = false;
|
|
97
|
+
|
|
98
|
+
for (const identifierName of identifiersNames) {
|
|
99
|
+
if (field === identifierName) {
|
|
100
|
+
getInIdentifiers = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
//* set field as key of object
|
|
105
|
+
//* use schemas for find storageType, graphServiceTag, tableName
|
|
106
|
+
|
|
107
|
+
// check type (use only string and number)
|
|
108
|
+
if (schemas.type === "string" || schemas.type === "number") {
|
|
109
|
+
|
|
110
|
+
let collectStorageDetail = {};
|
|
111
|
+
let storageResourceTags = schemas.storageResourceTags; // array
|
|
112
|
+
|
|
113
|
+
for (const storageResourceTag of storageResourceTags) {
|
|
114
|
+
// console.log(("storageResources: ", storageResources)
|
|
115
|
+
|
|
116
|
+
Object.entries(storageResources).map(([storageTag, storageDetail]) => {
|
|
117
|
+
|
|
118
|
+
if (storageResourceTag === storageTag) {
|
|
119
|
+
// console.log(("storageTag: ", storageTag)
|
|
120
|
+
// console.log(("storageDetail: ", storageDetail)
|
|
121
|
+
|
|
122
|
+
if (storageDetail.storageType === STORAGE_TYPES.graph) {
|
|
123
|
+
|
|
124
|
+
if (collectStorageDetail.hasOwnProperty(STORAGE_TYPES.graph)) {
|
|
125
|
+
// console.log(("collectStorageDetail already have graph storageType")
|
|
126
|
+
} else {
|
|
127
|
+
Object.assign(collectStorageDetail,
|
|
128
|
+
{
|
|
129
|
+
[storageDetail.storageType]: {
|
|
130
|
+
graphServerTag: storageDetail.graphServerTag,
|
|
131
|
+
getInIdentifiers: getInIdentifiers
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
} else if (storageDetail.storageType === STORAGE_TYPES.dynamoDB) {
|
|
137
|
+
|
|
138
|
+
if (collectStorageDetail.hasOwnProperty(STORAGE_TYPES.dynamoDB)) {
|
|
139
|
+
// console.log(("collectStorageDetail already have dynamoDB storageType")
|
|
140
|
+
} else {
|
|
141
|
+
Object.assign(collectStorageDetail,
|
|
142
|
+
{
|
|
143
|
+
[storageDetail.storageType]: {
|
|
144
|
+
tableName: storageDetail.tableName
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// console.log(("collectStorageDetail: ", collectStorageDetail)
|
|
155
|
+
|
|
156
|
+
//* Q: chooooooose get data from dynamoDB or graph if this fieldName have both of dynamoDB and graph storageTypes ???
|
|
157
|
+
//* A: choose dynamoDB
|
|
158
|
+
// collectStorageDetail: {
|
|
159
|
+
// graph: { graphServerTag: 'GraphHandler' },
|
|
160
|
+
// dynamoDB: { tableName: 'NotificationHello' }
|
|
161
|
+
// }
|
|
162
|
+
if (collectStorageDetail.hasOwnProperty(STORAGE_TYPES.graph) && collectStorageDetail.hasOwnProperty(STORAGE_TYPES.dynamoDB)) {
|
|
163
|
+
delete collectStorageDetail[STORAGE_TYPES.graph];
|
|
164
|
+
// console.log(("collectStorageDetail after delete graph: ", collectStorageDetail)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
fieldNameDatas.push({ [field]: collectStorageDetail })
|
|
168
|
+
// console.log(("fieldNameDatasMain: ", fieldNameDatas)
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
// fieldName in versionedData
|
|
173
|
+
if (objectSchema.hasOwnProperty("addOnDataStructure")) { // array
|
|
174
|
+
// console.log(("objectSchemas have addOnDataStructure: ", objectSchema.addOnDataStructure)
|
|
175
|
+
for (const versionedData of objectSchema.addOnDataStructure) { // object // loop versionedData
|
|
176
|
+
// console.log("versionedData: ", versionedData)
|
|
177
|
+
if (versionedData === ADD_ON_DATA_STRUCTURE_TYPE.versionedData) {
|
|
178
|
+
|
|
179
|
+
let versionedStorageDetail = {};
|
|
180
|
+
let versioendStorageResourceTag = versionedData.storageResourceTag;
|
|
181
|
+
let versionedFieldNames = versionedData.fieldNames; // array
|
|
182
|
+
|
|
183
|
+
Object.entries(storageResources).map(([storageTag, storageDetail]) => {
|
|
184
|
+
|
|
185
|
+
if (versioendStorageResourceTag === storageTag) {
|
|
186
|
+
if (storageDetail.storageType === STORAGE_TYPES.graph) {
|
|
187
|
+
versionedStorageDetail = {
|
|
188
|
+
[storageDetail.storageType]: {
|
|
189
|
+
graphServerTag: storageDetail.graphServerTag,
|
|
190
|
+
versionedDataLabel: versionedData.versionedDataLabel
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
throw new NoRetryError(`storageType of versionedData isn't graph`)
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
// console.log(("versionedStorageDetail: ", versionedStorageDetail)
|
|
199
|
+
|
|
200
|
+
for (const versionedFieldName of versionedFieldNames) { // object // loop versionedFieldNames
|
|
201
|
+
|
|
202
|
+
if (versionedFieldName.type === "string" || versionedFieldName.type === "number") {
|
|
203
|
+
fieldNameDatas.push({ [versionedFieldName.fieldName]: versionedStorageDetail })
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
} // end loop versionedFieldNames
|
|
207
|
+
|
|
208
|
+
} // end loop versionedData
|
|
209
|
+
//fieldNameDatas.push(collectVersionedFieldNames)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// console.log(("fieldNameDatas: ", fieldNameDatas)
|
|
213
|
+
|
|
214
|
+
let fieldNameDatasPerObjectType = {
|
|
215
|
+
objectType: objectType,
|
|
216
|
+
fieldNames: fieldNameDatas
|
|
217
|
+
};
|
|
218
|
+
// console.log(("fieldNameDatasPerObjectType: ", fieldNameDatasPerObjectType)
|
|
219
|
+
|
|
220
|
+
datas.push(fieldNameDatasPerObjectType)
|
|
221
|
+
} // end loop objectType
|
|
222
|
+
|
|
223
|
+
// console.log(("datas: ", datas)
|
|
224
|
+
|
|
225
|
+
// fieldNameDatas: [
|
|
226
|
+
// { notificationId: { graph: [Object], dynamoDB: [Object] } },
|
|
227
|
+
// { notificationIdHello: { dynamoDB: {tableName: "NotificationHello"}} },
|
|
228
|
+
// { notificationName: { graph: {graphServerTag: 'GraphHandler', versionedDataLabel: 'notificationSettings' }},
|
|
229
|
+
// { notificationNameeeeeeeeeee: { graph: {graphServerTag: 'GraphHandler', versionedDataLabel: 'notificationSettingssssssssss'}}
|
|
230
|
+
// ]
|
|
231
|
+
|
|
232
|
+
// fieldNameDatasPerObjectType: {
|
|
233
|
+
// objectType: 'notification',
|
|
234
|
+
// fieldNames: [
|
|
235
|
+
// { notificationId: [Object] },
|
|
236
|
+
// { notificationIdHello: [Object] },
|
|
237
|
+
// { notificationName: [Object]},
|
|
238
|
+
// { notificationNameeeeeeeeeee: [Object] }
|
|
239
|
+
// ]
|
|
240
|
+
// }
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
templatePath: templatePath,
|
|
244
|
+
templateData: {
|
|
245
|
+
functionName: upperCase(FUNCTION_NAME.findData),
|
|
246
|
+
datas: datas,
|
|
247
|
+
getByDynamoTemplate: getByDynamoTemplate,
|
|
248
|
+
getByGraphTemplate: getByGraphTemplate,
|
|
249
|
+
storageDynamo: STORAGE_TYPES.dynamoDB,
|
|
250
|
+
storageTypeGraph: STORAGE_TYPES.graph,
|
|
251
|
+
},
|
|
252
|
+
setting: {
|
|
253
|
+
savePath: path.join(srcPath, SOURCE_PATH.findData),
|
|
254
|
+
saveFileName: `FindData_Main`,
|
|
255
|
+
fileExtension: '.js',
|
|
256
|
+
isAppend: false
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// datas: [
|
|
261
|
+
// {
|
|
262
|
+
// objectType: 'consolidated',
|
|
263
|
+
// fieldNames: [ {notificationGroupId: [Object], time: [Object]}]
|
|
264
|
+
// },
|
|
265
|
+
// {
|
|
266
|
+
// objectType: 'notificationGroup',
|
|
267
|
+
// fieldNames: [
|
|
268
|
+
// {notificationGroupId: [Object]},
|
|
269
|
+
// {notificationGroupName: [Object]},
|
|
270
|
+
// {consolidatedType: [Object]},
|
|
271
|
+
// {consolidatedFrequency: [Object]},
|
|
272
|
+
// {consolidatedNextSendDue: [Object]}
|
|
273
|
+
// ]
|
|
274
|
+
// },
|
|
275
|
+
// {
|
|
276
|
+
// objectType: 'notification',
|
|
277
|
+
// fieldNames: [
|
|
278
|
+
// {notificationId: [Object]},
|
|
279
|
+
// {notificationIdHello: [Object]},
|
|
280
|
+
// {notificationName: [Object]},
|
|
281
|
+
// {notificationNameeeeeeeeeee: [Object]}
|
|
282
|
+
// ]
|
|
283
|
+
// },
|
|
284
|
+
// {
|
|
285
|
+
// objectType: 'notificationTrigger',
|
|
286
|
+
// fieldNames: [
|
|
287
|
+
// {notificationTriggerId: [Object]},
|
|
288
|
+
// {propertyName: [Object]},
|
|
289
|
+
// {valueType: [Object]},
|
|
290
|
+
// {valueString: [Object]},
|
|
291
|
+
// {valueNumber: [Object]}
|
|
292
|
+
// ]
|
|
293
|
+
// }
|
|
294
|
+
// ]
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
module.exports = data;
|
|
@@ -0,0 +1,151 @@
|
|
|
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 findDataSharedLib = izaraShared.findDataSharedLib;
|
|
22
|
+
const graphSharedLib = izaraShared.graphSharedLib;
|
|
23
|
+
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
24
|
+
|
|
25
|
+
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
26
|
+
const serviceConfig = serviceSchemas.serviceConfig;
|
|
27
|
+
const identifierObj = serviceSchemas.identifiersObject
|
|
28
|
+
|
|
29
|
+
//(<additionalModule>)
|
|
30
|
+
//(</additionalModule>)
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* triggered from searchResult for each requiredData field per one identifiers
|
|
34
|
+
* @param {Object} _izContext
|
|
35
|
+
* @param {string} fieldName
|
|
36
|
+
* @param {Object} objType
|
|
37
|
+
* @param {Object} identifiers
|
|
38
|
+
* @param {Object} requestProperties
|
|
39
|
+
*
|
|
40
|
+
* @returns {object} description of return value
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
exports.findData = async (
|
|
44
|
+
_izContext,
|
|
45
|
+
fieldName,
|
|
46
|
+
objType,
|
|
47
|
+
identifiers,
|
|
48
|
+
requestProperties,
|
|
49
|
+
callingFlow,
|
|
50
|
+
//(<additionalParams>)
|
|
51
|
+
//(</additionalParams>)
|
|
52
|
+
) => {
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
|
|
56
|
+
_izContext.logger.debug('----- findData event params -----', {
|
|
57
|
+
fieldName: fieldName,
|
|
58
|
+
objType: objType,
|
|
59
|
+
identifiers: identifiers,
|
|
60
|
+
requestProperties: requestProperties,
|
|
61
|
+
callingFlow: callingFlow
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// removeAttributes on expired
|
|
65
|
+
let removeAttributes = [];
|
|
66
|
+
//(<removeAttributes>)
|
|
67
|
+
//(</removeAttributes>)
|
|
68
|
+
|
|
69
|
+
// Check/create FindDataMain status
|
|
70
|
+
let [findDataMainStatus, findDataId, findDataMain] = await findDataSharedLib.checkFindDataMainStatus(
|
|
71
|
+
_izContext,
|
|
72
|
+
fieldName,
|
|
73
|
+
objType,
|
|
74
|
+
identifiers,
|
|
75
|
+
requestProperties,
|
|
76
|
+
callingFlow,
|
|
77
|
+
removeAttributes
|
|
78
|
+
);
|
|
79
|
+
_izContext.logger.debug("result after checkFindDataMainStatus is", {
|
|
80
|
+
findDataMainStatus: findDataMainStatus,
|
|
81
|
+
findDataId: findDataId,
|
|
82
|
+
findDataMain: findDataMain
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
if (findDataMainStatus != "process") {
|
|
86
|
+
_izContext.logger.debug(`findDataMainStatus status isn't process :${findDataMainStatus}`)
|
|
87
|
+
return; // stop process
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
let errorsFound = [];
|
|
91
|
+
|
|
92
|
+
let standardErrorParams = [
|
|
93
|
+
_izContext,
|
|
94
|
+
fieldName,
|
|
95
|
+
objType,
|
|
96
|
+
identifiers,
|
|
97
|
+
requestProperties,
|
|
98
|
+
null,
|
|
99
|
+
"error"
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
<% for (let idx = 0; idx < datas.length; idx++) { _%>
|
|
103
|
+
<% let objectType = datas[idx].objectType _%>
|
|
104
|
+
if (objType.objectType === <%- JSON.stringify(objectType) %>) {
|
|
105
|
+
_izContext.logger.debug("objectType: ", objType.objectType)
|
|
106
|
+
|
|
107
|
+
<% let fieldNames = datas[idx].fieldNames _%>
|
|
108
|
+
<% for (let idx = 0; idx < fieldNames.length; idx++) { _%>
|
|
109
|
+
<% let fieldName = Object.keys(fieldNames[idx])[0] _%>
|
|
110
|
+
<% let storageDetails = (Object.values(fieldNames[idx])[0]) _%>
|
|
111
|
+
if (fieldName == <%- JSON.stringify(fieldName) %>) {
|
|
112
|
+
_izContext.logger.debug("fieldName: ", fieldName)
|
|
113
|
+
|
|
114
|
+
<% Object.entries(storageDetails).map(([storage, details]) => { _%>
|
|
115
|
+
<% let versionedDataLabel = [] _%>
|
|
116
|
+
<% if (storage === storageTypeGraph && details.hasOwnProperty("versionedDataLabel")){ versionedDataLabel.push(details.versionedDataLabel) } _%>
|
|
117
|
+
<% if (storage === storageDynamo){ %><%- include(getByDynamoTemplate, {tableName: details.tableName, fieldName: fieldName, objectType: objectType}) %><% } _%>
|
|
118
|
+
<% if (storage === storageTypeGraph){ %><%- include(getByGraphTemplate, {graphServerTag: details.graphServerTag, versionedDataLabel: versionedDataLabel, fieldName: fieldName, objectType: objectType, getInIdentifiers: details.getInIdentifiers}) %><% } _%>
|
|
119
|
+
<% }) _%>
|
|
120
|
+
}<% if (idx + 1 == fieldNames.length) { %>
|
|
121
|
+
<%- createAdditionalFieldNamesTag(objectType) %>
|
|
122
|
+
<% } _%>
|
|
123
|
+
else <% } _%> {
|
|
124
|
+
errorsFound.push("unrecognised fieldName")
|
|
125
|
+
standardErrorParams.push(errorsFound)
|
|
126
|
+
await findDataSharedLib.completeFindDataMain(...standardErrorParams);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
} <% if (idx + 1 == datas.length) { %>
|
|
130
|
+
//(<addtionalObjectType>)
|
|
131
|
+
//(</addtionalObjectType>)
|
|
132
|
+
<% } _%>
|
|
133
|
+
else<% } %> {
|
|
134
|
+
errorsFound.push("unrecognised objectType")
|
|
135
|
+
standardErrorParams.push(errorsFound)
|
|
136
|
+
await findDataSharedLib.completeFindDataMain(...standardErrorParams);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return "Function FindData Finish";
|
|
141
|
+
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_izContext.logger.error('error FindDataMain: ', err)
|
|
144
|
+
throw (err)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
<%_ function createAdditionalFieldNamesTag(objectType) {
|
|
149
|
+
return `//(<additional${objectType}FieldNames>)
|
|
150
|
+
//(</additional${objectType}FieldNames>)`
|
|
151
|
+
} _%>
|
package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/data.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
|
|
21
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
22
|
+
const { SOURCE_PATH, defaultIamRolePerAction, shortNameHandler, SAVE_FILE_NAME, createIamRole, RESOURCE_CLASSES, SNS_RESOURCE, resourceNames, DYNAMO_RESOURCE } = require('../../../../libs/Consts');
|
|
23
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function data(_izContext, flowSchema, srcPath) {
|
|
27
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
31
|
+
let functionName = "InProcessWebSocket";
|
|
32
|
+
let handlerType = "HdrWbs"
|
|
33
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
34
|
+
let functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(handlerType))
|
|
35
|
+
|
|
36
|
+
additionalResourcePermission.push(
|
|
37
|
+
createIamRole(
|
|
38
|
+
{
|
|
39
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
40
|
+
},
|
|
41
|
+
[
|
|
42
|
+
resourceNames(RESOURCE_CLASSES.sns, `InProcess${flowSchema.flowTag}`)
|
|
43
|
+
]
|
|
44
|
+
),
|
|
45
|
+
createIamRole(
|
|
46
|
+
{
|
|
47
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
48
|
+
DYNAMO_RESOURCE.putItem,
|
|
49
|
+
DYNAMO_RESOURCE.deleteItem
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "WebSocketTask")
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
templatePath: templatePath,
|
|
58
|
+
templateData: {
|
|
59
|
+
functionName,
|
|
60
|
+
handlerType,
|
|
61
|
+
functionNameConfig,
|
|
62
|
+
additionalResourcePermission,
|
|
63
|
+
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
64
|
+
route: flowSchema.flowTag
|
|
65
|
+
},
|
|
66
|
+
setting: {
|
|
67
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
68
|
+
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
69
|
+
fileExtension: '.yml',
|
|
70
|
+
isAppend: true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
module.exports = data;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<%_ const join = require('path').join; _%>
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
|
+
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
events:
|
|
6
|
+
- websocket:
|
|
7
|
+
route: $connect
|
|
8
|
+
- websocket:
|
|
9
|
+
route: $disconnect
|
|
10
|
+
- websocket:
|
|
11
|
+
route: $default
|
|
12
|
+
- websocket:
|
|
13
|
+
route: <%- route %>
|
|
14
|
+
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
15
|
+
# identifierResource: 'route.request.header.Auth'
|
|
16
|
+
iamRoleStatements:
|
|
17
|
+
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
18
|
+
- Effect: <%- resourcePermission.effect %>
|
|
19
|
+
Action:
|
|
20
|
+
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
21
|
+
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
22
|
+
- <%- resourcePerAction %>:<%- permission %>
|
|
23
|
+
<%_}) _%>
|
|
24
|
+
<%_ }) _%>
|
|
25
|
+
Resource:
|
|
26
|
+
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
27
|
+
- <%- resource %>
|
|
28
|
+
<%_ }) _%>
|
|
29
|
+
<%_}) _%>
|
|
30
|
+
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
31
|
+
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
32
|
+
<%_ function firstLetterUpperCase(text){
|
|
33
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
34
|
+
} _%>
|
|
35
|
+
<%_ function firstLetterLowerCase(str) {
|
|
36
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
37
|
+
} _%>
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
|
|
21
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
|
|
22
|
+
const { SOURCE_PATH } = require('../../../../libs/Consts');
|
|
23
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
24
|
+
|
|
25
|
+
function data(_izContext, srcPath) {
|
|
26
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function createSourceParams(_izContext, srcPath) {
|
|
30
|
+
let functionName = "InProcessWebSocket";
|
|
31
|
+
let handlerType = "HdrWbs";
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
templatePath: templatePath,
|
|
35
|
+
templateData: {},
|
|
36
|
+
setting: {
|
|
37
|
+
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
38
|
+
saveFileName: upperCase(functionName) + upperCase(handlerType),
|
|
39
|
+
fileExtension: ".js",
|
|
40
|
+
isAppend: true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
module.exports = data;
|