@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
package/index.js
CHANGED
|
@@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
module.exports = {
|
|
22
21
|
templateMgr: require('./src/TemplateManager'),
|
|
23
22
|
sourceMgr: require('./src/SourceManager'),
|
|
24
|
-
generateCodeLibs: require('./src/GenerateCodeLibs')
|
|
23
|
+
generateCodeLibs: require('./src/GenerateCodeLibs'),
|
|
24
|
+
generateCode: require('./src/reStructure/GenerateCode'),
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-market-library-service-schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "Schemas for Izara Market project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
"license": "AGPL-3.0-or-later",
|
|
15
15
|
"homepage": "https://bitbucket.org/izara-market-libraries/izara-market-library-service-schemas/src/master/README.md",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"jest": "^
|
|
17
|
+
"jest": "^29.7.0"
|
|
18
18
|
},
|
|
19
19
|
"jest": {
|
|
20
20
|
"testEnvironment": "node"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@izara_project/izara-core-library-core": "^1.0.
|
|
23
|
+
"@izara_project/izara-core-library-core": "^1.0.16",
|
|
24
24
|
"@izara_project/izara-core-library-external-request": "^1.0.17",
|
|
25
|
-
"@izara_project/izara-core-library-service-schemas": "^1.0.
|
|
26
|
-
"@izara_project/izara-shared": "^1.0.
|
|
25
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.44",
|
|
26
|
+
"@izara_project/izara-shared": "^1.0.125",
|
|
27
27
|
"ejs": "^3.1.10",
|
|
28
|
-
"js-beautify": "^1.15.
|
|
28
|
+
"js-beautify": "^1.15.4",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
30
|
"object-hash": "^3.0.0",
|
|
31
31
|
"yaml": "^2.7.0"
|
|
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
// contain functions that use with generated code in each services
|
|
21
21
|
console.log("./src/GenerateCodeLibs")
|
|
22
22
|
module.exports = {
|
|
23
|
+
consts: require('./src/Consts'),
|
|
23
24
|
generateCodeLibs: require("./src/GenerateCodeLibs"),
|
|
24
25
|
translateIdsLibs: require('./src/TranslateIdsLibs'),
|
|
25
26
|
}
|
|
@@ -936,22 +936,31 @@ function createFieldForUpdateDynamoDb(_izContext, objectSchema, dynamoDataDetail
|
|
|
936
936
|
|
|
937
937
|
/**
|
|
938
938
|
*
|
|
939
|
-
* @param {Object}
|
|
940
|
-
* @param {String}
|
|
941
|
-
* @param {String}
|
|
942
|
-
* @param {
|
|
943
|
-
* @param {String}
|
|
944
|
-
* @param {
|
|
939
|
+
* @param {Object} from
|
|
940
|
+
* @param {String} from.objectType
|
|
941
|
+
* @param {String} from.serviceTag
|
|
942
|
+
* @param {String} from.linkType
|
|
943
|
+
* @param {String} from.requiredOnCreate
|
|
944
|
+
* @param {Object} to
|
|
945
|
+
* @param {String} to.objectType
|
|
946
|
+
* @param {String} to.serviceTag
|
|
947
|
+
* @param {String} to.linkType
|
|
948
|
+
* @param {String} to.requiredOnCreate
|
|
945
949
|
* @param {Object} storageResources
|
|
950
|
+
* @param {Boolean} topLevelParent
|
|
946
951
|
*/
|
|
947
|
-
function
|
|
948
|
-
validateObjType(
|
|
949
|
-
validateObjType(
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
952
|
+
function createBasicRelationshipsProperties(from, to, storageResources, baseDirection, topLevelParent = false) {
|
|
953
|
+
validateObjType({ objectType: from.objectType, serviceTag: from.serviceTag });
|
|
954
|
+
validateObjType({ objectType: to.objectType, serviceTag: to.serviceTag });
|
|
955
|
+
|
|
956
|
+
let otherDirection;
|
|
957
|
+
if (baseDirection === "to") {
|
|
958
|
+
otherDirection = "from"
|
|
959
|
+
} else if (baseDirection === "from") {
|
|
960
|
+
otherDirection = "to"
|
|
953
961
|
}
|
|
954
|
-
|
|
962
|
+
|
|
963
|
+
let relationshipProperties = {
|
|
955
964
|
fieldNames: {
|
|
956
965
|
originTimeStamp: {
|
|
957
966
|
type: 'number',
|
|
@@ -966,21 +975,55 @@ function createLinksObjectRelationshipAttributeTree(fromObjType, toObjType, stor
|
|
|
966
975
|
storageResources: storageResources,
|
|
967
976
|
links: [
|
|
968
977
|
{
|
|
969
|
-
|
|
978
|
+
storageResourceTags: Object.keys(storageResources),
|
|
970
979
|
from: {
|
|
971
|
-
objType:
|
|
972
|
-
|
|
973
|
-
|
|
980
|
+
objType: {
|
|
981
|
+
objectType: from.objectType,
|
|
982
|
+
serviceTag: from.serviceTag
|
|
983
|
+
},
|
|
984
|
+
linkType: from.linkType,
|
|
985
|
+
direction: baseDirection,
|
|
986
|
+
requiredOnCreate: from.requiredOnCreate
|
|
974
987
|
},
|
|
975
988
|
to: {
|
|
976
|
-
objType:
|
|
977
|
-
|
|
989
|
+
objType: {
|
|
990
|
+
objectType: to.objectType,
|
|
991
|
+
serviceTag: to.serviceTag
|
|
992
|
+
},
|
|
993
|
+
linkType: to.linkType,
|
|
994
|
+
direction: otherDirection,
|
|
995
|
+
requiredOnCreate: to.requiredOnCreate
|
|
978
996
|
}
|
|
979
997
|
}
|
|
980
|
-
]
|
|
981
|
-
|
|
998
|
+
],
|
|
999
|
+
}
|
|
982
1000
|
|
|
1001
|
+
if (topLevelParent === true) {
|
|
1002
|
+
relationshipProperties.links.push(
|
|
1003
|
+
{
|
|
1004
|
+
storageResourceTags: Object.keys(storageResources),
|
|
1005
|
+
from: {
|
|
1006
|
+
objType: {
|
|
1007
|
+
serviceTag: to.serviceTag,
|
|
1008
|
+
objectType: to.objectType
|
|
1009
|
+
},
|
|
1010
|
+
linkType: "one",
|
|
1011
|
+
direction: "from",
|
|
1012
|
+
requiredOnCreate: false
|
|
1013
|
+
},
|
|
1014
|
+
to: {
|
|
1015
|
+
objType: {
|
|
1016
|
+
serviceTag: to.serviceTag,
|
|
1017
|
+
objectType: to.objectType
|
|
1018
|
+
},
|
|
1019
|
+
linkType: "many",
|
|
1020
|
+
direction: "to",
|
|
1021
|
+
requiredOnCreate: false
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
983
1025
|
}
|
|
1026
|
+
return relationshipProperties
|
|
984
1027
|
}
|
|
985
1028
|
|
|
986
1029
|
module.exports = {
|
|
@@ -1001,7 +1044,7 @@ module.exports = {
|
|
|
1001
1044
|
createDeleteDataDetail,
|
|
1002
1045
|
|
|
1003
1046
|
createFieldForUpdateDynamoDb,
|
|
1004
|
-
|
|
1047
|
+
createBasicRelationshipsProperties
|
|
1005
1048
|
}
|
|
1006
1049
|
|
|
1007
1050
|
|
package/src/MainLibs/index.js
CHANGED
|
@@ -20,5 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
// MainLibs use for contain shared logic and constant
|
|
21
21
|
module.exports = {
|
|
22
22
|
consts: require('./src/Consts'),
|
|
23
|
-
utils: require('./src/Utils')
|
|
23
|
+
utils: require('./src/Utils'),
|
|
24
|
+
generateCodeUtils: require('./src/GenerateCodeUtils'),
|
|
24
25
|
};
|
|
@@ -0,0 +1,485 @@
|
|
|
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 {
|
|
21
|
+
HANDLER,
|
|
22
|
+
ACTIONS,
|
|
23
|
+
STORAGE_TYPES
|
|
24
|
+
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
25
|
+
|
|
26
|
+
const { firstLetterUpperCase: upperCase } = require("./Utils")
|
|
27
|
+
|
|
28
|
+
const { getGraphServiceNameFromGraphServerTagWithCache, getGraphServiceTagWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig');
|
|
29
|
+
|
|
30
|
+
const DEFAULT_HANDLER_PER_ACTION = {
|
|
31
|
+
[ACTIONS.create]: [HANDLER.hdrApi, HANDLER.hdrSqs],
|
|
32
|
+
[ACTIONS.update]: [HANDLER.hdrApi, HANDLER.hdrSqs],
|
|
33
|
+
[ACTIONS.get]: [HANDLER.hdrApi, HANDLER.hdrInv],
|
|
34
|
+
[ACTIONS.delete]: [HANDLER.hdrApi, HANDLER.hdrSqs]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const RESOURCE_CLASSES = {
|
|
38
|
+
sqs: 'sqs',
|
|
39
|
+
s3: 's3',
|
|
40
|
+
dynamoDbTable: 'dynamodb',
|
|
41
|
+
dynamoDbAcrossService: 'dynamodb',
|
|
42
|
+
sns: "sns",
|
|
43
|
+
lambda: "lambda",
|
|
44
|
+
webSocket: "webSocket"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {string} resourceClass
|
|
50
|
+
* @param {string} resourceName
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
function resourceNames(resourceClass, resourceName) {
|
|
54
|
+
return {
|
|
55
|
+
[RESOURCE_CLASSES.sqs]: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}" + resourceName,
|
|
56
|
+
[RESOURCE_CLASSES.s3]: "arn:aws:s3:::" + resourceName,
|
|
57
|
+
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${self:custom.iz_region}:${self:custom.iz_accountId}:table/${self:custom.iz_resourcePrefix}" + resourceName,
|
|
58
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}" + resourceName,
|
|
59
|
+
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:${self:custom.iz_resourcePrefix}" + resourceName,
|
|
60
|
+
[RESOURCE_CLASSES.webSocket]: "arn:aws:execute-api:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_webSocketHostId}/Test/POST/@connections/{connectionId}"
|
|
61
|
+
}[resourceClass];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param {string} action
|
|
67
|
+
* @param {string} resource
|
|
68
|
+
* @param {string} effect - optional default Allow
|
|
69
|
+
* @returns {{ effect, action, resource}}
|
|
70
|
+
*/
|
|
71
|
+
function createIamRole(action, resource = [], effect = "Allow") {
|
|
72
|
+
if (Array.isArray(action)) {
|
|
73
|
+
const actionObj = {};
|
|
74
|
+
action.forEach(act => {
|
|
75
|
+
if (act.includes(":")) {
|
|
76
|
+
const [serviceAction, resourceAction] = act.split(":")
|
|
77
|
+
actionObj[serviceAction] = [upperCase(resourceAction)]
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
action = actionObj
|
|
81
|
+
} else {
|
|
82
|
+
for (const resourceAction in action) {
|
|
83
|
+
if (typeof (action[resourceAction]) === 'string') {
|
|
84
|
+
action[resourceAction] = [action[resourceAction]]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!Array.isArray(action[resourceAction])) {
|
|
88
|
+
throw new Error(`resourceAction:${resourceAction} should be string or array`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
effect,
|
|
95
|
+
action,
|
|
96
|
+
resource
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
// relative with ./app/src
|
|
102
|
+
const SOURCE_PATH = {
|
|
103
|
+
appYaml: `../sls_yaml/generatedCode/source/`,
|
|
104
|
+
resourceYaml: `../../resource/sls_yaml/generatedCode/source/`,
|
|
105
|
+
externalService: '../initial_setup/generatedCode/source/',
|
|
106
|
+
lambdaPerAction: '../src/generatedCode/ObjectTypePerActionEndpoint/source/',
|
|
107
|
+
outPerActionComplete: "../src/generatedCode/OutPerActionComplete/source/",
|
|
108
|
+
resourceLocationOutPerActionComplete: "src/generatedCode/OutPerActionComplete/source/",
|
|
109
|
+
relationshipPerAction: '../src/generatedCode/RelationshipPerAction/source/',
|
|
110
|
+
findData: '../src/generatedCode/FindData/source/',
|
|
111
|
+
translateIdsRequestFile: '../src/generatedCode/TranslateId/source/',
|
|
112
|
+
processLogical: "../src/generatedCode/ProcessLogical/source/",
|
|
113
|
+
resourceLocationPerAction: 'src/generatedCode/ObjectTypePerActionEndpoint/source/',
|
|
114
|
+
resourceLocationFindData: 'src/generatedCode/FindData/source',
|
|
115
|
+
resourceLocationRelationshipPerAction: 'src/generatedCode/RelationshipPerAction/source/',
|
|
116
|
+
resourceLocationTranslateId: 'src/generatedCode/TranslateId/source/',
|
|
117
|
+
resourceLocationProcessLogical: "src/generatedCode/ProcessLogical/source/",
|
|
118
|
+
webSocket: "../src/generatedCode/FlowSchema/source/",
|
|
119
|
+
resourceLocationWebSocket: "src/generatedCode/FlowSchema/source/",
|
|
120
|
+
generateCodeLib: "../src/generatedCode/libs/source/",
|
|
121
|
+
logicalFunctionHook: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source/",
|
|
122
|
+
resourceLocationLogicalFunctionHook: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source",
|
|
123
|
+
generatedCodeHookFunction: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
124
|
+
resourceLocationGeneratedCodeHookFunction: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
125
|
+
generatedAttributeTree: "../src/schemas/generatedCode/source/"
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const DEFAULT_LAMBDA_ROLE_PER_ACTION = {
|
|
129
|
+
[ACTIONS.create]: {
|
|
130
|
+
dynamoDbPermission: 'PutItem',
|
|
131
|
+
httpMethod: 'put',
|
|
132
|
+
},
|
|
133
|
+
[ACTIONS.update]: {
|
|
134
|
+
dynamoDbPermission: 'UpdateItem',
|
|
135
|
+
httpMethod: 'post',
|
|
136
|
+
},
|
|
137
|
+
[ACTIONS.get]: {
|
|
138
|
+
dynamoDbPermission: 'GetItem',
|
|
139
|
+
httpMethod: 'post',
|
|
140
|
+
},
|
|
141
|
+
[ACTIONS.delete]: {
|
|
142
|
+
dynamoDbPermission: 'DeleteItem',
|
|
143
|
+
httpMethod: 'delete',
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const SQS_RESOURCE = {
|
|
148
|
+
sendMessage: "SendMessage",
|
|
149
|
+
receiveMessage: "ReceiveMessage",
|
|
150
|
+
deleteMessage: "DeleteMessage",
|
|
151
|
+
getQueueAttributes: "GetQueueAttributes",
|
|
152
|
+
deleteMessageBatch: "DeleteMessageBatch",
|
|
153
|
+
getQueueUrl: "GetQueueUrl"
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const SNS_RESOURCE = {
|
|
157
|
+
publish: "Publish",
|
|
158
|
+
subscribe: "Subscribe"
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const DYNAMO_RESOURCE = {
|
|
162
|
+
putItem: "PutItem",
|
|
163
|
+
getItem: "GetItem",
|
|
164
|
+
query: "Query",
|
|
165
|
+
updateItem: "UpdateItem",
|
|
166
|
+
deleteItem: "DeleteItem"
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const LAMBDA_RESOURCE = {
|
|
170
|
+
invokeFunction: "InvokeFunction"
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const S3_RESOURCE = {
|
|
174
|
+
getObject: "GetObject",
|
|
175
|
+
getObjectTagging: "GetObjectTagging",
|
|
176
|
+
deleteObject: "DeleteObject",
|
|
177
|
+
deleteObjectTagging: "DeleteObjectTagging",
|
|
178
|
+
putObject: "PutObject",
|
|
179
|
+
putObjectTagging: "PutObjectTagging",
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
function externalResourceName(resourceClass, resourceName, serviceTag) {
|
|
183
|
+
return {
|
|
184
|
+
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/${await dynamoSharedLib.tableName(_izContext, " + `"${resourceName}" ,"${serviceTag}")}`,
|
|
185
|
+
// [RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/*/" + `${resourceName}`,
|
|
186
|
+
[RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/" + `"${serviceTag}"` + `"${resourceName}"`,
|
|
187
|
+
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${await lambdaSharedLib.lambdaFunctionName(_izContext, " + `"${resourceName}" ,"${serviceTag}")}`,
|
|
188
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${await snsSharedLib.snsTopicName(_izContext, " + `"${resourceName}", "${serviceTag}")}`
|
|
189
|
+
|
|
190
|
+
}[resourceClass]
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
function externalResourceYaml(resourceClass, resourceName, serviceTag) {
|
|
194
|
+
if (!serviceTag) {
|
|
195
|
+
serviceTag = "${self:custom.iz_resourcePrefix}"
|
|
196
|
+
} else {
|
|
197
|
+
serviceTag = serviceTag + "Test"
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${self:custom.iz_region}:${self:custom.iz_accountId}:table/" + `${serviceTag}` + `${resourceName}`,
|
|
201
|
+
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:" + `${serviceTag}` + `${resourceName}`,
|
|
202
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${self:custom.iz_region}:${self:custom.iz_accountId}:" + `${serviceTag}` + `${resourceName}`,
|
|
203
|
+
[RESOURCE_CLASSES.sqs]: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:" + `${serviceTag}` + `${resourceName}`
|
|
204
|
+
|
|
205
|
+
}[resourceClass]
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const SAVE_FILE_NAME = {
|
|
209
|
+
dynamoDbYaml: "generated-dynamoDB-table",
|
|
210
|
+
snsInSqsYaml: "generated-sns-in-sqs",
|
|
211
|
+
snsOutYaml: "generated-sns-out",
|
|
212
|
+
functionRelationshipYaml: "RelationshipPerAction",
|
|
213
|
+
functionPerActionYaml: "per-action-function",
|
|
214
|
+
externalLambdaRole: "generatedLambdaRoleServiceConfig",
|
|
215
|
+
snsSubscription: "generatedSnsServiceConfig",
|
|
216
|
+
translateId: "TranslateIdsRequest",
|
|
217
|
+
findData: "findData",
|
|
218
|
+
processLogicalYaml: "processLogical",
|
|
219
|
+
flowSchema: "flowSchema",
|
|
220
|
+
S3Bucket: "generated-s3-bucket",
|
|
221
|
+
sharedResourceYaml: "generate-SharedResource",
|
|
222
|
+
attributeTreeObjectRelationship: "ObjectRelationships",
|
|
223
|
+
attributeTreeRefObjectRelationship: "RefObjectRelationships",
|
|
224
|
+
attributeTreeObjectSchema: "ObjectFieldSchema"
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const FUNCTION_NAME = {
|
|
228
|
+
updateRel: "updateRelationship",
|
|
229
|
+
createRel: "createRelationship",
|
|
230
|
+
updateRelComplete: "updateRelationshipComplete",
|
|
231
|
+
createRelComplete: "createRelationshipComplete",
|
|
232
|
+
deleteRel: "deleteRelationship",
|
|
233
|
+
deleteRelComplete: "deleteRelationshipComplete",
|
|
234
|
+
translateId: "translateIdsRequest",
|
|
235
|
+
translateIdsProcess: "processTranslateIds",
|
|
236
|
+
outTranslateIds: "processTranslateIdsComplete",
|
|
237
|
+
findData: "findData",
|
|
238
|
+
processLogical: "processLogical",
|
|
239
|
+
updateNodeComplete: "updateNodeComplete",
|
|
240
|
+
createObjectComplete: "createObjectComplete",
|
|
241
|
+
getNodeComplete: "getNodeComplete",
|
|
242
|
+
paginateProcessLogical: "paginateProcessLogical",
|
|
243
|
+
deleteNode: "deleteNode",
|
|
244
|
+
deleteNodeComplete: "deleteNodeComplete",
|
|
245
|
+
createObjectS3: "createObjectS3",
|
|
246
|
+
createObjectS3Complete: "webSocketTaskComplete",
|
|
247
|
+
processAfterUploadS3: "processAfterUploadS3"
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const SHORT_FUNCTION_NAME = {
|
|
251
|
+
updateRel: "updateRel",
|
|
252
|
+
createRel: "createRel",
|
|
253
|
+
updateRelComplete: "updateRelComp",
|
|
254
|
+
createRelComplete: "createRelComp",
|
|
255
|
+
deleteRel: "deleteRel",
|
|
256
|
+
deleteRelComplete: "deleteRelComp",
|
|
257
|
+
translateId: "translateIdsReq",
|
|
258
|
+
translateIdsProcess: "processTranslateIds",
|
|
259
|
+
outTranslateIds: "processTranslateIdsComp",
|
|
260
|
+
findData: "findData",
|
|
261
|
+
processLogical: "processLogical",
|
|
262
|
+
updateNodeComplete: "updateNodeComp",
|
|
263
|
+
createObjectComplete: "createObjectComp",
|
|
264
|
+
getNodeComplete: "getNodeComp",
|
|
265
|
+
paginateProcessLogical: "paginateProLogical",
|
|
266
|
+
deleteNode: "deleteNode",
|
|
267
|
+
deleteNodeComplete: "deleteNodeComp",
|
|
268
|
+
createObjectS3Complete: "webSocketTaskComp",
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) => {
|
|
272
|
+
const graphServiceNameSet = new Set();
|
|
273
|
+
await Promise.all(allRelSchemas.map(async relSchema => {
|
|
274
|
+
let relTag = Object.keys(relSchema)[0];
|
|
275
|
+
let relSchemaData = relSchema[relTag];
|
|
276
|
+
|
|
277
|
+
await Promise.all(Object.values(relSchemaData.storageResources).map(async storageResource => {
|
|
278
|
+
if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
279
|
+
const getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag);
|
|
280
|
+
graphServiceNameSet.add(getGraphServiceName)
|
|
281
|
+
}
|
|
282
|
+
}))
|
|
283
|
+
}))
|
|
284
|
+
const graphServiceName = [...graphServiceNameSet]
|
|
285
|
+
return graphServiceName
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
function defaultIamRolePerAction() {
|
|
289
|
+
|
|
290
|
+
let defaultIamRole = [];
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
defaultIamRole.push(
|
|
294
|
+
createIamRole(
|
|
295
|
+
{
|
|
296
|
+
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
297
|
+
},
|
|
298
|
+
[
|
|
299
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
300
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
301
|
+
]
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
defaultIamRole.push(
|
|
306
|
+
createIamRole(
|
|
307
|
+
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
308
|
+
[
|
|
309
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
return defaultIamRole
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
function getComplexFilterServiceTag(allObjectSchemas) {
|
|
318
|
+
const complexFilterServiceTagSet = new Set();
|
|
319
|
+
for (let objectSchema of allObjectSchemas) {
|
|
320
|
+
complexFilterServiceTagSet.add(objectSchema.complexFilterServiceTag)
|
|
321
|
+
}
|
|
322
|
+
let complexFilterServiceTags = [...complexFilterServiceTagSet];
|
|
323
|
+
return complexFilterServiceTags
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
|
|
327
|
+
const graphServiceName = new Set();
|
|
328
|
+
for (const objectSchema of allObjSchemas) {
|
|
329
|
+
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
330
|
+
if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
331
|
+
let getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag)
|
|
332
|
+
graphServiceName.add(getGraphServiceName)
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
let graphServiceNames = [...graphServiceName]
|
|
337
|
+
// console.log("graphServiceName", graphServiceNames)
|
|
338
|
+
return graphServiceNames
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
function awaitingMultipleStepsRole() {
|
|
342
|
+
let awaitingMultipleStepsRole = createIamRole(
|
|
343
|
+
{
|
|
344
|
+
[RESOURCE_CLASSES.dynamoDbTable]:
|
|
345
|
+
[
|
|
346
|
+
DYNAMO_RESOURCE.updateItem,
|
|
347
|
+
DYNAMO_RESOURCE.putItem,
|
|
348
|
+
DYNAMO_RESOURCE.deleteItem,
|
|
349
|
+
DYNAMO_RESOURCE.query
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
[
|
|
353
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
354
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending"),
|
|
355
|
+
]
|
|
356
|
+
)
|
|
357
|
+
return awaitingMultipleStepsRole
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
function shortNameHandler(fullNameHandler) {
|
|
361
|
+
return fullNameHandler.slice(3)
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const SOURCE_GENERATE_IAM_ROLE = {
|
|
365
|
+
ProcessFindDataRole: "ProcFindData",
|
|
366
|
+
ObjectCompleteRole: "ObjectCom",
|
|
367
|
+
NodeCompleteRole: "NodeCom",
|
|
368
|
+
RelationshipRole: "Relationship",
|
|
369
|
+
RelationshipCompleteRole: "RelationshipCom",
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const ADD_ON_DATA_STRUCTURE_TYPE = {
|
|
373
|
+
versionedData: "versionedData",
|
|
374
|
+
attributeTree: "attributeTree"
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
const ATTRIBUTE_TAG = {
|
|
378
|
+
attributeTagLabel: "Label",
|
|
379
|
+
attributeTagLink: "Link",
|
|
380
|
+
attributeTagProperty: "Property",
|
|
381
|
+
attributeTagPropertyLabel: "PropertyLabel",
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const FIELD_NAME_TPYE = {
|
|
385
|
+
identifiers: "identifiers",
|
|
386
|
+
nonIdentifiers: "nonIdentifiers",
|
|
387
|
+
requiredOnCreateFieldName: "requiredOnCreateFieldName",
|
|
388
|
+
randomOnCreateFieldName: "randomOnCreateFieldName",
|
|
389
|
+
optionalOnCreate: "optionalOnCreate"
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
function fieldNameSetting(fieldNameType) {
|
|
393
|
+
const stringValidation = "^[a-zA-Z0-9-_]+$"
|
|
394
|
+
return {
|
|
395
|
+
[FIELD_NAME_TPYE.identifiers]: {
|
|
396
|
+
type: "string",
|
|
397
|
+
requiredOnCreate: true,
|
|
398
|
+
optionalOnCreate: false,
|
|
399
|
+
canUpdate: false,
|
|
400
|
+
randomOnCreate: false,
|
|
401
|
+
validation: {
|
|
402
|
+
pattern: stringValidation
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
[FIELD_NAME_TPYE.nonIdentifiers]: {
|
|
406
|
+
type: "string",
|
|
407
|
+
requiredOnCreate: false,
|
|
408
|
+
optionalOnCreate: false,
|
|
409
|
+
canUpdate: true,
|
|
410
|
+
randomOnCreate: false,
|
|
411
|
+
validation: {
|
|
412
|
+
pattern: stringValidation
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
[FIELD_NAME_TPYE.requiredOnCreateFieldName]: {
|
|
416
|
+
type: "string",
|
|
417
|
+
requiredOnCreate: true,
|
|
418
|
+
optionalOnCreate: false,
|
|
419
|
+
canUpdate: false,
|
|
420
|
+
randomOnCreate: false,
|
|
421
|
+
validation: {
|
|
422
|
+
pattern: stringValidation
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
[FIELD_NAME_TPYE.randomOnCreateFieldName]: {
|
|
426
|
+
type: "string",
|
|
427
|
+
requiredOnCreate: true,
|
|
428
|
+
optionalOnCreate: false,
|
|
429
|
+
canUpdate: false,
|
|
430
|
+
randomOnCreate: false,
|
|
431
|
+
validation: {
|
|
432
|
+
pattern: stringValidation
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
[FIELD_NAME_TPYE.optionalOnCreate]: {
|
|
436
|
+
type: "string",
|
|
437
|
+
requiredOnCreate: false,
|
|
438
|
+
optionalOnCreate: true,
|
|
439
|
+
canUpdate: false,
|
|
440
|
+
randomOnCreate: false,
|
|
441
|
+
validation: {
|
|
442
|
+
pattern: stringValidation
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}[fieldNameType]
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
const PREFIX_RELATIONSHIP = {
|
|
449
|
+
has: "has",
|
|
450
|
+
is: "is",
|
|
451
|
+
disabled: "disabled"
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
module.exports = {
|
|
455
|
+
ACTIONS,
|
|
456
|
+
DEFAULT_HANDLER_PER_ACTION,
|
|
457
|
+
RESOURCE_CLASSES,
|
|
458
|
+
resourceNames,
|
|
459
|
+
createIamRole,
|
|
460
|
+
SOURCE_PATH,
|
|
461
|
+
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
462
|
+
SQS_RESOURCE,
|
|
463
|
+
SNS_RESOURCE,
|
|
464
|
+
DYNAMO_RESOURCE,
|
|
465
|
+
LAMBDA_RESOURCE,
|
|
466
|
+
HANDLER,
|
|
467
|
+
externalResourceName,
|
|
468
|
+
externalResourceYaml,
|
|
469
|
+
SAVE_FILE_NAME,
|
|
470
|
+
FUNCTION_NAME,
|
|
471
|
+
getGraphServiceNameFromAllRelSchema,
|
|
472
|
+
defaultIamRolePerAction,
|
|
473
|
+
getComplexFilterServiceTag,
|
|
474
|
+
getGraphServiceNameFromObjectSchema,
|
|
475
|
+
awaitingMultipleStepsRole,
|
|
476
|
+
shortNameHandler,
|
|
477
|
+
SHORT_FUNCTION_NAME,
|
|
478
|
+
S3_RESOURCE,
|
|
479
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
480
|
+
fieldNameSetting,
|
|
481
|
+
FIELD_NAME_TPYE,
|
|
482
|
+
ADD_ON_DATA_STRUCTURE_TYPE,
|
|
483
|
+
ATTRIBUTE_TAG,
|
|
484
|
+
PREFIX_RELATIONSHIP
|
|
485
|
+
}
|